Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
4.83k stars 2.29k forks source link

Apply Peephole Optimization Before Routing #12562

Open sbrandhsn opened 3 weeks ago

sbrandhsn commented 3 weeks ago

What should we add?

We should investigate to apply peephole optimization before routing.

mtreinish commented 1 week ago

In principle I agree this is a really good idea, and now that 2q unitary synthesis is quite fast we can get a lot of potential benefit out of this. However, we have tried this in the past for 1q in https://github.com/Qiskit/qiskit/pull/11354 but had to revert it in https://github.com/Qiskit/qiskit/pull/11360 because it caused issues for people targeting discrete basis sets. The trick for this will be around making sure we don't break that use case in adding this. We'll probably want some conditions in the pass manager construction to avoid doing this in certain conditions.