Stim

Latest version: v1.14.0

Safety actively analyzes 682471 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

1.9.0

Flagship changes:

- Released [`sinter`](https://github.com/quantumlib/Stim/tree/main/glue/sample), 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 argument `ignore_ungraphlike_errors` has changed from from `False` to `True`. (Setting it to `False` can 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.main`
- `stim.read_shot_data_file`
- `stim.write_shot_data_file`
- New `stim.DetectorErrorModel` methods:
- `stim.DetectorErrorModel.to_file`
- `stim.DetectorErrorModel.from_file`
- New `stim.Circuit` methods:
- `stim.Circuit.without_noise`
- `stim.Circuit.flattened`
- `stim.Circuit.search_for_undetectable_logical_errors`
- `stim.Circuit.to_file`
- `stim.Circuit.from_file`
- New `stim.TableauSimulator` methods:
- `stim.TableauSimulator.c_xyz`
- `stim.TableauSimulator.c_zyx`
- `stim.TableauSimulator.cx`
- `stim.TableauSimulator.do_circuit`
- `stim.TableauSimulator.do_pauli_string`
- `stim.TableauSimulator.do_tableau`
- `stim.TableauSimulator.h_xz`
- `stim.TableauSimulator.num_qubits`
- `stim.TableauSimulator.peek_x`
- `stim.TableauSimulator.peek_y`
- `stim.TableauSimulator.peek_z`
- `stim.TableauSimulator.postselect_x`
- `stim.TableauSimulator.postselect_y`
- `stim.TableauSimulator.postselect_z`
- `stim.TableauSimulator.reset_x`
- `stim.TableauSimulator.reset_y`
- `stim.TableauSimulator.reset_z`
- `stim.TableauSimulator.zcx`
- `stim.TableauSimulator.zcy`
- `stim.TableauSimulator.zcz`
- New `stim.Tableau` methods:
- `stim.Tableau.to_unitary_matrix`
- New method options:
- `obs_path=None` and `obs_format` for `stim.CompiledDetectorSampler.sample_file`
- `obs_path=None` and `obs_format` for `stim.CompiledMeasurementsToDetectionEventsConverter.convert_file`
- `ignore_decomposition_failures=False` for `stim.Circuit.detector_error_model`
- `block_decompose_from_introducing_remnant_edges=False` option for the `stim.Circuit.detector_error_model`
- `bit_pack_result=False` for `stim.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_ERROR` instructions as long they occur in contiguous blocks started by a `CORRELATED_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_vector` has 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.py` not forcing UTF8 encoding when loading `README.md`, causing crashes on systems configured to use other encodings by default.
- Fixed `stimcirq` not understanding probabilistic `cirq.DensePauliString` gates.
- 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

1.8.0

Flagship changes:

- Search for smallest logical errors directly from a circuit
- Find circuit errors that explain detector error model symptoms
- Helpful error messages when detector error model extraction fails
- Better compatibility with cirq

Notable changes:

- Added `stim.Circuit.shortest_graphlike_error` for finding the smallest set of physical errors that can cause an undetected logical error (as long as they each have at most two detection events)
- Added `stim.Circuit.explain_detector_error_model_errors` for listing how detector error model symptoms match up with physical circuit error mechanisms
- When `stim.Circuit.detector_error_model` fails due to an anti-commuting detector or observable, the error message now describes in great detail the involved detectors, qubits, and error sensitivities
- Added several dataclasses for representing results from `stim.Circuit.explain_detector_error_model_errors`
- Added `stim.Circuit.get_detector_coordinates`
- Added `stim.Circuit.get_final_qubit_coordinates`
- Added `stim.DetectorErrorModel.get_detecetor_coordinates`
- Added `stim.Circuit.append` as a shorter more pythonic alias for `append_operation`
- `stim.Circuit.append` now allows the targets argument to be a single target, instead a list of targets
- `stim.Circuit.append` verifies that a probability argument is given when appending noisy gates
- `stimcirq` now converts `DETECTOR` annotations (via `stimcirq.DetAnnotation`)
- `stimcirq` now converts `OBSERVABLE_INCLUDE` annotations (via `stimcirq.CumulativeObservableAnnotation`)
- `stimcirq` now converts `SHIFT_COORDS` annotations (via `stimcirq.ShiftCoordsAnnotation`)
- `stimcirq` now converts `REPEAT` blocks (via `cirq.CircuitOperation`)
- `stimcirq` now converts `MPP` measurements (via `cirq.PauliMeasurementGate`) (inverted results not yet supported due to https://github.com/quantumlib/Cirq/issues/4814)
- `stimcirq` now converts operations controlled by sweep targets (via `stimcirq.SweepPauli`)
- `stimcirq` now supports cirq json serialization (via `stimcirq.JSON_RESOLVER` and `stimcirq.JSON_RESOLVERS_DICT`)
- Fixed `stim.CircuitInstruction`, `stim.GateTarget`, `stim.DemTarget`, `stim.DemInstruction` not being hashable
- Improved documentation of the file formats for sample results
- Fixed measurement-to-detection conversion going into an infinite loop for circuits with no measurements when using file format `b8`
- Development versions of stim are now automatically uploaded to pypi when changes are merged into `main`

1.7.1

- Fix using AVX instructions as part of checking if AVX instructions can be used (see https://github.com/quantumlib/Stim/issues/179)
- Fix the source distribution (sdist) not including header files

1.7.0

Flagship changes:

- Stim's python package is now pre-built, reducing install time from >5 minutes to a few seconds
- Fixed error analysis evaluating overlapping `MPP` targets in the wrong order, creating bad detector error models

Notable changes:

- Added pickling support to `stim.Tableau`, `stim.Circuit`, `stim.PauliString`, and `stim.DetectorErrorModel`
- Added `stim.DetectorErrorModel.shortest_graphlike_error` for quickly finding simple low weight errors and upper bounding code distance
- Added several small handy `stim.DetectorErrorModel` methods:
- `append`
- `approx_equals`
- `num_errors`
- `+` and `+=` (concatenation)
- `*` and `*=` (repetition)
- Added `stim.Circuit.approx_equals`
- Fixed `circuit.append_operation` allowing NaN probabilities which could then cause crashes

1.6.0

Flagship Changes:

- Tools for converting measurement data into detection event data (`stim.Circuit.compile_m2d_converter`)
- Initial support for "sweep bit targets", which can be used to define families of circuits that differ by Paulis (`CNOT sweep[2] 3`)
- Seeding simulators to get consistent results (on the same machine, using the same version)

Notable Python Changes:

- Added `stim.Circuit.compile_m2d_converter` for converting measurements into detection events.
- `stim.Circuit.compiled_[detector_]sampler` now takes a `seed=None` argument.
- `stim.Circuit.compiled_sampler` now takes a `skip_reference_sample=False` argument.
- Added `stim.TableauSimulator.peek_observable_expectation`.
- `stim.Circuit.append_operation` now accepts `stim.CircuitInstruction` and `stim.RepeatBlock`values
- Added `stim.Compiled[Detector]Sampler.sample_write` for putting results directly onto disk without paying python conversion costs
- stimcirq now depends on `cirq-core` instead of all of `cirq`
- There is now autogenerated documenting stim's various output formats (e.g. `b8`)
- Gate documentation now includes `Targets:`, `Parens arguments:`, and `Decomposition:` sections
- Added a getting started notebook
- Fixed generated rep code circuits having 1 too many data qubits for the desired code distance.

Notable C++ Changes:

- Modes are now invoked like `stim sample --shots 100` instead of `stim --sample 100`. The old style still works but is deprecated.
- Renamed `--frame0` flag to `--skip_reference_sample`. `--frame0` still works but is deprecated.
- `stim help [term]` now includes data format help, mode help, and command line flag help.
- Added `stim m2d` mode for converting measurement data into detection event data.
- Added `--seed` option to `stim sample` and `stim detect`
- There is now an `io` directory with writers and readers for the various sample data formats
- Flattened `stim_internal::` into `stim::` (the distinction wasn't sufficiently curated to be useful)
- `include "stim.h"` now includes all header files in stim
- Changed `simd_word` into a `define` with different values for each width, so incompatible builds fail at link time instead of triggering undefined behavior at runtime

1.5.0

Flagship Changes:

- Measurements can now be noisy (`M(0.001) 1 2 3` flips each result with 0.1% chance)
- Added Pauli product measurement (`MPP X0*X1 Z8*Z9` measures `X0*X1` then `Z8*Z9`)
- Fixed a bug in the frame simulator where `MY` (Y basis measurement) acted like `MRY` (Y basis demolition measurement)

Other Changes:

- `stimcirq` now adds `QUBIT_COORDS` annotations
- Arbitrary `cirq.GridQubit` / `cirq.LineQubit` qubits can now survive round trip conversion from cirq to stim back to cirq
- `stim.Circuit` and `stim.DetectorErrorModel` now support slicing (e.g. `circuit[:4]` is a circuit with the first 4 operations from `circuit`)
- Giving `decompose_errors=True` to `stim.Circuit.detector_error_model` now guarantees the resulting error model is decomposed into graphlike errors (or else will raise an exception)
- Increased the flexibility of error decomposition. It now considers all errors, instead of only other errors coming from the same Pauli channel, when the latter fails.
- Fixed `stim.Circuit.append_operation` only accepting raw integers as targets (it now also accepts `stim.GateTarget` values).

C++ Library Changes:

- Fixed some bugs related to statically linking C++ programs to stim
- Fixed "stim.h" breaking if included twice
- Documented how to link to stim using Bazel
- Fixed Bazel BUILD file not including the include directory
- Fixed an incompatibility with GTest v1.11
- Added `DetectorErrorModel::from_file` convenience methods
- Fixed `FixedCapVector::operator<` not being a consistent ordering.
- Gate targets are now internally stored as `GateTarget` structs instead of raw `uint32_t` values

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.