v1.10.0 - Inviting Interop
Flagship changes:
- Use open source decoders that are 100x to 1000x faster than before! (pymatching v2 and fusion_blossom)
- Produce 2d and 3d diagrams of circuits and detector error models, with built-in viewers for Jupyter notebooks!
- Sample directly from detector error models. Record the errors that occurred, edit them, and play them back!
Notable changes:
- Added
stim.Circuit.diagram
- Added diagram type
"detector-slice-text"
- Added diagram type
"detector-slice-svg"
- Added diagram type
"match-graph-svg"
- Added diagram type
"match-graph-3d"
- Added diagram type
"match-graph-3d-html"
- Added diagram type
"timeline-text"
- Added diagram type
"timeline-svg"
- Added diagram type
"timeline-3d"
- Added diagram type
"timeline-3d-html"
- Added diagram type
- Added
stim.DetectorErrorModel.diagram
- Added diagram type
"match-graph-svg"
- Added diagram type
"match-graph-3d"
- Added diagram type
"match-graph-3d-html"
- Added diagram type
- Added methods to
stim.PauliString
:stim.PauliString.from_numpy
stim.PauliString.from_unitary_matrix
stim.PauliString.to_numpy
stim.PauliString.to_tableau
stim.PauliString.to_unitary_matrix
- Added methods to
stim.TableauSimulator
:stim.TableauSimulator.__init__
now has an optionalseed
argumentstim.TableauSimulator.set_state_from_stabilizers
stim.TableauSimulator.set_state_from_state_vector
stim.TableauSimulator.do
now acceptsstim.CircuitInstruction
andstim.CircuitRepeatBlock
- Added methods to
stim.Tableau
:stim.Tableau.iter_all
stim.Tableau.from_circuit
stim.Tableau.from_numpy
stim.Tableau.from_stabilizers
stim.Tableau.from_state_vector
stim.Tableau.from_unitary_matrix
stim.Tableau.to_circuit
stim.Tableau.to_numpy
stim.Tableau.to_pauli_string
stim.Tableau.to_state_vector
- Added methods to
stim.DetectorErrorModel
:stim.DetectorErrorModel.flattened
stim.DetectorErrorModel.rounded
stim.DetectorErrorModel.compile_sampler
- Added
stim.CompiledDemSampler
class with methods:stim.CompiledDemSampler.sample
stim.CompiledDemSampler.sample_write
- Improvements to
sinter
- Added support for pymatching v2
- Added support for fusion_blossom decoder
- Added flag
--title
tosinter plot
- Added flag
--miny
tosinter plot
- Added flag
--plot_args_func
tosinter plot
- Added flag
--failure_units_per_shot_func
tosinter plot
- Added flag
--failure_unit_name
argument tosinter plot
- Added grid lines to the plots made by
sinter plot
- Added
filter_func
,failure_units_per_shot_func
, andfailure_unit_name
arguments tosinter.plot_error_rate
andsinter.plot_discard_rate
- Added
sinter.predict_observables
method - Added ability to discard shots based on observables being mispredicted
- Added
--postselected_observables_predicate
flag tosinter collect
- Added
sinter.Task.postselected_observables_mask
field - Added
postselected_observable_mask
argument tosinter.sample_decode
- Added
- Added
stim diagram
command for producing diagrams, with flags--in
,--type
,--out
,--tick
,--remove_noise
,--filter_coords
. - Added
stim sample_dem
command for directly sampling from detector error model files, with flags--err_out
,--err_out_format
,--in
,--obs_out
,--obs_out_format
,--out
,--out_format
,--replay_err_in
,--replay_err_in_format
,--seed
,--shots
,--err_out
,--err_out_format
,--replay_err_in
,--replay_err_in_format
. - Added
separate_observables=False
argument tostim.CompiledDetectorSampler.sample
- Added
bit_packed=False
argument tostim.CompiledDetectorSampler.sample
- Added
bit_packed=False
argument tostim.CompiledMeasurementSampler.sample
- Deprecated
stim.CompiledDetectorSampler.sample_bit_packed
- Deprecated
stim.CompiledMeasurementSampler.sample_bit_packed
Notable bug fixes:
- Fixed
stim.Circuit.flattened
not fusing all operations - Fixed
stim.Circuit.without_noise
not fusing all operations - Fixed
PAULI_CHANNEL_2
not being marked as targeting pairs of qubits - Fixed sinter's internal python files not being marked as private, so they don't appear as autocomplete suggestions
- Fixed
stim.Circuit.detector_error_model
failing when errors affected more than 15 detectors (unless decompose_errors=True) - Fixed
stim.Circuit.without_noise
not making independent copies of the operations (!) - Fixed sinter only sampling using the first decoder given to it, instead of all decoders, when given multiple decoders
- Fixed not redirecting stdout and stderr to python's when calling
stim.main
- Fixed unnecessary overhead in the conversion to/from numpy arrays (10x faster for small arrays)
- Fixed a segfault and bad parsing logic in
stim.read_shot_data_file
(!). Fuzz tested the read/write methods against the python reference methods to avoid this happening again.
Notable dev changes:
- Fixed files being opened in text mode instead of binary mode, resulting in bad parsing/serialization on Windows due to \n bytes being turned into \r\n and vice versa.
- Templatized classes like
simd_word
so AVX and SSE code can coexist in the same binary - Added
stim_python_bindings
cmake target - The cmake build now uses file lists which can be regenerated using a script
- Added
dev/
directory for scripts - File lists used by cmake are now generated automatically instead of maintained manually
- The polyfill simd_word that uses 64 bit words now only uses one word instead of two (reducing padding overhead)
- To allow supporting a larger variety of decoders, sinter no longer includes each decoder in its requirements. Decoders need to be installed separately to use them.
- Added
-fPIC
tolibstim
cmake target - Sinter now passes most information via the disk instead of through the multiprocessing API. This reduced the workload on the manager and the startup costs of batches, but made it much more disk limited on high core count machines.
- The API reference no longer shows deprecated methods (these methods are still listed in the .pyi stubs file)
- All doc strings now wrap at 80 characters, and this is enforced by continuous integration.
- The command line reference documentation has been substantially improved (e.g. flag information now grouped with the command instead of separate)
- Added python 3.11 support and OSX ARM support to the set of prebuilt wheels