cda-tum / mqt-qcec

MQT QCEC - A tool for Quantum Circuit Equivalence Checking
https://mqt.readthedocs.io/projects/qcec
MIT License
90 stars 21 forks source link

✨ Approximate Equivalence Checking #442

Open TeWas opened 1 month ago

TeWas commented 1 month ago

What's the problem this feature will solve?

Currently, the equivalence of two quantum circuits, 𝑈 and 𝑉, is checked by comparing 𝑈𝑉† to the identity DD in isCloseToIdentity. However, this approach does not account for approximate equivalence, which can be sufficient in practice.

Describe the solution you'd like

To address this, the Frobenius inner product between 𝑈 and 𝑉 can be computed and compared to a predefined threshold to determine approximate equivalence.

  1. AlternatingChecker:

    • Compute the trace of 𝑈𝑉† and compare it with the threshold.
  2. ConstructionChecker:

    • Invert circuit 𝑉
    • Compute 𝑈𝑉†
    • Compute the trace of 𝑈𝑉† and compare it with the threshold.
  3. SimulationChecker:

    • Configure fidelityThreshold accordingly