Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide equivalence checkers #761

Closed
delapuente opened this issue Aug 9, 2018 · 7 comments
Closed

Provide equivalence checkers #761

delapuente opened this issue Aug 9, 2018 · 7 comments
Assignees
Labels

Comments

@delapuente
Copy link
Contributor

delapuente commented Aug 9, 2018

According to @liupibm:

The goal of the quivalence checker

Given two circuits, check whether their final amplitude vectors V1 and V2 are equivalent: they differ only in the global phase, i.e., the equation V1E^(Ix)=V2 has a solution.

This is useful for debugging transpiler passes also.

@jaygambetta
Copy link
Member

As in the last one this goes on hold until we are ready to scientifically discuss this. Can you put this back on hold or make it in a roadmap for qiskit 0.8. We will have an equivalence checker but after the transpiler is complete.

@ajavadia
Copy link
Member

This is being done in Aer now.

@ajavadia
Copy link
Member

reopening as the API to interact with the equivalence checker may end up in Terra

@kevinsung
Copy link
Contributor

We have

Operator(circuit).equiv(Operator(other_circuit))

and

Statevector(circuit).equiv(Statevector(other_circuit))

Am I misunderstanding, or is this issue asking for something else?

@burgholzer
Copy link
Contributor

We have

Operator(circuit).equiv(Operator(other_circuit))

and

Statevector(circuit).equiv(Statevector(other_circuit))

Am I misunderstanding, or is this issue asking for something else?

Both of these scale exponentially with the number of qubits in the system.
If someone is interested in a more scalable equivalence checker that works out of the box with Qiskit, have a look at MQT QCEC (https://github.com/cda-tum/mqt-qcec, pip install mqt.qcec).

Verifying the equivalence of two Qiskit circuits is as easy as

from mqt.qcec import verify 

res = verify(qc1, qc2)

Note that the tool uses dedicated data structures (decision diagrams and ZX calculus) plus dedicated verification schemes to make the verification way more scalable than the simple construction and comparison of the circuits' unitaries. More information can be found in the documentation at https://mqt.rtfd.io/projects/qcec

@eliarbel
Copy link
Contributor

eliarbel commented Mar 6, 2024

Thanks @burgholzer for sharing!

@1ucian0, @ajavadia this is quite an old issue. Apparently, there are both built-in as well as 3rd party solutions. So, do we still want to keep this open?

@1ucian0
Copy link
Member

1ucian0 commented Mar 6, 2024

great work @burgholzer and team! Consider submitting the project to the Qiskit Ecosystem :)

Indeed, probably this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

7 participants