qiskit icon indicating copy to clipboard operation
qiskit copied to clipboard

Add support for a visual-only `Barrier`

Open BhumikaSaini opened this issue 11 months ago • 3 comments

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

image

... as compared to:

image

While this is a toy example, visual barriers would help for more complex circuits.

Proposed approaches:

  1. 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.
  2. Add another instruction for a visual-only barrier.
### Tasks

BhumikaSaini avatar Mar 09 '24 17:03 BhumikaSaini