Questions tagged [stim]

For questions about Stim, the open source tool for high-performance simulation of quantum stabilizer circuits.

References:

206 questions
5
votes
1 answer

How does Stim's detector sampler work?

I'm just getting started with Stim (and hence working through its Getting Started Notebook) and am wondering how the detector sampler actually works. The notebook states A detector doesn't say whether the parity should be even or should be odd,…
drumadoir
  • 95
  • 5
4
votes
1 answer

Bug in stim HERALDED_PAULI_CHANNEL_1?

Tried this simple example where initializing two qubits in $|0\rangle$ state, performing biased bit flip erasure on qubit 1 using HERALDED_PAULI_CHANNEL_1 while measuring qubit 0: import stim import numpy as np circuit = stim.Circuit() …
Xiao Xiao
  • 43
  • 2
3
votes
2 answers

Stim: How are the signs in tableau calculated and how to force them to +

I'd like to understand how the signs in the tableau are calculated and if there's a way to force them to be +. Here's an example that shows what I see : (this is an encoder for $[[8,3,3]]$ code) import stim def circuit_to_tableau(circuit:…
unknown
  • 2,052
  • 1
  • 7
  • 16
3
votes
1 answer

How can I decide ahead of time whether a Stim detector will be deterministic?

I have a high-level description of a quantum stabiliser code and a small brain, and I'd like to write code to compile the former to a Stim circuit. The high-level description contains the stabiliser measurements to perform each round, and then…
user21281
  • 31
  • 2
3
votes
2 answers

How do I perform an erasure error in stim?

An erasure error is a heralded error that completely destroys a qubit (e.g. resets it or maximally mixes it). The qubit is gone but you are told it's gone. How do I simulate this kind of error using stim?
Craig Gidney
  • 36,389
  • 1
  • 29
  • 95
3
votes
1 answer

Use stim to simulate d=3 Bacon-Shor's code

When I use stim to simulate d=3 Bacon-Shor's code, I can't find the problem with my circuits resulting in the weird DetectorErrorModel. The initialization and stabilizer measurement circuits are as follow: I focus on $|0\rangle _L$ memory…
Inm
  • 505
  • 3
  • 8
3
votes
1 answer

How do I initialize stim's tableau simulator to a random tableau?

I want to create a stim.TableauSimulator with a random tableau as its state. I know I can get a random tableau using stim.Tableau.random(num_qubits), but how do I do the same thing for the simulator?
Craig Gidney
  • 36,389
  • 1
  • 29
  • 95
2
votes
1 answer

Implementing large-area correlated errors in Stim

I'm looking to implement spatially correlated large-area errors similar to this paper, where a local patch of qubits experience random $I$,$X$, $Y$, $Z$ errors (simultaneously) with some probability $p(r)$, where $r$ is related to the size of the…
jfids
  • 47
  • 5
2
votes
1 answer

How do I write a stim diagram to a file?

I made an svg diagram from a stim circuit: import stim circuit = stim.Circuit(""" H 0 CX 0 1 M 0 1 """) diagram = circuit.diagram("timeline-svg") display(diagram) I tried to write the diagram to a file, but I got an error: with…
Craig Gidney
  • 36,389
  • 1
  • 29
  • 95
2
votes
2 answers

Implementing biased erasure error in stim

We are trying to simulate the erasure channel in stim, but it is a biased erasure - meaning that the replaced qubit doesn't have a depolarizing channel but a biased channel. We saw that there is a function in stim "HERALDED_ERASE" channel, but here…
2
votes
1 answer

OBSERVABLE_INCLUDE in the REPEAT instruction in Stim

Can I increment the value of 'i' in OBSERVABLE_INCLUDE(i) for each iteration within REPEAT in Stim? For example, I would like the 'i' in OBSERVABLE_INCLUDE(i) to become 0,1,2,3,4,5,6,7,8 when the circuit is repeated three times, resulting in a total…
kong
  • 21
  • 2
2
votes
0 answers

Stim and pickle/dill incompatibility

I have been using pickle (and also tried dill) to save and load Clifford gates coming from the Stim library. The following code: cliff_list = dill.load(filename) gives the error ImportError: generic_type: type "CompiledDemSampler" is already…
mbejan
  • 21
  • 1
2
votes
1 answer

Two-qubit depolarizing error convention in Stim

In the definition of two-qubit depolarizing error in Stim, it is defined that operations such as $IX, XX, YI$ (excluding $II$) act with a probability of p/15, while $II$ acts with a probability of 1-p. Now, I want to use two-qubit depolarizing error…
lassel
  • 51
  • 2
2
votes
1 answer

Stim: Peek (or Extract) Circuit Pauli Frame

I am testing a fault tolerant error correction scheme for a quantum error correcting code in the following way: Construct my circuit (data and ancilla qubits) Perform a round of error correction (set of projective measurements onto the ancilla…
ababar
  • 23
  • 2
2
votes
1 answer

How to enable ignore_decomposition_failures in sinter.collect()?

I am using stim and sinter to compute the logical error rate of a QEC code. For the code I am testing, calling the function sinter.collect() triggers the following error: ValueError Traceback (most recent call…
giangiac
  • 21
  • 1
1
2 3 4 5