Skip to content

Releases: quantumlib/Stim

v1.6.0 - Conversion Consistency

15 Oct 07:07
Compare
Choose a tag to compare

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.RepeatBlockvalues
  • 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

v1.5.0 - Noisy Measurements

28 Jul 08:14
Compare
Choose a tag to compare

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

v1.4.0 - Error Analysis and Circuit Generation

30 Jun 00:04
Compare
Choose a tag to compare

Flagship features:

  • Convert circuits into detector error models, suitable for configuring decoders with.
  • Generate annotated error correction circuits using the repetition code, surface code, or color code.

Notable changes:

  • Added stim.Circuit.generated(...) to generate common error corrected circuits.
  • Added stim.Circuit.detector_error_model(...) to simplify circuits into detector error models.
  • Added stim.DetectorErrorModel and related classes such as stim.DemTarget.
  • Made inspecting stim.Circuiteasier. You can now index into and iterate over its instructions and blocks.
  • Made inspecting stim.Tableaueasier. Added efficient methods for getting single Pauli terms or inverse terms.
  • New supported circuit instructions:
    • XYZ measurement/reset gates: MX, MY, MZ, RX, RY, RZ, MRX, MRY, MRZ
    • Period 3 rotations around X+Y+Z: C_XYZ and C_ZYX.
    • Ion trap gates: SQRT_XX, SQRT_XX_DAG, SQRT_YY, SQRT_YY_DAG, SQRT_ZZ, SQRT_ZZ_DAG
    • Coordinate annotations: QUBIT_COORDS and SHIFT_COORDS (and DETECTOR now takes optional coordinate arguments).
    • Custom pauli error channels: PAULI_CHANNEL_1(x, y, z) and PAULI_CHANNEL_2(ix, iy, iz, xi, xx, xy, xz, yi, yx, yy, yz, zi, zx, zy, zz)
  • Increased various repetition limits from tens of millions of iterations to quintillions of iterations.
  • Added stim.TableauSimulator.state_vector for converting the stabilizer state into a state vector.
  • Created better documentation of the circuit format, the detector error model format, and supported gates in the doc/ directory of the github repo.
  • In addition to being exposed to python, error analysis now supports folding loops, decomposing errors, allowing gauge detectors, and optionally approximating disjoint error mechanisms as independent error mechanisms.

Deprecations since v1.3:

  • Command line --detector_hypergraph flag now complains that you should use --analyze_errors

Bug fixes:

  • Fixed error analysis incorrectly handling MR gates operating on the same qubit multiple times.
  • Fixed stim.TableauSimulator.cnot and other two qubit methods not enforcing that the two qubits must be different.
  • Fixed OBSERVABLE_INCLUDE indices being summed instead of maxed when estimating memory usage.
  • Fixed way-too-large command line integer arguments silently overflowing to smaller values and being accepted.
  • Fixed some cases where gates with incompatible targets could be added to a circuit.
  • Fixed exceeding the linux file handle limit when taking thousands of shots from a circuit with billions of measurements with both --in and --out files specified.

Notable internal changes:

  • The supported gates documentation is now autogenerated from the internal gate data.
  • Gates now take a variable number of arguments instead of only one.
  • Documented on how to statically link to stim in cmake projects
  • Initial work on possible stimzx package.
  • Initial work on possible stimjs package.

v1.3.0 - Control, Closure, and Concatenation

16 Apr 17:28
Compare
Choose a tag to compare

