Skip to content

✨ Implement Steane 7 Qubit Code#814

Merged
burgholzer merged 7 commits intomunich-quantum-toolkit:mainfrom
adnathanail:steane-7-qubit-code
Feb 4, 2026
Merged

✨ Implement Steane 7 Qubit Code#814
burgholzer merged 7 commits intomunich-quantum-toolkit:mainfrom
adnathanail:steane-7-qubit-code

Conversation

@adnathanail
Copy link
Copy Markdown
Contributor

@adnathanail adnathanail commented Jan 28, 2026

Description

Add 7-qubit Steane code as a benchmark

Fixes #813

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@adnathanail
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 28, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 28, 2026

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added 7 Qubit Steane Code benchmark for quantum circuit benchmarking.
  • Tests

    • Added validation tests for the new benchmark across multiple scales.
  • Documentation

    • Updated changelog with new benchmark entry.

Walkthrough

Adds a new benchmark implementing the 7-qubit Steane code (encoding, syndrome extraction, correction, decoding), registers it, updates tests for circuit structure and invalid sizes, and documents the change in the changelog.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Add Unreleased → Added entry for "7 Qubit Steane Code benchmark" and PR #814 reference.
Benchmark Implementation
src/mqt/bench/benchmarks/seven_qubit_steane_code.py
New benchmark module providing create_circuit(num_qubits) that builds per-logical-qubit circuits (encoding, 13-qubit syndrome extraction with ancillas, conditional X/Z corrections, decoding), validates num_qubits % 13 == 0, composes multiple logical-qubit blocks, and registers the benchmark.
Tests
tests/test_bench.py
Update SPECIAL_QUBIT_COUNTS to include "seven_qubit_steane_code": 13; add test_seven_qubit_steane_code_circuit_structure and parametric tests for valid sizes (13, 26, 39, 52) and invalid-size error message expecting divisibility by 13.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

mqt.bench

Suggested reviewers

  • burgholzer

Poem

🐰 I hopped through circuits late at night,
Seven qubits dressed in error-correcting light,
Syndromes whispered, ancillas in line,
Xs and Zs danced to make the state fine,
Hooray — a benchmark, crisp and bright! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: implementing the 7-qubit Steane code as a quantum benchmark.
Description check ✅ Passed The PR description includes a summary, fixes reference (#813), and all checklist items are marked complete indicating thorough documentation and testing.
Linked Issues check ✅ Passed The implementation successfully addresses issue #813 by implementing the 7-qubit Steane code with encoding, decoding, syndrome extraction, error correction, and registration as a benchmark.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the 7-qubit Steane code benchmark: the new benchmark module, tests for the implementation, and changelog documentation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 20: The changelog entry contains a duplicate hyphen breaking the list
formatting; locate the line containing "- - ⬆️ Increase minimum Qiskit version
to 2.0.0 ([`#803`]) ([**@adnathanail**])" in CHANGELOG.md and remove the extra
leading hyphen so it becomes a single list item "- ⬆️ Increase minimum Qiskit
version to 2.0.0 ([`#803`]) ([**@adnathanail**])".
- Around line 14-15: Add a changelog line for the 7‑qubit Steane code benchmark
in CHANGELOG.md similar to the existing entries; insert a line like "✨ Add
7‑qubit Steane code benchmark ([`#814`]) ([**@adnathanail**])" alongside the
existing Shor's 9 Qubit Code entry so the PR `#814` and the Steane benchmark are
recorded.

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md Outdated
@adnathanail
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 28, 2026

✅ Actions performed

Full review triggered.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adnathanail
Copy link
Copy Markdown
Contributor Author

https://github.com/coderabbitai full review

@adnathanail adnathanail marked this pull request as ready for review January 28, 2026 15:01
@adnathanail
Copy link
Copy Markdown
Contributor Author

@burgholzer @flowerthrower

@adnathanail adnathanail changed the title ✨ Implement Steane 7 qubit code ✨ Implement Steane 7 Qubit Code Jan 28, 2026
@burgholzer burgholzer added python Pull requests that update Python code feature New feature or request labels Feb 3, 2026
Copy link
Copy Markdown
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks extremely clean as well. Pretty much the same comments as for your other PR also apply here.
I'd have a preference to first get the other PR merged and this one rebased after that.
This should be pretty much ready though! Very nice.

@adnathanail
Copy link
Copy Markdown
Contributor Author

@burgholzer should be ready to go now!

Copy link
Copy Markdown
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Very nice 🎉

@burgholzer burgholzer merged commit b5eaa38 into munich-quantum-toolkit:main Feb 4, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in MQT Applications Feb 4, 2026
@adnathanail adnathanail deleted the steane-7-qubit-code branch February 4, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ 7-qubit Steane Code

2 participants