✨ Add error correction module with Shor and Steane logical circuit transpilers - #930
Conversation
small formatting changes
…de' into feature/ErrorCorrection_Verification
+ Added logging functionality
…nic0909/MQT_Bench_ErrorCorrectionCodes into feature/ErrorCorrection_MergePrep
|
@flowerthrower Hi Patrick, info to our status. We have added some new tests for edge cases and Y Z gates. Also we have deleted derived gates and possibility to disable syndromes. Now we are getting 96,4% of coverage. We are still working on getting more. |
|
I ran into an issue with my local installation when using nox to lint. Nox stubbornly continued to use python 3.10 as interpreter (faulty install from my part, most likely). To fix this, I pinned the python version of the lint sessions to the newest supported version (see noxfile.py:51). |
… for tiny performance increase
flowerthrower
left a comment
There was a problem hiding this comment.
Hi everyone, I really like how this is comming together. I left a few (this time really) minor requests. After adressing them and updating the PR description (can be done by LLM with disclaimer), feel free to request the final review from our chief-maintainer @burgholzer.
…nic0909/MQT_Bench_ErrorCorrectionCodes into feature/ErrorCorrection_MergePrep
Signed-off-by: Felix Gundlach <67263641+Felix-Gundlach@users.noreply.github.com>
…nic0909/MQT_Bench_ErrorCorrectionCodes into feature/ErrorCorrection_MergePrep
|
@flowerthrower two last questions:
|
|
@burgholzer could you take a look at our changes when you get a chance? |
Will do. May take me a bit to get to this though 😌 |
No worries, this isn't time sensitive for us either 😊 |
Description
Adds an error correction module that encodes benchmark circuits into logical circuits using the 7-qubit Steane code or the 9-qubit Shor code. Encoding is exposed via a new
encodingparameter onget_benchmark()andget_benchmark_alg(), accepting"","steane", or"shor":error_correction/ec_transpiler.pyholds the code-agnosticECTranspilerbase class. It decomposes the circuit into the code's basis, replaces every logical qubit with a data register plus syndrome ancillas, substitutes each gate by its logical equivalent, and appends a syndrome extraction and correction cycle after every logical operation.SteaneTranspilerandShorTranspileronly declare their code parameters and supply the encoding, decoding, and syndrome circuits.Since MQT Bench targets circuit structure rather than exact behaviour, gates without a fault-tolerant transversal realization (
t/tdgfor both codes, plushfor Shor) are emitted as opaque placeholder instructions named{code}_ideal_logical_{gate}rather than as full magic-state constructions.The encoding, decoding, syndrome, and correction circuits shared with the existing
seven_qubit_steane_codeandshors_nine_qubit_codebenchmarks moved into a newcomponentsmodule.Dependencies: requires Qiskit >= 2.4.0 (up from 2.0.0) for the transpilation to the Clifford+T basis. Noted in the changelog and the upgrade guide.
Limitations: encoding is only applied at
BenchmarkLevel.ALG(aUserWarningis raised otherwise), control-flow operations are rejected with aValueError, and basis decomposition usesapproximation_degree=0.95, so encoded circuits are approximations.AI assistance: this description was drafted by an LLM from the current diff and reviewed by us. Various docstrings were generated by an LLM and reviewed & edited by us.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).