-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix ZX-checker inadvertedly terminating early (#382)
## Description While experimenting on some benchmarks, it turned out that, sometimes, the ZX checker would just stop simplification even though further simplifications were possible. This PR adresses the underlying bug by revamping and simplifying the handling of the stopping criterion during ZX simplification. A (not necessarily minimal) reproducer for the bug is: ```python from mqt.bench import CompilerSettings, QiskitSettings, get_benchmark from mqt.qcec import verify_compilation alg = "ae" num_qubits = 7 # construct the first circuit qc1 = get_benchmark(alg, circuit_size=num_qubits, level="alg") # construct the second circuit optimization_level = 2 settings = CompilerSettings(qiskit=QiskitSettings(optimization_level=2)) qc2 = get_benchmark(alg, circuit_size=num_qubits, level="nativegates", compiler_settings=settings) # verify the compilation only using the ZX checker result2 = verify_compilation( qc1, qc2, optimization_level=optimization_level, run_alternating_checker=False, run_zx_checker=True, run_simulation_checker=False, ) print(f"ZX-Checker \t|\t {result2.considered_equivalent()} \t|\t {result2.check_time}") ``` ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines. Signed-off-by: burgholzer <burgholzer@me.com>
- Loading branch information
1 parent
e45f80f
commit 7bcf851
Showing
2 changed files
with
78 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters