Skip to main content
KetQat

Appearance

Steane [[7,1,3]] code: fault-tolerance check

Enumerate every single-qubit Pauli error on the Steane code, verify its syndrome and correction, and show where distance 3 stops.

Officially provided by KetQat — method by Steane (1996), Steane (1996) and others. KetQat prepares, verifies and maintains this product; it does not claim to have invented the method. Read the origin statement.

What it does and who it is for

Checks the Steane [[7,1,3]] code exhaustively on your machine. Weight-1 Pauli errors on 7 qubits number exactly 21, so the product enumerates all of them: it builds the syndrome table from binary symplectic arithmetic (each error commutes or anticommutes with each of the six stabiliser generators) and confirms that every syndrome is non-zero and unique. Independently, it encodes |0_L> as a 128-amplitude state vector by projecting onto the stabiliser eigenspace, applies each error, measures the syndrome by projection, applies the table's correction and requires fidelity 1 with the original. It then classifies all 189 weight-2 errors: every one is detected, those whose syndrome coincides with a weight-1 error are miscorrected into a logical error, and the rest are flagged as uncorrectable -- which is what distance 3 means.

You can also apply one Pauli error of your choice to |0_L>, |1_L> or |+_L> and see the syndrome, the decoder's correction, the residual operator and the fidelity afterwards.

Use cases

  • Verify by complete enumeration that the Steane code corrects every single-qubit X, Y and Z error
  • See a weight-2 error whose syndrome collides with a weight-1 error's, and the logical error the decoder then causes
  • Trace what happens to a chosen error on a chosen logical state: syndrome, correction, residual, fidelity

Use it on your computer

This page never runs anything. Copy the commands into your own terminal; the product runs locally with no account and no telemetry.
  1. Install

    Installs the KetQat SDK from commit 2cedabbd814f, the exact version whose product definition this page shows. The SDK is not on PyPI yet, so pip install ketqat alone will not work.

    Terminal
    pip install "ketqat[qinfo] @ git+https://github.com/ketqat/ketqat-sdk@2cedabbd814fd199b1989c8ceb1e9efa1744c2c0#subdirectory=python"
  2. Run the example

    Save it as example.py and run python example.py. Or use the CLI: ketqat catalog run [email protected].

    Python
    import json
    from ketqat_runner import catalog
    
    record = catalog.run("[email protected]", logical_state="zero", error="XXIIIII")
    result = record.result
    single, two, applied = result["single_qubit_errors"], result["weight_two_errors"], result["applied_error"]
    print(json.dumps({
        "status": record.status,
        "single_qubit_errors_checked": single["count"],
        "distinct_syndromes": single["distinct_syndromes"],
        "all_recovered": single["all_recovered"],
        "weight_two_detected": two["detected"],
        "weight_two_miscorrected": two["miscorrected_to_a_logical_error"],
        "weight_two_flagged": two["flagged_uncorrectable"],
        "chosen_error_corrected": applied["corrected"],
        "chosen_error_residual_action": applied["residual_logical_action"],
    }))
    
    Expected output (fields the example must print)
    {
      "status": "succeeded",
      "all_recovered": true,
      "distinct_syndromes": 21,
      "weight_two_flagged": 126,
      "weight_two_detected": 189,
      "chosen_error_corrected": false,
      "weight_two_miscorrected": 63,
      "single_qubit_errors_checked": 21,
      "chosen_error_residual_action": "X"
    }

    Verified with

    SDK
    0.3.0
    Python
    3.12.12
    Platform
    macOS-27.0.1-arm64 Python 3.12.12 (maintainer run in a clean virtualenv, test_catalog_examples.py)
    Date
    1 Nov 2026
  3. Optional: tell us it ran

    ketqat report RUN_ID sends an opt-in usage report: product, version, succeeded/failed, time and SDK version only. It shows you the exact payload first and needs an API token from Settings. Nothing is sent unless you run it.

Inputs and outputs

Inputs