User improvements:

  • stimcirq can now convert in both directions, and preserves circuit moment structure when converting
  • stim.TableauSimulator is easier to control and inspect
    • Truncate the state using stim.TableauSimulator.set_num_qubits
    • Replace the state using stim.TableauSimulator.set_inverse_tableau
    • Recognize single qubit stabilizer states non-destructively using stim.TableauSimulator.peek_bloch
    • Get state stabilizers in a standard form using stim.TableauSimulator.canonical_stabilizers
    • Guide measurement results after the fact using stim.TableauSimulator.measure_kickback
  • stim.PauliString is now closed under multiplication
    • stim.PauliString.sign is now allowed to be 1j or -1j
    • Added allow_imaginary=False parameter to stim.PauliString.random
    • Multiplying anti-commuting Pauli strings now produces a result instead of an error
  • stim.PauliString and stim.Tableau now support concatenation via + and/or *
    • Adding stim.PauliStrings concatenates them (computes their tensor product)
    • Adding stim.Tableaus concatenates them (computes their direct sum)
    • Multiplying stim.PauliString self-concatenates a variable number of times
  • Mutable semantics have been improved
    • stim.PauliString now has a *= operator that works inline
    • Added copy methods to stim.{Circuit,Tableau,PauliString,TableauSimulator}
  • Bug fixes
    • Fixed stim.TableauSimulator.measure reading invalid memory when applied to a qubit that hadn't been touched yet
    • Fixed import stim failing in some environments due to a unicode docstring not being marked as UTF8 (#20)
    • Fixed stim.TableauSimulator.cnot and other controlled operation methods failing when given a classical control
    • Worked around a bug in std::random_device in some environments (#26)

Dev improvements:

  • Added a test command to cibuildwheel, so continuous integration now confirms tests pass on multiple platforms
  • Fixed stimcirq doctests being skipped

v1.2.1 - X Z error swap fix

19 Mar 00:14
Compare
Choose a tag to compare

Major improvements:

  • Fixed the effects of X_ERROR and Z_ERROR being swapped in TableauSimulator

Dev improvements:

  • Fixed noisy operations of TableauSimulator not being verified against known-good operations from cirq using black box sample statistics

v1.2.0 - Rolled Repetition

18 Mar 19:31
Compare
Choose a tag to compare

Major improvements:

  • Worked around a PyCharm autocomplete bug triggered by having """ in __doc__ strings.
  • stim.Circuit no longer unrolls REPEAT blocks.
  • stim.Circuit.__mul__ now wraps the circuit into a REPEAT block.

Minor improvements:

  • Shorter stim.Circuit.__repr__
  • Compiled samplers now have an eval-able __repr__.
  • stimcirq no longer forces a specific version of cirq as a requirement.

Dev improvements:

  • Split python and dev documentation into a separate README.
  • Refactored underlying code to support streaming circuits with results too large to store in memory (not yet exposed as python bindings).

v1.1.0 - Abstract Algebra

11 Mar 00:10
Compare
Choose a tag to compare

Major improvements:

  • Added stim.PauliString, a datatype for representing and manipulating Pauli products
  • Added stim.Tableau, a datatype for representing and manipulating stabilizer tableaus
  • Added stim.TableauSimulator.current_inverse_tableau for introspecting the simulator state
  • Added examples to most docstrings
  • There is now an API reference at the github wiki https://github.com/quantumlib/Stim/wiki

Minor improvements:

  • Fixed stim.__version__ returning the string "VERSION_INFO" instead of something useful
  • stim.Circuit.__init__ now takes an optional stim program string
  • New methods on existing types:
    • stim.Circuit.__eq__(other)
    • stim.Circuit.__ne__(other)
    • stim.Circuit.__repr__()
    • stim.Circuit.clear()
    • stim.TableauSimulator.current_measurement_record()
    • stim.TableauSimulator.do(stim.Circuit)
    • stim.TableauSimulator.h_xy(...)
    • stim.TableauSimulator.h_yz(...)
    • stim.TableauSimulator.swap(...)
    • stim.TableauSimulator.iswap(...)
    • stim.TableauSimulator.iswap_dag(...)
    • stim.TableauSimulator.xcx(...)
    • stim.TableauSimulator.xcy(...)
    • stim.TableauSimulator.xcz(...)
    • stim.TableauSimulator.ycx(...)
    • stim.TableauSimulator.ycy(...)
    • stim.TableauSimulator.ycz(...)

Dev improvements:

  • Docstring examples are now verified by a doctest step during continuous integration
  • Added glue/python/generate_api_reference.py for generating the API reference

v1.0.0

03 Mar 05:27
Compare
Choose a tag to compare

Initial public release of stim and stimcirq pypi packages.