quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.25k stars 1.01k forks source link

circuit_to_latex_using_qcircuit produces a diagram with bad margins #1487

Closed dlyongemallo closed 8 months ago

dlyongemallo commented 5 years ago

I'm not actually sure whether this is a Cirq problem or a qcircuit problem or a jupyter notebook problem. I'm trying to plot a graphical representation of a Cirq circuit in a jupyter notebook using circuit_to_latex_using_qcircuit. However, the produced output has effectively negative margins, so that parts of the image are outside the borders (and thus are not displayed).

Different circuits can have different parts cut off, but for a simple circuit the input and output labels are not visible. This is true whether the output is pdf or png.

Here is a repro case (if you take out the work-around of border=25pt which forces it to work for the particular example): https://gitlab.com/qosf/qml-mooc/merge_requests/14/diffs#9fb6ab7d0ea5d69d872cb08c4ff1e68861b7c397_173_193

Strilanc commented 5 years ago

This is a qcircuit bug. That being said, I don't think it's going to be fixed there and we probably should work around it somehow..

dlyongemallo commented 5 years ago

Where can I report (or fix) qcircuit bugs?

(Also: Filed https://gitlab.com/qosf/qml-mooc/issues/2 to remember to update the notebook where I found the problem once it's fixed or worked around.)

Strilanc commented 5 years ago

I don't actually know if there's anyone maintaining it...

dabacon commented 4 years ago

This is probably another vote fore #1290 especially if qcircuit isn't being updated.

tanujkhattar commented 8 months ago

qcircuit should be deprecated in favour of using qpic, which is being tracked in https://github.com/quantumlib/Cirq/issues/5895