Inputs of Steane [[7,1,3]] code: fault-tolerance check
NameTypeDefaultAllowed valuesDescription
logical_statestringzeroenum: zero, one, plusLogical state the chosen error is applied to: zero (|0_L>), one (|1_L> = X_L|0_L>) or plus ((|0_L> + |1_L>)/sqrt 2).
errorstringnull—A 7-letter Pauli string over I, X, Y, Z to apply to the logical state, e.g. IIXIIII or XXIIIII. null applies no chosen error.
exhaustivebooleantrue—Run the full enumeration of weight-1 and weight-2 errors. false runs only the chosen error (which is then required).

Outputs

Outputs of Steane [[7,1,3]] code: fault-tolerance check
NameTypeDescription
single_qubit_errorsobjectCount (21), distinct syndromes (21), all detected and uniquely identified, and the independent state-level count recovered with fidelity 1.
weight_two_errorsobjectCount (189), how many are detected, how many have a syndrome matching a weight-1 error (and are miscorrected into a logical error), how many are flagged uncorrectable, and an example.
syndrome_tableobjectThe 21 syndromes (six bits, one per stabiliser generator) and the weight-1 error each identifies.
applied_errorobjectFor a chosen error: its syndrome by commutation and by projection, the correction applied (or that it was flagged), the residual operator and its logical action, and the fidelity after correction.

Sample result

All 21 weight-1 Pauli errors have distinct non-zero syndromes and all 21 are recovered at the state level with fidelity 1. All 189 weight-2 errors are detected: 63 share a syndrome with a weight-1 error and are miscorrected into a logical error (for example XXIIIII becomes XXXIIII), 126 are flagged uncorrectable.

Generated with

Product version
1.0.0
Seed
null
Parameters
{"error":null,"exhaustive":true,"logical_state":"zero"}
SDK
0.3.0
Python
3.12.12
Platform
macOS-27.0.1-arm64-arm-64bit
Result data (JSON)
{
  "code": "Steane [[7,1,3]] CSS code",
  "execution": "syndromes by binary symplectic arithmetic; state-level checks on a 128-amplitude state vector",
  "stabilizers": [
    "IIIXXXX",
    "IXXIIXX",
    "XIXIXIX",
    "IIIZZZZ",
    "IZZIIZZ",
    "ZIZIZIZ"
  ],
  "distance_limit": {
    "claim": "Weight-2 errors exist whose syndrome matches a weight-1 error, so the decoder applies the wrong correction. This is what distance 3 means: correct one, detect two. The code does not correct two, and reporting otherwise would misdescribe it.",
    "example": {
      "actual": "XXIIIII",
      "syndrome": "(0, 0, 0, 0, 1, 1)",
      "decoder_applies": "IIXIIII"
    },
    "miscorrected_ordered_pairs": 126
  },
  "syndrome_table": {
    "100000": "IIIZIII",
    "100100": "IIIYIII",
    "101000": "IIIIZII",
    "101101": "IIIIYII",
    "110000": "IIIIIZI",
    "110110": "IIIIIYI",
    "111000": "IIIIIIZ",
    "111111": "IIIIIIY",
    "000001": "XIIIIII",
    "000010": "IXIIIII",
    "000011": "IIXIIII",
    "000100": "IIIXIII",
    "000101": "IIIIXII",
    "000110": "IIIIIXI",
    "000111": "IIIIIIX",
    "001000": "ZIIIIII",
    "001001": "YIIIIII",
    "010000": "IZIIIII",
    "010010": "IYIIIII",
    "011000": "IIZIIII",
    "011011": "IIYIIII"
  },
  "errors_enumerated": 21,
  "logical_operators": {
    "X": "XXXXXXX",
    "Z": "ZZZZZZZ"
  },
  "weight_two_errors": {
    "note": "Distance 3: every weight-2 error is detected. When its syndrome coincides with a weight-1 error's the decoder applies that weight-1 correction and the residual is a weight-3 logical operator; when it matches no weight-1 error the decoder applies nothing and reports an uncorrectable error.",
    "count": 189,
    "detected": 189,
    "all_detected": true,
    "example_miscorrection": {
      "error": "XXIIIII",
      "residual": "XXXIIII",
      "decoder_applies": "IIXIIII"
    },
    "flagged_uncorrectable": 126,
    "miscorrected_to_a_logical_error": 63,
    "syndrome_matches_a_single_qubit_error": 63
  },
  "single_qubit_errors": {
    "claim": "All 21 weight-1 Pauli errors produce distinct non-zero syndromes. Weight-1 errors are finite, so this is a complete enumeration -- a proof, not a sample.",
    "count": 21,
    "all_detected": true,
    "all_recovered": true,
    "distinct_syndromes": 21,
    "state_level_method": "128-amplitude statevector, syndrome by projection, independent of the commutation table",
    "state_level_recovered": 21,
    "all_uniquely_identified": true
  }
}

