qiskit icon indicating copy to clipboard operation
qiskit copied to clipboard

Vertical Circuit Drawings

Open AlexanderGroeger opened this issue 1 year ago • 3 comments
trafficstars

What should we add?

What to add Add a vertical keyword argument to the QuantumCircuit.draw method

What does it do? Plot the circuit vertically with the circuit starting at the top of the plot and ending at bottom.

What's the use case? Drawing deep quantum circuits often extend off the screen and wrap onto a "newline" which can be clunky to follow. Many Qiskit developers use Jupyter notebooks that scroll vertically, thus plotting circuits vertically would yield better visualization flow on a notebook or figure in a paper.

AlexanderGroeger avatar Apr 10 '24 18:04 AlexanderGroeger

Hi Alexander, Wondering whether a scrollable horizontal orientation would also suit your use-case, i.e. scrollable horizontal orientation rather than vertical 🤔.

Or perhaps either would be an improvement on the current behavior 🤷‍♂️. Would like to work on this issue. Let me know your thoughts.

jwalaQ avatar Apr 29 '24 14:04 jwalaQ

Just noticed there's an argument fold within the QuantumCircuit.draw() method which controls pagination of the output.

The entire circuit can be displayed in a single row if set to fold = -1. The image becomes tiny but can be zoomed into, maintaining the original quality.

Nonetheless, the feature request stands.

jwalaQ avatar Apr 29 '24 14:04 jwalaQ

Hello Prajjwal,

Thank you for looking at my feature request. I'm delighted to hear you have interest in working on this issue. A scrollable horizontal plot would be low hanging fruit. I think it would be a good first step, perhaps it's already been done. I imagine if you use fold=-1 and something like figsize=(80,10), you could easily get a really wide figure which might be scrollable horizontally already.

I think the deep circuit paper figures use case is the only realistic reasoning for having a vertical layout because you may be able to fit your circuit better vertically than horizontally, nevertheless I think a vertical layout would be cool if there's interest for it.

AlexanderGroeger avatar Apr 30 '24 00:04 AlexanderGroeger