v1.9.0 - Sintered Samples
Flagship changes:
- Released
sinter, which uses stim and pymatching to perform multicore Monte Carlo sampling of error correction circuits. - Added a python stub file (
stim/__init__.pyi) to improve autocompletion in IDEs.
Breaking changes:
- The
"ptb64"format now requires the shot count to be a multiple of 64, both when reading and when writing. (Previously, missing shots resulted in padding with zero'd data, which created a very easy way to get bad data when reading if the number of shots was not known.) - The default value of
stim.Circuit.shortest_graphlike_error's argumentignore_ungraphlike_errorshas changed from fromFalsetoTrue. (Setting it toFalsecan use "remnant edges" that only appear as components of decomposed errors, and so do not correspond to a single physical error mechanism.)
Notable changes:
- New global methods:
stim.mainstim.read_shot_data_filestim.write_shot_data_file
- New
stim.DetectorErrorModelmethods:stim.DetectorErrorModel.to_filestim.DetectorErrorModel.from_file
- New
stim.Circuitmethods:stim.Circuit.without_noisestim.Circuit.flattenedstim.Circuit.search_for_undetectable_logical_errorsstim.Circuit.to_filestim.Circuit.from_file
- New
stim.TableauSimulatormethods:stim.TableauSimulator.c_xyzstim.TableauSimulator.c_zyxstim.TableauSimulator.cxstim.TableauSimulator.do_circuitstim.TableauSimulator.do_pauli_stringstim.TableauSimulator.do_tableaustim.TableauSimulator.h_xzstim.TableauSimulator.num_qubitsstim.TableauSimulator.peek_xstim.TableauSimulator.peek_ystim.TableauSimulator.peek_zstim.TableauSimulator.postselect_xstim.TableauSimulator.postselect_ystim.TableauSimulator.postselect_zstim.TableauSimulator.reset_xstim.TableauSimulator.reset_ystim.TableauSimulator.reset_zstim.TableauSimulator.zcxstim.TableauSimulator.zcystim.TableauSimulator.zcz
- New
stim.Tableaumethods:stim.Tableau.to_unitary_matrix
- New method options:
obs_path=Noneandobs_formatforstim.CompiledDetectorSampler.sample_fileobs_path=Noneandobs_formatforstim.CompiledMeasurementsToDetectionEventsConverter.convert_fileignore_decomposition_failures=Falseforstim.Circuit.detector_error_modelblock_decompose_from_introducing_remnant_edges=Falseoption for thestim.Circuit.detector_error_modelbit_pack_result=Falseforstim.CompiledMeasurementsToDetectionEventsConverter.convert
- Functional changes:
- Error analysis now attempts to avoid introducing remnant edges unless absolutely necessary (improves detector error models)
- Error analysis now supports
ELSE_CORRELATED_ERRORinstructions as long they occur in contiguous blocks started by aCORRELATED_ERROR - The stim python package now includes the stim command line tool. Much easier than building it for yourself.
- The floating point accuracy of
stim.TableauSimulator.state_vectorhas been substantially improved (e.g. all zeros are now exact) - The method signatures shown in the API reference are now more accurate, matching the ones in
__init__.pyi
Bug fixes:
- Worked around the pseudo random number generator state being duplicated when using multiprocessing with start method
"fork". Samplers now seed from external entropy when constructed, instead of using entropy acquired at startup. - Fixed various reported build failures related to MacOS and Apple M chips.
- Fixed
setup.pynot forcing UTF8 encoding when loadingREADME.md, causing crashes on systems configured to use other encodings by default. - Fixed
stimcirqnot understanding probabilisticcirq.DensePauliStringgates. - Worked around an issue where pytest gives useless failure messages for asserts involving stim objects.
- Fixed an infinite loop in
stim.Circuit.get_detector_coords. - Fixed complex indices like
stim.Circuit()[1j]crashing the python interpreter (by switching to latest version of pybind11). - Fix loop folding during error analysis incorrectly folding loops with observables including measurements from only the last few iterations
- Fixed a segfault in measurement-to-detection-event conversion related to failing to ignore noise channels
- Fixed a bug in measurement-to-detection-event conversion where some OBSERVABLE_INCLUDE instructions were being forgotten