Quantum Error Correction · Memory experiments
Repetition code memory (bit-flip)
Monte Carlo logical error rate of the n-qubit bit-flip repetition code under i.i.d. bit flips, beside the exact binomial value.
Distance x error-rate sweep with Stim + PyMatching: Wilson points, suppression factors, bootstrapped threshold crossing, report.
Officially provided by KetQat — method by Dennis et al. (2002), Fowler et al. (2012) and others. KetQat prepares, verifies and maintains this product; it does not claim to have invented the method. Read the origin statement.
Runs a rotated surface-code memory experiment over a grid of code distances and physical error rates, sampling with Stim and decoding with PyMatching exactly as the free surface-code-memory product does (same circuits, same seed derivation), and turns the grid into a threshold study. Every point carries its logical error rate with a 95% Wilson interval. Between successive distances it reports the suppression factor Lambda = p_L(d) / p_L(d+2) with a delta-method interval. The threshold is estimated from the crossing of neighbouring-distance curves, interpolated in log-log space, with a parametric bootstrap over the per-point failure counts giving a confidence interval and the spread between distance pairs showing finite-size drift. A finite-size scaling collapse (log p_L = A + B x + C x^2, x = (p - p_th) d^(1/nu)) gives a second threshold estimate with a reduced chi-square as the collapse quality. Everything is written to one JSON result and a Markdown report.
For QEC students and researchers who want a reproducible threshold sweep with honest uncertainties rather than a single number, without assembling the sweep, the statistics and the report themselves.
This is a KetQat Pro product: it runs locally like every catalog product, from a signed bundle installed with ketqat pro install under a time-limited entitlement. Its implementation is not part of the open SDK.
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.
pip install "ketqat[pro,qec] @ git+https://github.com/ketqat/ketqat-sdk@2cedabbd814fd199b1989c8ceb1e9efa1744c2c0#subdirectory=python" && ketqat pro login && ketqat pro install [email protected]Save it as example.py and run python example.py. Or use the CLI: ketqat catalog run [email protected].
import json
from ketqat_runner import catalog
record = catalog.run("[email protected]", seed=1, distances=[3, 5],
physical_error_rates=[0.004, 0.008, 0.016, 0.03], shots_per_point=3000)
result = record.result
estimate = result["threshold_estimate"]
print(json.dumps({
"status": record.status,
"distances": result["distances"],
"points": len(result["points"]),
"threshold_found": not estimate["inconclusive"],
"interval_brackets_estimate": estimate["bootstrap"]["lower"] <= estimate["value"] <= estimate["bootstrap"]["upper"],
}))
{
"points": 8,
"status": "succeeded",
"distances": [
3,
5
],
"threshold_found": true,
"interval_brackets_estimate": true
}Verified with
No verification run of this example is recorded in its definition. Pro examples need an entitlement, which the public SDK CI does not have.
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.
This is a Pro product
The open SDK already samples and decodes a rotated surface-code memory at one distance and rate with a Wilson interval (the free surface-code-memory product), computes a suppression factor between two rates (qec_statistics.suppression_factor) and, for manifest sweeps, estimates a threshold as the median of pairwise curve crossings with the spread between pairs as its only uncertainty (threshold.py). Nothing of that moves behind Pro. Pro adds the study as one catalog run: the whole distance x rate sweep with the same open sampler, suppression factors with intervals at every rate, a neighbouring-pair crossing estimator in log-log space with a parametric bootstrap interval over per-point failure counts, a finite-size scaling collapse with its quality number, and a Markdown report.
ketqat pro loginketqat pro install [email protected]ketqat catalog run [email protected]ketqat pro login stores a signed entitlement valid for up to 7 days; runs start offline while it is valid. Cancelling stops new Pro runs and updates after it expires. Your results are never deleted, and Free products are unaffected. This is not DRM.
| Name | Type | Default | Allowed values | Description |
|---|---|---|---|---|
| distances | integer[] | [3,5,7] | maxItems: 5; minItems: 2; itemMaximum: 15; itemMinimum: 3; uniqueItems: true | Code distances (odd, at least two). |
| physical_error_rates | number[] | [0.003,0.005,0.007,0.009,0.011,0.013] | maxItems: 12; minItems: 2; itemMaximum: 0.5; itemMinimum: 0; uniqueItems: true | Depolarizing probabilities p applied after every Clifford gate; the grid should bracket the crossing. |
| shots_per_point | integer | 5000 | maximum: 1000000; minimum: 1 | Sampled experiments at every (distance, rate) point. |
| rounds | integer | null | maximum: 50; minimum: 1 | Syndrome-extraction rounds for every distance. null uses d rounds at distance d. |
| decoder | string | mwpm | enum: mwpm | Decoder. Version 1.0.0 offers minimum-weight perfect matching (PyMatching) only. |
| Name | Type | Description |
|---|---|---|
| points | object[] | One entry per (distance, physical_error_rate): rounds, shots, logical_failures, logical_error_rate, 95% Wilson confidence_interval, is_upper_bound_only, coordinate_seed. |
| suppression_factors | object[] | Lambda = p_L(d) / p_L(d') between successive distances at every rate, with a delta-method 95% interval; null when the higher distance saw no failure. |
| threshold_estimate | object | value (mean of neighbouring-pair crossings) with a parametric bootstrap interval, every pair's crossing and interval, the pair spread, the method, or inconclusive with a reason. |
| finite_size_collapse | object | Best (p_th, nu) of the scaling ansatz with the reduced chi-square as collapse quality, or available: false with a reason. |
| decoder_version | string | Installed PyMatching version that produced the result. |
| report | string | Markdown report with the point table, suppression table, threshold estimate, collapse and caveats. |
Not generated in the open SDK: running this product needs a Pro entitlement and bundle, which this repository's CI does not have. Maintainer run of the private bundle with the defaults (d = 3, 5, 7; p = 0.003 to 0.013; 5000 shots per point; seed 2026; Stim 1.16.0, PyMatching 2.4.0): threshold estimate p_th = 0.00815 with 95% bootstrap interval [0.00677, 0.00882]; neighbouring-pair crossings 0.00658 (d 3 vs 5) and 0.00972 (d 5 vs 7), pair spread 0.0031; suppression factor at p = 0.005 of 2.05 [1.19, 3.55] for d 3 -> 5 and 1.90 [0.88, 4.08] for d 5 -> 7; finite-size collapse at p_th = 0.00775, nu = 1.0 with reduced chi-square 1.43 over 18 points.
No validation tests are recorded for this product
Read the limitations above before relying on its results.1.0.01 Nov 2026currentShown on this page
Needs SDK 0.3.0 or later with extras: pro, qec.
KetQat integration of open-source software
The surface code memory, its threshold and its decoding by matching follow Dennis, Kitaev, Landahl and Preskill (2002) and Fowler et al. (2012); the finite-size scaling ansatz follows Wang, Harrington and Preskill (2003). Circuits are generated and sampled by Stim (Craig Gidney) and decoded by PyMatching (Oscar Higgott and Craig Gidney), both used unmodified through the open SDK's sampler, and the statistics use NumPy. KetQat wrote the study workflow: the sweep orchestration, the suppression and crossing estimators with their bootstrap, the collapse fit, the report and this catalog entry. KetQat did not invent the code, the noise model, the decoder or the threshold method.
LicenseRef-KetQat-Pro — the KetQat Pro license. See Licensing.
People credited for this product. KetQat publishes and maintains it; contributors are credited for their work and are not sellers.
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.
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.