Repository navigation
stabilizer-qec 1.6.0
The Python package and the Rust crate both at 1.6.0, "know your circuit": where each fault of
an error model comes from and how few faults defeat a circuit, both as Stim reports them, and
the exact circuit distance by integer programming; Stim's result formats, samplers and command
line; Stim's text timeline and time-slice diagrams; and a paper for the Journal of Open Source
Software. The first release archived on Zenodo.
Added
- The text timeline (
diagram("timeline-text"), and the command line's) is now Stim's,
character for character: Stim's moments, labels and boxes, loops between|columns headed
/REP nwith records, detectors and coordinates in terms ofiter, detectors drawn at their
qubit's coordinates. Checked on hand-made circuits pinning each rule, Stim's generated
memories and 200 random circuits using every gate. diagram("timeslice-svg")anddiagram("detslice-with-ops-svg"), andtickas arange
(withrows) for these anddetslice-svg: a panel per tick, each the qubits at their
coordinates with that tick's operations and/or the detector slice after them (Rust:
DiagramKind::TimeSliceSvg,DetectorSliceWithOpsSvg,DetectorSlicesSvg).Circuit.explain_detector_error_model_errors(*, dem_filter=None, reduce_to_one_representative_error=False)(Rust:Circuit::explain_errors): where each
fault of a circuit's error model comes from: the instruction (numbered as Stim numbers
them, adjacent identical instructions joined), its targets, the Pauli product or the
measurement it flips, theTICKs before it and the loop passes around it. The results
(ExplainedError,CircuitErrorLocationand their parts, Stim's names) print as Stim's
character for character, each part on its own as well (Rust:Displayfor
TargetWithCoordsandCircuitErrorLocation, andCircuitErrorLocation::instruction_text),
for every location and for the representative Stim picks, on
Stim's generated memories and on 1,000 random circuits using every gate, noise channel and
tag.shortest_graphlike_erroron circuits and on detector error models (Rust:
Circuit::shortest_graphlike_error,DetectorErrorModel::shortest_graphlike_error): the
graph-like circuit distance, the fewest faults of at most two detectors that together flip
an observable and no detector, found as Stim finds it (decomposed faults left out unless
ignore_ungraphlike_errors=False). Its length equals Stim's on Stim's generated surface,
repetition and colour codes up to d = 15. On a model it takes Stim's time at d = 11 (3.5 ms)
and 2.5 times it at d = 15;tools/bench.pyholds it to Stim's.search_for_undetectable_logical_errorson circuits and models: Stim's breadth-first
search through hyperedges, with its three limits, giving the same number of faults as
Stim's on its colour codes, surface codes, the Steane code and the [[72, 12, 6]] code.DetectorErrorModel.distance(): the exact distance of a model by integer programming (scipy's
HiGHS), hyperedges included, proven optimal or refused;method="graphlike"or"search"
for the two searches. It finds that Stim's generated XYZ colour-code memory has circuit
distance 2 at d = 3 and 3 at d = 5 (two or three correlated two-qubit faults; Stim's own
search agrees given room), and that the genericCssCodeschedule loses the colour code's
distance likewise, while the surface codes and the Hamming hypergraph product keep theirs.
tools/distances.pymeasures every memory the package builds.write_shot_data_fileandread_shot_data_file, Stim's functions with Stim's arguments, in
all six of its result formats (01,b8,r8,ptb64,hits,dets): files byte for
byte as Stim writes them, and Stim's read back to the same shots.- The command line,
stabilizer-qec(orpython -m stabilizer_qec), after Stim's:gen,
sample,detect,m2d,analyze_errors,explain_errors,diagram,convert,
sample_demandhelp, with Stim's flags and formats, anddecodeafter PyMatching's
predict(any of the package's decoders). Tested end to end against thestimcommand: the
same bytes fromgen(its header and qubit layout included),analyze_errors,m2d,
convert,explain_errors, and fromsampleanddetecton deterministic circuits. Circuit.reference_sample(): the noiseless run's measurement record, as Stim's.Circuit.compile_sampler(*, skip_reference_sample=False, seed=None): raw measurement
records, as Stim's measurement sampler: a noiseless reference run with each shot's flips,
equal to Stim's on deterministic circuits and to its rates otherwise.DetectorErrorModel.compile_sampler(seed=...)(Rust:DetectorErrorModel::sampler): shots
drawn from a model's faults directly, as Stim'sCompiledDemSampler, with the faults that
fired (return_errors) and recorded faults replayed (recorded_errors_to_replay); rates
and pairwise correlations agree with Stim's sampler, and a seed's shots do not depend on the
number of threads.detector_error_model(..., ignore_decomposition_failures=True)(Rust:
DemOptions::ignore_decomposition_failures), Stim's option: a fault that cannot be split
into graph-like pieces is kept whole. The text equals Stim's on its colour codes.- Documentation: the guide's "Knowing a circuit" and "The command line"; tutorial 01's "How
far from failing"; the README's and the report's "Circuit distance", every memory the package
builds measured three ways (tools/distances.py,data/distances.json), where the
integer program's best solution is kept as an upper bound when it does not finish. It finds
the 2-round [[90, 8, 10]] memory has circuit distance at most 9 (checked: 9 faults, no
detector, five logical qubits flipped). - A paper for the Journal of Open Source Software (
paper/, built by the Paper workflow) and
its submission checklist (docs/joss.md);CONTRIBUTING.mdsays where to ask for help.
Changed
- An explicit zero argument on
M,MX,MR,MRXandMPAD(M(0) 0) is kept and
written back, as Stim keeps it.