qiskit
qiskit copied to clipboard
Add support for a visual-only `Barrier`
What should we add?
Often, it is helpful to add visual barriers in the rendered circuit for ease of reference. Currently, this is achieved via the Barrier
instruction. However, using the Barrier
instruction has a direct impact on circuit optimizations (docs).
It also acts as a directive for circuit compilation to separate pieces of a circuit so that any optimizations or re-writes are constrained to only act between barriers.
Is there any existing support for visual-only barriers that don't affect circuit optimization? If not, I think adding this might be helpful.
For instance, the following is much easier to reference and looks better organized with the help of barriers...
... as compared to:
While this is a toy example, visual barriers would help for more complex circuits.
Proposed approaches:
- Add a parameter to
Barrier
that denotes whether the barrier is a visual-only barrier or if it affects compilation too. The two barriers types should be rendered differently. - Add another instruction for a visual-only barrier.
### Tasks