Skip to content

Commit db20fed

Browse files
Organized readme ++ (#7)
* Noise more granular control from CLI + added measurement noise * Added plots that attempt to reproduce paper (not there yet) * Added project status+reproduction instructions + known differences * readme opening more concise. * Add LICENSE (MIT) and CITATION.cff for v0.1.0 release * Added ROADMAP.md
1 parent 79d6954 commit db20fed

20 files changed

Lines changed: 253 additions & 29 deletions

CITATION.cff

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
type: software
4+
title: "Stim Implementation of the [[16,4,4]] Tesseract Code"
5+
abstract: "A complete Stim-based simulation of the Tesseract quantum error correction code with gate-level encoding, error correction rounds, and manual decoding."
6+
authors:
7+
- family-names: "Yakar"
8+
given-names: "Iftach"
9+
orcid: "https://orcid.org/0009-0003-8795-3794"
10+
repository-code: "https://github.com/DeDuckProject/tesseract-code-stim"
11+
url: "https://github.com/DeDuckProject/tesseract-code-stim"
12+
doi: "10.5281/zenodo.17137851"
13+
license: MIT
14+
date-released: 2024-09-16
15+
version: "0.1.1"
16+
keywords:
17+
- "quantum error correction"
18+
- "tesseract code"
19+
- "stim"
20+
- "quantum computing"
21+
- "fault tolerance"
22+
references:
23+
- type: article
24+
title: "Demonstration of quantum computation and error correction with a tesseract code"
25+
authors:
26+
- family-names: "Reichardt"
27+
given-names: "Ben W."
28+
year: 2024
29+
url: "https://arxiv.org/abs/2409.04628"
30+
notes: "arXiv:2409.04628"
31+
- type: software
32+
title: "Stim: a fast stabilizer circuit simulator"
33+
authors:
34+
- family-names: "Gidney"
35+
given-names: "Craig"
36+
year: 2021
37+
url: "https://github.com/quantumlib/Stim"
38+
doi: "10.22331/q-2021-07-06-497"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Tesseract Code Stim Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,53 @@
1-
# Stim implementation of the [[16,4,4]] Tesseract Code
1+
# Stim Implementation of the [[16,4,4]] Tesseract Code
22

3-
This repository contains implementations and simulations of the Tesseract quantum error correction code [[1]](#references) using Stim [[3]](#references).
3+
[![DOI](https://zenodo.org/badge/1014457478.svg)](https://doi.org/10.5281/zenodo.17137850)
44

55
## Overview
6-
### Motivation
7-
The 16-qubit tesseract subsystem color code offers a useful comprosmise between protection against errors and overhead. It encodes 4 logical qubits with a code rate of 1/4. By reducing 2 logical qubit from the original [[16,6,4]] code, this code achieves single-shot error correction, with only 2 ancilla qubits. This makes this code practical for current trapped-ion platforms. Recent experiments on Quantinuum hardware[[1]](#references) demonstrated preparing high-fidelity encoded graph states of up to 12 logical qubits, as well as protecting encoded states through 5 rounds of error correction. This repository reproduces these results in simulation, providing modular Stim circuits, noise modelling, and verification tests to support further research on low-overhead fault tolerance.
6+
**What it is**: A complete Stim-based [[3]](#references) simulation of the Tesseract quantum error correction code [[1]](#references) with gate-level encoding, error correction rounds, and manual decoding.
7+
8+
**Why it matters**: The [[16,4,4]] Tesseract subsystem color code offers practical fault tolerance for NISQ devices; encoding 4 logical qubits with single-shot error correction using only 2 ancilla qubits. This makes it viable for current trapped-ion platforms and a stepping stone to larger codes.
9+
10+
**What's implemented**: Full error correction pipeline including two encoding modes, configurable noise, stabilizer measurement rounds, Pauli frame tracking, and acceptance/fidelity analysis.
11+
12+
**Validation status**: Error correction improves fidelity as expected, but quantitative reproduction of paper results is work-in-progress. Acceptance rates show correct trend but offset (~1.0 vs ~0.85 baseline); logical error rates have correct shape but ~10× scaling difference.
813

914
![Figure 1: Tesseract code structure (from [1])](docs/images/fig1_tesseract_code.png)
1015

11-
### Project status
12-
This codebase is an active work-in-progress.
13-
• All building blocks (encoding, noise, measurement, decoder) are implemented.
14-
• The end-to-end error-correction success rate is **not yet at the target level**.
15-
Community testing, bug-fixes, and feature PRs are highly appreciated!
16+
## Reproduce the Paper
17+
18+
To regenerate the main results with paper parameters:
19+
20+
```bash
21+
python tesseract_sim/plotting/plot_acceptance_rates.py \
22+
--shots 10000 \
23+
--apply_pauli_frame true \
24+
--encoding-mode 9a \
25+
--ec-rate-1q 2.9e-5 \
26+
--ec-rate-2q 1.15e-3 \
27+
--meas-error-rate 1.47e-3 \
28+
--rounds 0 1 2 3 4 5 6 7 8 9 10 15 20 25 30 35 40 45 50
29+
```
30+
31+
**Requirements**: Python 3.8+, Stim 1.11+. Install via `pip install -r requirements.txt`.
32+
33+
**Known differences from paper**:
34+
- Depolarizing noise model (vs. experimental noise)
35+
- Pauli frame correction applied post-measurement (vs. pre-measurement)
36+
- No memory decoherence during idle periods
37+
- Noiseless encoding to avoid preselection
38+
- Only two logical Z measurements (due to |++0000⟩ encoding split into [[8,3,2]] codes)
1639

17-
**Disclaimer:** This repository is an independent, community-driven implementation.
18-
It is **not** affiliated with Microsoft, Quantinuum, nor the authors of the original tesseract-code paper.
40+
**Disclaimer**: Independent implementation, not affiliated with Microsoft/Quantinuum/original authors.
1941

2042
### Features
2143

22-
- Circuit implementation of the [[16,4,4]] Tesseract subsystem color code [[2]](#references) in Stim, including encoding, error correction rounds and final measurements.
44+
- Circuit implementation of the [[16,4,4]] Tesseract subsystem color code [[1]](#references) in Stim, including encoding, error correction rounds and final measurements.
2345
- Simulation of an error correction experiment with configurable noise setting, rounds, shot and more.
2446
- Plotting: sweeping of different parameters and obtaining acceptance rate and logical success rate.
2547

2648
### Implementation details
2749

28-
In order to mimic the original paper's error correction, the different parts of the experiment are implemented in the gate level, and not using Stim's `MPP` stabilizer measurements, or detectors, for example.
50+
In order to mimic the original paper's error correction, the different parts of the experiment are implemented at the gate level.
2951
The experiment implemented here is an error correction experiment based on Microsoft's paper[[1]](#references), and resembles the experimental setup shown in Figure 8 below.
3052

3153
![Figure 8: Error correction experiment (from [1])](docs/images/fig8_error_correction_experiment.png)

ROADMAP.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Roadmap
2+
3+
This document outlines the next major features and improvements planned for the Tesseract Code Stim implementation.
4+
5+
## Upcoming Features
6+
7+
### 1. Pre-measurement Pauli Frame Correction
8+
**GitHub Issue**: [#6](https://github.com/DeDuckProject/tesseract-code-stim/issues/6)
9+
10+
Currently, Pauli frame corrections are applied after measurement, which differs from the original paper's approach. This feature will:
11+
- Modify the circuit flow to apply Pauli frame corrections before logical measurements
12+
- Align the implementation more closely with the experimental procedure described in the paper
13+
- Potentially improve quantitative reproduction of paper results
14+
15+
### 2. Logical vs Unencoded Qubit Benchmarking
16+
17+
Implement comprehensive benchmarking to compare the performance of encoded logical qubits against unencoded physical qubits under realistic conditions:
18+
- Add memory decoherence modeling for idle qubits (currently missing)
19+
- Implement realistic T1/T2 coherence times based on trapped-ion parameters
20+
- Generate comparative plots showing logical vs physical qubit fidelity over time
21+
22+
### 3. Alternative Noise Models
23+
24+
Extend the `noise_cfg.py` API to support custom and alternative noise models beyond depolarizing noise:
25+
- Implement amplitude damping and phase damping channels
26+
- Add support for correlated noise models
27+
- Enable user-defined custom noise channels via configuration
28+
- Add noise model parameter sweeps for comparative analysis
29+
- Support for experimental noise characterization data import
30+
31+
## Contributing
32+
33+
We welcome contributions to any of these roadmap items! Please:
34+
1. Check existing GitHub issues for related discussions
35+
2. Open a new issue to discuss your proposed implementation approach
36+
3. Submit pull requests with tests and documentation
37+
38+
For questions or suggestions about the roadmap, please open an issue with the `roadmap` label.
42 KB
Loading
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Tesseract EC Experiment Metadata
2+
===================================
3+
4+
Timestamp: 2025-09-16 22:48:05
5+
Total runtime: 00:00:27.687 (27.687 seconds)
6+
7+
Experiment Parameters:
8+
--------------------
9+
Rounds: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 35, 40, 45, 50]
10+
Noise levels: [0.00115]
11+
Shots per data point: 10000
12+
Apply Pauli frame correction: True
13+
Encoding mode: 9a
14+
Sweep channel noise: False
15+
Measurement error rate: 0.00147
16+
Mode: Fixed noise rates
17+
EC 1Q rate (fixed): 2.9e-05
18+
EC 2Q rate (fixed): 0.00115
19+
Noise configuration: Sweeping EC/decoding noise
20+
- EC noise applied: During error correction rounds and decoding
21+
- EC 1Q rate: Swept parameter
22+
- EC 2Q rate: Swept parameter (same as 1Q)
23+
- Channel noise: None (0.0)
24+
- Encoding: Noiseless
31.2 KB
Loading
33.9 KB
Loading

plots/ec_experiment_20250916_161024_with_correction/acceptance_rates_ec_experiment.png renamed to plots/ec_experiment_with_correction/acceptance_rates_ec_experiment.png

File renamed without changes.

plots/ec_experiment_20250916_161024_with_correction/experiment_metadata.txt renamed to plots/ec_experiment_with_correction/experiment_metadata.txt

File renamed without changes.

0 commit comments

Comments
 (0)