Assumptions, scope and limitations

Assumptions

  • Perfect syndrome extraction: stabilisers are measured by exact projection, with no measurement error and no noise during extraction.
  • Pauli errors only, applied once to the encoded state; the decoder is the single-qubit syndrome lookup table.
  • Global phases are dropped when multiplying Pauli strings, which is correct for syndromes and logical actions.

Scope

  • The Steane [[7,1,3]] code with its six standard generators and weight-7 logical operators; all 21 weight-1 and 189 weight-2 Pauli errors; one chosen Pauli error on |0_L>, |1_L> or |+_L>.

Limitations

  • Not a fault-tolerant circuit simulation: no gate faults, no noisy syndrome extraction, no repeated rounds and no logical error rate. It verifies the code's correction properties, not a threshold.
  • The decoder is the weight-1 lookup table. It flags weight-2 errors whose syndrome matches no weight-1 error rather than attempting a minimum-weight correction.
  • Weight-3 and higher errors are not enumerated.
  • Tested on macOS and Linux only; Windows is untested.

Environment and resources

Runs
Locally, on your computer
Type
Analysis
Python
>=3.10
Operating systems
Linux, macOS
Resources
About 0.1 s and under 50 MB: the state-level check multiplies 128x128 matrices for 21 errors.
SDK extras
qinfo
Minimum SDK
0.3.0

Validation

Verified: the example was executed by CI, validation tests exist and limitations are recorded.

Versions and changelog

  1. 1.0.01 Nov 2026currentShown on this page

    • First catalog release, wrapping the SDK's existing Steane-code verification with weight-2 classification and a chosen-error trace.

    Needs SDK 0.3.0 or later with extras: qinfo.

All product changelogs

Origin, license and credits

KetQat implementation of published methods

The [[7,1,3]] code was invented by Steane (1996) as the first CSS code built from the classical Hamming code, with the general CSS construction due to Calderbank and Shor (1996) and the stabiliser formalism to Gottesman (1997). KetQat wrote this NumPy implementation (steane.py), the syndrome and state-level checks, the weight-2 classification, the validation tests and this catalog entry. KetQat did not invent the code.

Upstream software

License of what you receive

Apache-2.0 — see Licensing.

Contributors

People credited for this product. KetQat publishes and maintains it; contributors are credited for their work and are not sellers.

  • dorakingx · KetQat maintainer: implementation, validation and catalog entry

How to contribute

References

  1. A. M. Steane (1996). Error Correcting Codes in Quantum Theory. Physical Review Letters 77, 793-797.DOI 10.1103/PhysRevLett.77.793
  2. A. M. Steane (1996). Multiple-particle interference and quantum error correction. Proceedings of the Royal Society A 452, 2551-2577.arXiv:quant-ph/9601029
  3. A. R. Calderbank, Peter W. Shor (1996). Good quantum error-correcting codes exist. Physical Review A 54, 1098-1105.DOI 10.1103/PhysRevA.54.1098arXiv:quant-ph/9512032
  4. Daniel Gottesman (1997). Stabilizer Codes and Quantum Error Correction. PhD thesis, California Institute of Technology.arXiv:quant-ph/9705052
  5. Michael A. Nielsen, Isaac L. Chuang (2010). Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press.DOI 10.1017/CBO9780511976667

Usage

No usage reports yet

Distinct signed-in accounts that chose to send at least one usage report (ketqat report) for this product in the last 90 days. KetQat staff, test and bot accounts are excluded. Reports are opt-in, so this is not a count of all users.

Computed 10 Nov 2026, 17:34 UTC.

Reviews

Not yet rated

Be the first to rate this product after you run it.

Mean of visible reviews. Hidden reviews and reviews by KetQat staff, test and bot accounts are excluded. Pro status gives no extra weight.

Sign in to review this product. One review per person; you can edit it later.

No reviews yet.