Skip to content

Add fold-like parameter to break long circuit diagrams onto next line (like Qiskit) #1718

@amalraj28

Description

@amalraj28

Currently, plot_circuit draws quantum circuits as one long horizontal line, which is challenging for visualization on websites and leads to poor readability, especially on smaller or variable screen sizes. Similar to how the line-wrap parameter wraps text diagrams by character count, it would be very beneficial to have a new parameter in plot_circuit for matplotlib figures that breaks long circuit diagrams onto multiple rows in the image, improving clarity and adaptability.

What I would want


In Qiskit, matplotlib circuit diagrams automatically break onto next lines (see attached image), greatly improving readability.

Image

In Qibo, the same circuit appears as a long horizontal image, as in the below image.

Image

Adding a parameter to plot_circuit to allow user-specified line breaks (based on gate count, circuit depth, or qubit count) would solve this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions