-
Notifications
You must be signed in to change notification settings - Fork 21
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
✨ Partial equivalence checking #375
✨ Partial equivalence checking #375
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #375 +/- ##
=======================================
+ Coverage 96.2% 96.4% +0.1%
=======================================
Files 34 34
Lines 1753 1763 +10
Branches 215 217 +2
=======================================
+ Hits 1688 1701 +13
+ Misses 65 62 -3
|
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Hey @reb-ddm 👋🏼 Many thanks for all the work here! I took the liberty to rework some bits and pieces, but overall this is looking great and ready to merge. Once CI is all-green here, I'll start by merging the mqt-core PR and changing back the submodule pointers from the fork to the main repository. After that, this should be good to go 🎉 |
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice how little change was required here to enable support for partial equivalence checking! 🎉
This is now also ready to merge ✅
The C++ linter (unfortunately) fails on all PRs from forks due to missing permissions. But this can be safely ignored.
I'll admin-merge once all checks have run through.
Description
Added a flag
checkPartialEquivalence
in order to decide whether to check for total equivalence or for partial equivalence. Two circuits are partially equivalent if, for each possible initial input state, they have the same probability for each measurement outcome. Therefore the state of not measured qubits (= garbage qubits), or phases are ignored.The Construction Checker and the Simulation Checker implement this by reducing the contribution of garbage qubits in the matrix/vector representation of the circuit. Additionally, all weights in the DD representation are set to their magnitude, such that different phases don't influence the result.
The Alternating Checker implements it by checking that the resulting matrix representation is equal to a diagonal matrix, modulo garbage qubits (instead of checking that it is equal to the identity matrix).
For more information, there is documentation in the file
PartialEquivalence.ipynb
.An additional feature are the automatically generated benchmarks for partial equivalence. The function
generatePartiallyEquivalentCircuits
generates pairs of circuits which are partially equivalent, following the method described in the paper Partial Equivalence Checking of Quantum Circuits in Section VI. B.Fixes issue #155
Checklist: