Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

circuit_to_latex_using_qcircuit produces a diagram with bad margins

Open dlyongemallo opened this issue 7 years ago • 4 comments

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

dlyongemallo avatar Apr 01 '19 08:04 dlyongemallo

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..

Strilanc avatar Apr 01 '19 15:04 Strilanc

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.)

dlyongemallo avatar Apr 03 '19 04:04 dlyongemallo

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

Strilanc avatar Apr 03 '19 04:04 Strilanc

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

dabacon avatar May 03 '20 21:05 dabacon

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

tanujkhattar avatar Feb 02 '24 08:02 tanujkhattar