unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
363 stars 162 forks source link

Explore the possibility of supporting Qiskit barriers #1391

Open andreamari opened 2 years ago

andreamari commented 2 years ago

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.

Aaron-Robertson commented 1 year ago

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

Misty-W commented 1 year ago

Nice idea! What happens when converted to QASM?