quantum-compiler / quartz

The Quartz Quantum Compiler
Apache License 2.0
77 stars 19 forks source link

[Generator] Do not invoke the Python verifier by default when no parameters #53

Closed xumingkuan closed 2 years ago

xumingkuan commented 2 years ago

This PR renames the parameter verify_equivalences of generate() to invoke_python_verifier as a switch to invoke the Python verifier or not. When this is true, the behavior is exactly the same as before this PR.

When invoke_python_verifier is false, Quartz will not invoke the Python verifier which verifies all equivalences by Z3. Instead, it treats circuits with hash values differing no more than 1 as equivalent.

When there are no parameters in the circuits, as long as two circuits' hash values are very close to each other, even if they are actually not equivalent, it is guaranteed that their matrices will not differ much. So it is considered safe to not invoke the Python verifier (which will accelerate the generation time by a lot) in this case.