mitiq icon indicating copy to clipboard operation
mitiq copied to clipboard

Explore the possibility of supporting Qiskit barriers

Open andreamari opened this issue 2 years ago • 2 comments

In principle, Mitiq should preserve the structure of input circuits as much as possible, apart from the transformations that are necessary for error mitigation (e.g. unitary folding).

For this reason it would be great if Qiskit barriers could be preserved. See this link for more info on barriers. Unfortunately, since there is not a "barrier gate" in Cirq, this is not easy.

The current approach is quite brute-force since we just remove all barriers from qiskit circuits. However this is not ideal and the user should at least be aware of this.

Proposed Solution

The first part of this issue is exploring/proposing a possible solution. Maybe there is a simple solution. Maybe not.

The second part of this issue is implementing a potential solution or, in the worst case, keeping the current code but at least warning the user that barriers are not supported and so they are removed.

andreamari avatar Jul 08 '22 17:07 andreamari

How about a custom placeholder gate, like this (Thanks to Dr. E. Z. with the assist 🤖😉): image

Aaron-Robertson avatar Apr 27 '23 17:04 Aaron-Robertson

Nice idea! What happens when converted to QASM?

Misty-W avatar Apr 28 '23 16:04 Misty-W