mqt-qmap
mqt-qmap copied to clipboard
Delayed Phase Correction
Description
This PR introduces a feature where stabilizer phases are ignored during Clifford synthesis. If that happens, the phases are corrected during a post-processing step.
Fixes #326
Checklist:
- [ ] The pull request only contains commits that are related to it.
- [ ] I have added appropriate tests and documentation.
- [ ] I have made sure that all CI jobs on GitHub pass.
- [ ] The pull request introduces no new warnings and follows the project's style guidelines.
Hey @pehamTom 👋🏼
Haven't looked through this at all yet. Just a brief question: Is this something that's always guaranteed to be faster than the original version? If so, could we just fully replace the old version and avoid adding all those if statements for deciding between both options? Just thinking about maintainability here.
Ignoring the phase during synthesis does not guarantee depth-optimality. One could always back-propagate Paulis and fuse them with any single-qubit gates as a post-processing step. But I think it makes sense to respect the chosen gateset and leave the rest up to the user.
I wanted to compress the settings we have anyway. The maxsat method should be removed entirely for example as it is always worse. But that is something for another PR.
Codecov Report
Merging #397 (4b48b48) into main (5453be3) will increase coverage by
0.1%
. Report is 2 commits behind head on main. The diff coverage is96.2%
.
Additional details and impacted files
@@ Coverage Diff @@
## main #397 +/- ##
=======================================
+ Coverage 92.3% 92.4% +0.1%
=======================================
Files 44 49 +5
Lines 4158 4468 +310
Branches 701 764 +63
=======================================
+ Hits 3839 4132 +293
- Misses 319 336 +17
Flag | Coverage Δ | |
---|---|---|
cpp | 92.0% <96.2%> (+0.2%) |
:arrow_up: |
python | 95.9% <ø> (ø) |
Files | Coverage Δ | |
---|---|---|
include/cliffordsynthesis/Configuration.hpp | 100.0% <ø> (ø) |
|
include/cliffordsynthesis/Tableau.hpp | 97.6% <100.0%> (+0.5%) |
:arrow_up: |
...de/cliffordsynthesis/encoding/ObjectiveEncoder.hpp | 100.0% <100.0%> (ø) |
|
include/cliffordsynthesis/encoding/SATEncoder.hpp | 100.0% <ø> (ø) |
|
...e/cliffordsynthesis/encoding/SingleGateEncoder.hpp | 100.0% <ø> (ø) |
|
...lude/cliffordsynthesis/encoding/TableauEncoder.hpp | 100.0% <100.0%> (ø) |
|
src/Architecture.cpp | 95.0% <100.0%> (ø) |
|
src/cliffordsynthesis/CliffordSynthesizer.cpp | 97.5% <100.0%> (+<0.1%) |
:arrow_up: |
src/cliffordsynthesis/Utils.cpp | 100.0% <100.0%> (ø) |
|
...rc/cliffordsynthesis/encoding/MultiGateEncoder.cpp | 100.0% <100.0%> (ø) |
|
... and 10 more |
Ignoring the phase during synthesis does not guarantee depth-optimality. One could always back-propagate Paulis and fuse them with any single-qubit gates as a post-processing step. But I think it makes sense to respect the chosen gateset and leave the rest up to the user.
I wanted to compress the settings we have anyway. The maxsat method should be removed entirely for example as it is always worse. But that is something for another PR.
Sorry for responding so late here. For some reason, I missed the notification for the message.
I see! In that case, the separate option definitely makes sense. Compressing the settings is definitely much appreciated (in a separate PR, of course).
Is this PR ready for review then?
Now it is ready for review.
Cpp-Linter Report :warning:
Some files did not pass the configured checks!
clang-tidy reports: 1 concern(s)
-
src/Architecture.cpp
/src/Architecture.cpp:95:21: warning: [readability-identifier-naming]
invalid case style for static constant 'singleQubitGates'
static const auto singleQubitGates = {"id", "u1", "u2", "u3", ^~~~~~~~~~~~~~~~ SINGLE_QUBIT_GATES
Have any feedback or feature suggestions? Share it here.