Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
293 commits
Select commit Hold shift + click to select a range
135d7b1
Refactoring
SalehAlsherif Jun 6, 2026
db68e10
added decode before measurements
SalehAlsherif Jun 6, 2026
b57e5cc
Merge branch 'feature/ErrorCorrection_SubMain' of github.com:emilkani…
Jun 6, 2026
bcb06ad
✅ Add Steane components
emilkanic0909 Jun 6, 2026
2265c5a
Movedcircuit running
Jun 11, 2026
624ed2a
Merge branch 'feature/ErrorCorrection_SubMain' of github.com:emilkani…
Jun 11, 2026
d3517db
+ Added funcionality to create gate_counts.json
Jun 11, 2026
6d79032
+ Added test for circuit structure
Jun 11, 2026
9700a88
✨ Adding QFT gate support
emilkanic0909 Jun 12, 2026
6c4b74b
Fixed logical Measurement on shor code transpiler
SalehAlsherif Jun 12, 2026
4866c88
new gate counts
Jun 13, 2026
78a8d6b
more qft :)
Jun 13, 2026
ba31cba
fixed measurement removal
Jun 13, 2026
5bfd6c2
more fixes
Jun 13, 2026
2b19794
Adding QFT gate to shor transpiler
SalehAlsherif Jun 13, 2026
9432119
Fix Measurements
emilkanic0909 Jun 13, 2026
2ef22f2
fixed circuit structure tests to work with dynamic numbers of classic…
Jun 13, 2026
2fa6380
added support for qft structural tests
Jun 13, 2026
31216cc
switched to custom measurement logic
Jun 13, 2026
5f29699
✨ Fixing Tests
emilkanic0909 Jun 13, 2026
21c9fd7
✨ Removing QFT Test
emilkanic0909 Jun 13, 2026
956006e
various improvements to code quality
Jun 13, 2026
d98c80a
Merge branch 'feature/ErrorCorrection_SubMain' of github.com:emilkani…
Jun 13, 2026
7853e8d
more fixes to resolve the bungled up merge conflict
Jun 13, 2026
b3e2c8b
automatic nox lint changes
Jun 13, 2026
22f71bf
added dependencies for testing
Jun 13, 2026
5553b37
removed finished TODOs
Jun 13, 2026
f5ba739
removed unused file
Jun 13, 2026
221eb86
more linting changes
Jun 13, 2026
bb53875
greatly improved readability of documentation
Jun 13, 2026
137fb83
Merge branch 'munich-quantum-toolkit:main' into main
Felix-Gundlach Jun 13, 2026
ceb55da
Merge remote-tracking branch 'origin/main' into feature/ErrorCorrecti…
Jun 13, 2026
08463e3
Added module docstring
Jun 13, 2026
33b24ce
updated uv.lock to reflect added dependencies
Jun 13, 2026
80f347f
fixed wrong import location
Jun 16, 2026
1d0e8de
Added explicit type checking to syndrome extraction
Jun 16, 2026
9576b21
Moved testing dependencies to appropriate pytest groups
Jun 16, 2026
5823f63
Varios little improvements to code quality
Jun 16, 2026
75df4d6
Corrected module docstring
Jun 16, 2026
bc6c18b
Corrected module docstring
Jun 16, 2026
fe66b60
Enabled Solovay-Kitaev synthesis on steanes qft decomposition
Jun 16, 2026
b1fc4c1
added debug message regarding qiskit version
Jun 16, 2026
af74ee5
Switched to 2-pass transpilation for Steane's
Jun 16, 2026
18a43d4
🚧 Turn off tests, that crashes mqt.qcec
emilkanic0909 Jun 20, 2026
2562ff8
🎨 pre-commit fixes
pre-commit-ci[bot] Jun 20, 2026
93acb24
reverted to old transpilation for QFT gate
Jun 27, 2026
74dd17e
Increased minimum qiskit version to 2.1 to support T gate transpilation
Jun 27, 2026
4e8b873
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Jun 27, 2026
8df9184
Increased qiskit version to 2.4 to include grisynth for QFT transpila…
Jun 27, 2026
620602d
removed redundant qiskit-aer & mqt.qcec specifications from dependencies
Jun 27, 2026
5cac15f
moved mqt.qcec dependency
Jun 27, 2026
5e723c4
moved qiskit aer dependency
Jun 27, 2026
db0c14c
lowered required fidelity for transpiler_correctness to account for u…
Jun 27, 2026
bf24cbd
🚑️ Skiping tests for ARM Ubuntu build
emilkanic0909 Jun 27, 2026
7cc25d2
🎨 pre-commit fixes
pre-commit-ci[bot] Jun 27, 2026
1fe9da5
removed unused ty suppression
Jun 27, 2026
5506f3b
unfeasable/unsupported testcases are now skipped
Jun 27, 2026
05f5251
🎨 Considering Rabbit AI
emilkanic0909 Jun 27, 2026
b7c2f2d
Updated Docstrings to indicate support for error correction encodings
Jun 27, 2026
4dd1e6e
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Jun 27, 2026
ee006cf
Documented missing aer builds
Jun 27, 2026
a216cb8
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Jun 27, 2026
9e4e864
🚨 Fixing Rabbit AI suggestions
emilkanic0909 Jun 27, 2026
aec7e61
🎨 pre-commit fixes
pre-commit-ci[bot] Jun 27, 2026
440f2d2
Formatted docstrings to google style
Jun 27, 2026
d69d0d5
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Jun 27, 2026
b503a5d
🚧 Fixing RabbitAI
emilkanic0909 Jun 27, 2026
9b89ba4
Merge branch 'feature/ErrorCorrection_MergePrep' of https://github.co…
emilkanic0909 Jun 27, 2026
b86a385
Converted docstrigns to google-style
Jun 27, 2026
bc1738d
🎨 pre-commit fixes
pre-commit-ci[bot] Jun 27, 2026
22421a2
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Jun 27, 2026
5a4b525
Removed Equvialence checking and respective dependencies
Jul 1, 2026
9b2b365
Removed gate_counts.json
Jul 1, 2026
6083250
Moved gatecounts into dedicated constants
Jul 1, 2026
ef3c9ac
Modified Shor_transpiler to global clifford+t reduction before transp…
SalehAlsherif Jul 3, 2026
0ea3d08
applied opeque magic state injection
SalehAlsherif Jul 3, 2026
fc209f3
delete old comments
emilkanic0909 Jul 4, 2026
266ac64
Moved structural tests to test_bench.py
Jul 6, 2026
ff3f129
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Jul 6, 2026
d90c6c0
Removed unnecessary qiskit-aer dependency
Jul 6, 2026
9232b8a
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Jul 6, 2026
c7fae61
🔥 Remove Barriers, Measures, Decoding, Fix transpilation
emilkanic0909 Jul 18, 2026
f4ddd3a
🎨 pre-commit fixes
pre-commit-ci[bot] Jul 18, 2026
7496aab
readded tests for transpiler WIP
Jul 18, 2026
974aab6
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Jul 18, 2026
125bb2e
added simple test to check if everything still works
Jul 18, 2026
dd53d05
added docstrings to transpilation tests
Jul 18, 2026
62c50ab
Added support for Id, Y, DCX, SWAP gates.
Jul 18, 2026
4fdfb7c
Removed now unused Gates H, S, CZ
Jul 18, 2026
65a99dc
✨ Adding New Gates and Reuse code
emilkanic0909 Jul 18, 2026
0b5d752
modified tests to check all algorithms for transpilation
Jul 18, 2026
d56f79b
Expanded target transpilation target basis and re-added H gate support
Jul 18, 2026
a6d4560
Moved transpilation step into transpile() for consistency between imp…
Jul 18, 2026
853bb54
fixed accessing the transpiled qc
Jul 18, 2026
c8e5a70
fixed addressing the transpiled qc in test_error_correction_transpile…
Jul 18, 2026
b766e03
Updated expected gate counts for test_error_correction_transpiler_cir…
Jul 18, 2026
1ac0972
added generating functionality for gate counts and updated to newest …
Jul 18, 2026
04e864d
removed dedicated qec testing again
Jul 18, 2026
aa7030f
Improved syndrome extraction documentation
Jul 18, 2026
d397ae5
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Jul 18, 2026
dd69ae2
updated uv venv
Jul 18, 2026
1647130
draft ec_transpiler
Aug 8, 2026
73190c5
updated ec_transpiler to automatically handle derived gates
Aug 13, 2026
e8b8352
amended shor & steane transpilers to utilize automatic derived gate a…
Aug 13, 2026
aaf4c08
Amended ec gate counts to fit with new constraints
Aug 13, 2026
810be22
Added Exception on usage of decoded qubits
Aug 13, 2026
7ddfaa0
Added raising errors on encountering control-flow or conditioned oper…
Aug 13, 2026
a735a55
removed unnecessary parameter from replace_gates
Aug 13, 2026
b851edf
Clarified unsupported control-flow operations in docstring
Aug 13, 2026
f6f7058
Fixed cy derivation
Aug 13, 2026
544d025
Removed our EC changes from .gitignore
Aug 13, 2026
87e48a8
Updated optimization_level to 0 in transpile()
Aug 13, 2026
71102ac
Removed unnecessary t-gate count
Aug 13, 2026
edcff21
Fixed typo
Aug 13, 2026
413c067
Updated gate counts to reflect new optimization level
Aug 13, 2026
ee3f235
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Aug 13, 2026
07df7b4
📝 Update Changelog
emilkanic0909 Aug 15, 2026
7c38d9f
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 15, 2026
b3c250e
📝Adapt Changelog📝
emilkanic0909 Aug 15, 2026
ca29806
Merge branch 'feature/ErrorCorrection_MergePrep' of https://github.co…
emilkanic0909 Aug 15, 2026
ff98090
🔥 Remove old TODOs
emilkanic0909 Aug 15, 2026
9fe9ec8
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 15, 2026
6620137
🎨 Rename MagicState
emilkanic0909 Aug 15, 2026
cc566c3
Merge branch 'feature/ErrorCorrection_MergePrep' of https://github.co…
emilkanic0909 Aug 15, 2026
165b0a8
Merge branch 'main' into feature/ErrorCorrection_MergePrep
emilkanic0909 Aug 22, 2026
9d1078a
🐛 Fix docstring and Opaque gadget name in dicts
emilkanic0909 Aug 22, 2026
b679c67
🚑️ Disabling counts for qft, only existence
emilkanic0909 Aug 22, 2026
6dccbb4
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 22, 2026
d986774
Merge branch 'main' into feature/ErrorCorrection_MergePrep
emilkanic0909 Aug 22, 2026
25e5bad
Removed ec_transpiler add_syndrome functionality
Aug 29, 2026
821b84d
✨ Add New Tests for Y Z gates and delete Derived
emilkanic0909 Aug 29, 2026
6b31b1f
Merge branch 'feature/ErrorCorrection_MergePrep' of https://github.co…
emilkanic0909 Aug 29, 2026
549b58e
Merge branch 'main' into feature/ErrorCorrection_MergePrep
emilkanic0909 Aug 29, 2026
ab0ac4d
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 29, 2026
feb9a15
🚑️ Fix Sys Usage according to Daniels Haag PR
emilkanic0909 Aug 29, 2026
5eba858
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 29, 2026
c42826d
🚑️ Fix formatting in md
emilkanic0909 Aug 29, 2026
8bfba49
Merge branch 'feature/ErrorCorrection_MergePrep' of https://github.co…
emilkanic0909 Aug 29, 2026
9c8d6fa
Various small fixes to move to 100% coverage
Aug 29, 2026
6b25061
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Aug 29, 2026
a99e32f
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Sep 1, 2026
1dbff36
Fixed python version for lint to newest supported version
Sep 1, 2026
b1d0035
Fixed overloading issues with get_benchmark_alg()
Sep 1, 2026
2aa070f
Added tests for get_benchmark_alg() encoding parameters
Sep 1, 2026
2c168a2
Removed unused derived gates functionality
Sep 1, 2026
ab2f520
decrease circuit size in test_get_benchmark_alg_encoding_parameters()…
Sep 1, 2026
90b1161
Pedantic changes to test_error_correction_transpiler_circuit_structure()
Sep 1, 2026
04d4790
Removed unused physical_data_registers
Sep 1, 2026
203b33f
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Sep 5, 2026
58ad237
Documented qiskit version change
Sep 7, 2026
ee70ede
removed ket from tool.typos
Sep 7, 2026
3c62b85
reverted fixed python version for lint
Sep 7, 2026
b05e7f4
Added warning for use of encoding in unsupported benchmark gen levels
Sep 7, 2026
763a7f4
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Sep 7, 2026
221e205
Updated witch reduced set of gates
Sep 7, 2026
45f566a
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Sep 7, 2026
590229a
removed deprecated 'add_syndrome' distinctions from docstrings
Sep 7, 2026
d2c5d87
Fixed typo
Sep 7, 2026
b47dc12
Added __init__.py files for error_correction and components
Sep 7, 2026
e917cf3
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Sep 7, 2026
2b0db75
Merge branch 'main' into feature/ErrorCorrection_MergePrep
emilkanic0909 Sep 12, 2026
80d3d8b
Revert "Merge branch 'main' into feature/ErrorCorrection_MergePrep"
emilkanic0909 Sep 12, 2026
c18ce33
Added documentation
Sep 12, 2026
861b236
Dynamic discovery of EC transpilers
Sep 12, 2026
4722055
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Sep 12, 2026
1099514
Removed automatic transpiler discovery
Sep 12, 2026
124c04d
Manual update of templating version
Sep 12, 2026
506b619
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Sep 13, 2026
7667781
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Sep 15, 2026
64a062a
Merge branch 'main' into feature/ErrorCorrection_MergePrep
emilkanic0909 Sep 25, 2026
3763be8
Remove dublicates
emilkanic0909 Sep 25, 2026
4a42ef8
remove dublicates
emilkanic0909 Sep 25, 2026
24a5525
🎨 pre-commit fixes
pre-commit-ci[bot] Sep 25, 2026
37bf90a
Reverting CI/CD to v 2.4.2
Sep 25, 2026
df3e4d8
restored docs python version
Sep 25, 2026
92c9183
restored mirrors-typos to 1.50.1
Sep 30, 2026
488f1b9
Reverted all unrelated changes
Sep 30, 2026
89dd503
More restoring
Sep 30, 2026
89e7cbb
updated uv lock
Sep 30, 2026
9d99584
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 15, 2026
6cc2164
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 15, 2026
152a974
Merge branch 'munich-quantum-toolkit:main' into feature/ErrorCorrecti…
emilkanic0909 Oct 18, 2026
525acae
Reset Upgrading to main
emilkanic0909 Oct 18, 2026
837182b
✅ Fix double use of transpile issue
emilkanic0909 Oct 18, 2026
6e5daed
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 18, 2026
d93b9d0
🎨 Update Structural tests because of opaque T instructions
emilkanic0909 Oct 18, 2026
12b808a
Merge remote-tracking branch 'origin/feature/ErrorCorrection_MergePre…
emilkanic0909 Oct 18, 2026
7dc7fd4
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 18, 2026
6a6f587
🐛 Fix Changelog
emilkanic0909 Oct 18, 2026
9da72ae
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 18, 2026
63de2be
🐛 Fixing for pre-commit
emilkanic0909 Oct 18, 2026
f57c07d
Merge remote-tracking branch 'origin/feature/ErrorCorrection_MergePre…
emilkanic0909 Oct 18, 2026
6bb34dd
📌 Pin uv versions
emilkanic0909 Oct 18, 2026
527fa9e
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 18, 2026
fb12afd
Merge branch 'munich-quantum-toolkit:main' into feature/ErrorCorrecti…
emilkanic0909 Oct 18, 2026
452535c
⬆️Update Pytoml
emilkanic0909 Oct 18, 2026
14e9bfe
Merge remote-tracking branch 'origin/feature/ErrorCorrection_MergePre…
emilkanic0909 Oct 18, 2026
70ebe6e
♻️ Fix wrong configuration
emilkanic0909 Oct 20, 2026
3700a7f
♻️ Fix git merge issues for docs/contributing.md
emilkanic0909 Oct 20, 2026
ff8336a
♻️ Fixing parameter.md because of wrong executable text blocks
emilkanic0909 Oct 20, 2026
0b12f9e
♻️ Fix mergeing issues in ChangeLog
emilkanic0909 Oct 20, 2026
d635978
♻️ Fix qiskit version
emilkanic0909 Oct 20, 2026
fd8a8ee
♻️ Add new tag for 2.3.0
emilkanic0909 Oct 20, 2026
455e11d
Merge branch 'main_main_origin' into feature/ErrorCorrection_MergePrep
emilkanic0909 Oct 20, 2026
02eb19c
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 20, 2026
e12c2bb
💚 Add forgotten uv.lock
emilkanic0909 Oct 20, 2026
f1fa163
Merge remote-tracking branch 'origin/feature/ErrorCorrection_MergePre…
emilkanic0909 Oct 20, 2026
355e145
🎨 Add check for unsupported operations
emilkanic0909 Oct 20, 2026
e3a44a8
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 20, 2026
7490158
🐛 Remove dublication in Changelog
emilkanic0909 Oct 20, 2026
c6e296f
🐛 Fix qubit - bit mappings
emilkanic0909 Oct 20, 2026
81ede45
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 20, 2026
6bedeba
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 21, 2026
66dd034
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 21, 2026
996a0ae
fixed typo
Oct 21, 2026
ae964dd
restored structured loop addition
Oct 21, 2026
c790a8e
allowed barriers after decoded qubits
Oct 21, 2026
b794511
updated docstring for test_error_correction_transpiler_circuit_struct…
Oct 21, 2026
c8e1ed4
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Oct 21, 2026
9019dc3
fixed mirror circuit excluding encodings
Oct 21, 2026
b8b540d
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 21, 2026
a5caf42
added small regression test ensuring correct mirroring & encoding
Oct 21, 2026
c4aa6d5
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Oct 21, 2026
7270f73
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 24, 2026
7c60b97
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 24, 2026
1911d62
Cleanup of merge induced errors
Oct 24, 2026
44e15c7
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 25, 2026
3093a84
🤖 *AI text below* 🤖
Oct 25, 2026
1675daf
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 25, 2026
f79ebb9
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 25, 2026
9393b77
Added small note on version differences to test_error_correction_tran…
Oct 25, 2026
471eb64
Merge branch 'feature/ErrorCorrection_MergePrep' of github.com:emilka…
Oct 25, 2026
f1236a2
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 25, 2026
aa67883
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 25, 2026
28db1cd
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 25, 2026
2eca0ca
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 25, 2026
1310dbc
Merge branch 'main' into feature/ErrorCorrection_MergePrep
Felix-Gundlach Oct 26, 2026
2bed1ce
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 26, 2026
9a80203
Added record generation to ECTranspiler
Oct 26, 2026
73feb3e
Fixed 1-qubit BV request
Oct 26, 2026
bbb143e
removed qpy metadata test
Oct 26, 2026
0c791a8
Defined PR [#930]
Oct 26, 2026
13f61aa
removed stale qiskit upgrade comments
Oct 26, 2026
87b873e
removed Qiskit 2.4 minimum specification
Oct 26, 2026
453fa22
Preliminary update to `encoding`
Oct 26, 2026
46394a0
Updated SteaneTranspiler docstring
Oct 26, 2026
b45a761
Consolidated tests
Oct 26, 2026
c6928a8
Turned `encoding` into a positional argument
Oct 26, 2026
c138392
Simplified, unified, and reduced bloated documentation
Oct 26, 2026
fcd8a03
proted changes from #1088 to the moved shor helpers and applied the s…
Oct 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ that minor releases may include breaking changes.
- ✨ Add quantum teleportation benchmark ([#1045]) ([**@AsharHusain**])
- ✨ Add ML-QAE benchmark ([#1044]) ([**@algovista-collab**])
- ✨ Add Superdense Coding benchmark ([#1037]) ([**@Anshu666666**])
- ✨ Add `encoding` option for Steane's and Shor's codes ([#930])
([**@Felix-Gundlach**], [**@emilkanic0909**], [**@SalehAlsherif**])

### Changed

Expand Down Expand Up @@ -336,6 +338,7 @@ _📚 Refer to the [GitHub Release Notes] for previous changelogs._
[#997]: https://github.com/munich-quantum-toolkit/bench/pull/997
[#952]: https://github.com/munich-quantum-toolkit/bench/pull/952
[#946]: https://github.com/munich-quantum-toolkit/bench/pull/946
[#930]: https://github.com/munich-quantum-toolkit/bench/pull/930
[#925]: https://github.com/munich-quantum-toolkit/bench/pull/925
[#914]: https://github.com/munich-quantum-toolkit/bench/pull/914
[#895]: https://github.com/munich-quantum-toolkit/bench/pull/895
Expand Down Expand Up @@ -392,6 +395,9 @@ _📚 Refer to the [GitHub Release Notes] for previous changelogs._
[**@TomasVF**]: https://github.com/TomasVF
[**@flowerthrower**]: https://github.com/flowerthrower
[**@johanneswittmann9**]: https://github.com/johanneswittmann9
[**@Felix-Gundlach**]: https://github.com/Felix-Gundlach
[**@emilkanic0909**]: https://github.com/emilkanic0909
[**@SalehAlsherif**]: https://github.com/SalehAlsherif
[**@cnYui**]: https://github.com/cnYui
[**@algovista-collab**]: https://github.com/algovista-collab
[**@Anshu666666**]: https://github.com/Anshu666666
Expand Down
15 changes: 15 additions & 0 deletions docs/parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ print(get_available_device_names())
the mirror. Circuits that Qiskit cannot invert, for example those with
mid-circuit measurements, resets, or unsupported control flow, raise
`ValueError`. Use `False` to generate these circuits without a mirror.
- `encoding`: Error-correcting code applied to the circuit. Only the ALG level
supports it; other levels ignore it with a warning. Gates without a
transversal realization become placeholders: opaque logical gadgets named
`<code>_ideal_logical_<gate>`, for example `steane_ideal_logical_t`. OpenQASM
3 export does not support placeholders, so save encoded circuits as QPY.
Rotations are approximated, so gate counts can differ between Qiskit versions.

Possible values for `encoding`:

```{code-cell} ipython3
:tags: [hide-input]
from mqt.bench.error_correction import get_available_encoding_names

print(get_available_encoding_names())
```

## Native Gate-Set Support

Expand Down
37 changes: 35 additions & 2 deletions src/mqt/bench/benchmark_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from __future__ import annotations

import json
import warnings
from copy import deepcopy
from enum import Enum, auto
from typing import TYPE_CHECKING, Unpack, assert_never, overload
Expand All @@ -26,6 +27,7 @@
from qiskit.version import VERSION as QISKIT_VERSION

from .benchmarks import create_circuit
from .error_correction import get_available_encoding_names, get_transpiler
from .targets.gatesets import get_target_for_gateset
from .targets.gatesets._compilation import prepare_target
from .targets.gatesets.ibm import configure_fractional_angles
Expand Down Expand Up @@ -116,13 +118,15 @@ def _record_generation(
target: Target | None = None,
opt_level: int | None = None,
mirror: bool = False,
encoding: str = "",
) -> None:
"""Attach the compilation settings to the circuit's generation record."""
generation.update({
"level": level.name.lower(),
"opt_level": opt_level,
"target": target.description if target is not None else None,
"mirror": mirror or generation.get("mirror", False),
"encoding": encoding or generation.get("encoding"),
})
qc.metadata = (qc.metadata or {}) | {"mqt_bench_generation": generation}

Expand Down Expand Up @@ -233,6 +237,7 @@ def get_benchmark_alg(
benchmark: str,
circuit_size: int,
*,
encoding: str = "",
generate_mirror_circuit: bool = False,
random_parameters: bool = True,
**kwargs: Unpack[ConfigurationOptions],
Expand All @@ -244,6 +249,7 @@ def get_benchmark_alg(
benchmark: QuantumCircuit,
circuit_size: None = None,
*,
encoding: str = "",
generate_mirror_circuit: bool = False,
random_parameters: bool = True,
**kwargs: Unpack[ConfigurationOptions],
Expand All @@ -255,6 +261,7 @@ def get_benchmark_alg(
benchmark: str | QuantumCircuit,
circuit_size: int | None = None,
*,
encoding: str = "",
generate_mirror_circuit: bool = False,
random_parameters: bool = True,
**kwargs: Unpack[ConfigurationOptions],
Expand All @@ -265,6 +272,7 @@ def get_benchmark_alg(
benchmark: str | QuantumCircuit,
circuit_size: int | None = None,
*,
encoding: str = "",
generate_mirror_circuit: bool = False,
random_parameters: bool = True,
**kwargs: Unpack[ConfigurationOptions],
Expand All @@ -274,19 +282,30 @@ def get_benchmark_alg(
Arguments:
benchmark: QuantumCircuit or name of the benchmark to be generated
circuit_size: Input for the benchmark creation, in most cases this is equal to the qubit number
encoding: Name of an error-correcting code from `get_available_encoding_names()`, or "" for none.
generate_mirror_circuit: If True, generates the mirror version (U @ U.inverse()) of the benchmark.
random_parameters: If True, assigns random parameters to the circuit's parameters if they exist.
kwargs: Additional keyword arguments passed to the circuit creation.

Returns:
Qiskit::QuantumCircuit representing the raw benchmark circuit without any hardware-specific compilation or mapping.
"""
valid_encodings = {"", *get_available_encoding_names()}
if encoding not in valid_encodings:
msg = f"Invalid `encoding` '{encoding}'. Must be one of {valid_encodings}."
raise ValueError(msg)

qc, generation = _get_circuit(benchmark, circuit_size, random_parameters, **kwargs)
if qc is benchmark:
qc = qc.copy()
_record_generation(qc, BenchmarkLevel.ALG, generation, mirror=generate_mirror_circuit)
_record_generation(qc, BenchmarkLevel.ALG, generation, mirror=generate_mirror_circuit, encoding=encoding)
if generate_mirror_circuit:
return _create_mirror_circuit(qc, inplace=True)
qc = _create_mirror_circuit(qc, inplace=True)

if encoding:
# The encoded circuit keeps the metadata, including the generation record.
qc = get_transpiler(encoding)(qc).transpile()

return qc


Expand Down Expand Up @@ -574,6 +593,7 @@ def get_benchmark(
target: Target | None = None,
opt_level: int = 2,
*,
encoding: str = "",
generate_mirror_circuit: bool = False,
random_parameters: bool = True,
**kwargs: Unpack[ConfigurationOptions],
Expand All @@ -588,6 +608,7 @@ def get_benchmark(
target: Target | None = None,
opt_level: int = 2,
*,
encoding: str = "",
generate_mirror_circuit: bool = False,
random_parameters: bool = True,
**kwargs: Unpack[ConfigurationOptions],
Expand All @@ -602,6 +623,7 @@ def get_benchmark(
target: Target | None = None,
opt_level: int = 2,
*,
encoding: str = "",
generate_mirror_circuit: bool = False,
random_parameters: bool = True,
**kwargs: Unpack[ConfigurationOptions],
Expand All @@ -615,6 +637,7 @@ def get_benchmark(
target: Target | None = None,
opt_level: int = 2,
*,
encoding: str = "",
generate_mirror_circuit: bool = False,
random_parameters: bool = True,
**kwargs: Unpack[ConfigurationOptions],
Expand All @@ -628,19 +651,29 @@ def get_benchmark(
target: `~qiskit.transpiler.target.Target` for the benchmark generation
(only used for "nativegates" and "mapped" level)
opt_level: Optimization level to be used by the transpiler.
encoding: Name of an error-correcting code from `get_available_encoding_names()`, or "" for none.
Only supported for `BenchmarkLevel.ALG`; ignored (with a warning) for other levels.
generate_mirror_circuit: If True, generates the mirror version (U @ U.inverse()) of the benchmark.
random_parameters: If True, assigns random parameters to the circuit's parameters if they exist.
kwargs: Additional keyword arguments passed to the circuit creation.

Returns:
Qiskit::QuantumCircuit object representing the benchmark with the selected options
"""
if level is not BenchmarkLevel.ALG and encoding:
warnings.warn(
f"`encoding` is only supported for BenchmarkLevel.ALG and will be ignored for level={level.name}.",
UserWarning,
stacklevel=2,
)

if level is BenchmarkLevel.ALG:
return get_benchmark_alg(
benchmark=benchmark,
circuit_size=circuit_size,
generate_mirror_circuit=generate_mirror_circuit,
random_parameters=random_parameters,
encoding=encoding,
**kwargs,
)

Expand Down
135 changes: 11 additions & 124 deletions src/mqt/bench/benchmarks/seven_qubit_steane_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,127 +13,14 @@
from qiskit import ClassicalRegister
from qiskit.circuit import AncillaRegister, QuantumCircuit, QuantumRegister

from ._registry import register_benchmark


def _get_seven_qubit_steane_code_encoding_circuit() -> QuantumCircuit:
"""Create the 7-qubit Steane code encoding circuit.

Encodes qubit 0 into the 7-qubit Steane code logical state:
- |0> -> (|0000000> + |1010101> + |0110011> + |1100110> + |0001111> + |1011010> + |0111100> + |1101001>)
- |1> -> (|1111111> + |0101010> + |1001100> + |0011001> + |1110000> + |0100101> + |1000011> + |0010110>).

Returns:
QuantumCircuit: 7-qubit encoding circuit.
"""
out = QuantumCircuit(7)
# H
out.h(4)
out.h(5)
out.h(6)
# CNOT from 0
out.cx(0, 1)
out.cx(0, 2)
# CNOT from 6
out.cx(6, 3)
out.cx(6, 1)
out.cx(6, 0)
# CNOT from 5
out.cx(5, 3)
out.cx(5, 2)
out.cx(5, 0)
# CNOT from 4
out.cx(4, 3)
out.cx(4, 2)
out.cx(4, 1)
return out


def _get_seven_qubit_steane_code_decoding_circuit() -> QuantumCircuit:
"""Create the 7-qubit Steane code decoding circuit.

Reverses the encoding operation to extract the logical qubit back to qubit 0.

Returns:
QuantumCircuit: 7-qubit decoding circuit (qubit 0 is the output qubit).
"""
return _get_seven_qubit_steane_code_encoding_circuit().inverse()

from mqt.bench.components.steane_circuit_components import (
apply_seven_qubit_steane_code_correction,
get_seven_qubit_steane_code_decoding_circuit,
get_seven_qubit_steane_code_encoding_circuit,
get_seven_qubit_steane_code_syndrome_extraction_circuit,
)

def _get_seven_qubit_steane_code_syndrome_extraction_circuit() -> QuantumCircuit:
"""Create the syndrome extraction circuit for the 7-qubit Steane code.

Extracts bit-flip and phase-flip syndromes using 6 ancilla qubits (3 for each type).

Bit-flip syndrome extraction:
Syndrome bits measure the parity of specific qubit subsets corresponding to
the X-stabilizer generators.

Phase-flip syndrome extraction:
Uses Hadamard gates to convert from Z to X basis, and control/target swapped
CNOTs to extract the phase-flip syndrome

Syndrome mapping: The 3-bit syndrome value (1-7) directly identifies which
data qubit experienced an error. Syndrome 0 indicates no error.

Returns:
QuantumCircuit: 13-qubit circuit (qubits 0-6 are data, 7-9 are bit-flip
syndrome ancillas, 10-12 are phase-flip syndrome ancillas).
"""
logical_qubit, bit_flip_syndrome, phase_flip_syndrome = QuantumRegister(7), AncillaRegister(3), AncillaRegister(3)
out = QuantumCircuit(logical_qubit, bit_flip_syndrome, phase_flip_syndrome)
# Bit-flip
for ctrl in (0, 2, 4, 6):
out.cx(logical_qubit[ctrl], bit_flip_syndrome[0])
for ctrl in (1, 2, 5, 6):
out.cx(logical_qubit[ctrl], bit_flip_syndrome[1])
for ctrl in (3, 4, 5, 6):
out.cx(logical_qubit[ctrl], bit_flip_syndrome[2])
# Phase-flip
for i in range(3):
out.h(phase_flip_syndrome[i])
for targ in (0, 2, 4, 6):
out.cx(phase_flip_syndrome[0], logical_qubit[targ])
for targ in (1, 2, 5, 6):
out.cx(phase_flip_syndrome[1], logical_qubit[targ])
for targ in (3, 4, 5, 6):
out.cx(phase_flip_syndrome[2], logical_qubit[targ])
for i in range(3):
out.h(phase_flip_syndrome[i])
return out


def _apply_seven_qubit_steane_code_correction(
qc: QuantumCircuit,
logical_qubit: QuantumRegister,
bit_flip_syndrome: AncillaRegister,
phase_flip_syndrome: AncillaRegister,
bit_flip_syndrome_measurement: ClassicalRegister,
phase_flip_syndrome_measurement: ClassicalRegister,
) -> None:
"""Apply error correction based on syndrome measurements.

Measures the 6 syndrome qubits and conditionally applies X/Z gates to correct
single-qubit errors on any of the 7 data qubits.

Arguments:
qc: The quantum circuit to modify.
logical_qubit: Register containing the 7 data qubits.
bit_flip_syndrome: Register containing the 3 bit-flip syndrome qubits.
phase_flip_syndrome: Register containing the 3 phase-flip syndrome qubits.
bit_flip_syndrome_measurement: Classical register for bit-flip syndrome results.
phase_flip_syndrome_measurement: Classical register for phase-flip syndrome results.
"""
qc.measure(bit_flip_syndrome, bit_flip_syndrome_measurement)
qc.measure(phase_flip_syndrome, phase_flip_syndrome_measurement)
# Bit-flip correction: syndrome value directly indicates which qubit to correct
for i in range(7):
with qc.if_test((bit_flip_syndrome_measurement, i + 1)):
qc.x(logical_qubit[i])
# Phase-flip correction: syndrome value directly indicates which qubit to correct
for i in range(7):
with qc.if_test((phase_flip_syndrome_measurement, i + 1)):
qc.z(logical_qubit[i])
from ._registry import register_benchmark


def _create_single_logical_qubit_circuit(index: int) -> QuantumCircuit:
Expand Down Expand Up @@ -164,20 +51,20 @@ def _create_single_logical_qubit_circuit(index: int) -> QuantumCircuit:
)
# == Encoding ==
qc.compose(
_get_seven_qubit_steane_code_encoding_circuit(),
get_seven_qubit_steane_code_encoding_circuit(),
qubits=logical_qubit[:],
inplace=True,
)
qc.barrier()
# == Syndrome extraction ==
qc.compose(
_get_seven_qubit_steane_code_syndrome_extraction_circuit(),
get_seven_qubit_steane_code_syndrome_extraction_circuit(),
qubits=logical_qubit[:] + bit_flip_syndrome[:] + phase_flip_syndrome[:],
inplace=True,
)
qc.barrier()
# == Error correction ==
_apply_seven_qubit_steane_code_correction(
apply_seven_qubit_steane_code_correction(
qc,
logical_qubit,
bit_flip_syndrome,
Expand All @@ -188,7 +75,7 @@ def _create_single_logical_qubit_circuit(index: int) -> QuantumCircuit:
qc.barrier()
# == Decoding ==
qc.compose(
_get_seven_qubit_steane_code_decoding_circuit(),
get_seven_qubit_steane_code_decoding_circuit(),
qubits=logical_qubit[:],
inplace=True,
)
Expand Down
Loading
Loading