Questions tagged [stim]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
63 views

How do I write a stim diagram to a file?

I made an svg diagram from a stim circuit: ...
Craig Gidney's user avatar
  • 33.3k
4 votes
1 answer
122 views

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 ...
Xiao Xiao's user avatar
0 votes
1 answer
20 views

How to get line fits from sinter.plot_error_rate to calculate logical error rate as function of physical

I would like to print the gradient and intercept values for the line fits generated by sinter.plot_error_rate. My goal is that I'm trying to find logical error rate as a function of physical error ...
drumadoir's user avatar
0 votes
1 answer
42 views

Can we get which error mechanisms acutually happens in Stim?

I'm working on making some decoders for surface codes. I know there is a great stabilizer simulator, Stim, so I try using it. Now, I have a question: can we get what type of error mechanisms actually ...
orclecle's user avatar
1 vote
1 answer
59 views

How to convert stim encoder circuit to a parity check matrix?

I would like to take an encoding noiseless circuit and output the corresponding parity check matrix in the the binary symplectic format $(H_x | H_z)$ I'm aware of the related question: How to get ...
tomek's user avatar
  • 25
1 vote
1 answer
79 views

How to properly generate circuit measurement results from detector error model

I'm reading the paper of Google's neural network decoder for surface code, and I'm confused about how to generate the measurement results for pre-training dataset. If I understand it correctly, the ...
Inm's user avatar
  • 429
1 vote
1 answer
49 views

How to decompose pauli operator into the product of stabilizers in stim?

In stim, is there an easy method to decompose a Pauli operator into a product of stabilizers in the group $\langle S \rangle$? I can achieve this by performing Gauss-Jordan elimination manually, but I ...
Inm's user avatar
  • 429
2 votes
0 answers
70 views

Stim error when measuring detectors

I am attempting to compute the circuit for the syndrome extraction of the [[144, 12, 12]] code using stim so as to consider circuit-level noise. Unfortunately, when trying to obtain the detector error ...
Antoni de Marti 's user avatar
1 vote
1 answer
31 views

feedback based on multiple measurments

I know that Stim has the option to play a conditioned pulse based on a previous measurment by writing CZ rec[-1] 1 which does a Z gate on qb1 if the last measurment ...
QEC_wizard's user avatar
1 vote
1 answer
49 views

Get the amplitude of a computational basis in stim

How can I get the amplitudes of a specific computational basis state in stim? I have looked into the stim.TableauSimulator which has a method ...
Inm's user avatar
  • 429
1 vote
1 answer
44 views

Sample detection events with TableauSimulator

I've been manually driving stim.TableauSimulator to simulate more complex noise models like in a previous post. The way I've set up my code is to replace instances ...
jfids's user avatar
  • 13
3 votes
1 answer
74 views

How to apply rotation about X and Z in stim?

I have a quantum circuit illustrated in the provided image, where I perform a series of quantum operations followed by a projective measurement.. Using Qiskit, I've already written the code for this ...
Manna's user avatar
  • 31
1 vote
1 answer
70 views

Whether/How can I combine logical error rates of the same circuit from different batches of samples in stim

Using one seed to generate one batch of sample and then compute the logical error rate is obviously statistically safe. But in case I want to sample one small batch at a time, how can I configure the ...
Jiakai Wang's user avatar
0 votes
1 answer
54 views

Use stim to simulate multiple different circuits with `shots=1` for each circuit

It is blazingly fast to sample a lot of shots from a single circuit with stim. However, I want to sample a singe shot for lots of different circuits(circuit strings)...
Inm's user avatar
  • 429
2 votes
1 answer
71 views

What is OBSERVABLE_INCLUDE in Stim and what is usefulness Pymatching

I have a question about the role of OBSERVABLE_INCLUDE within Stim circuits and how Pymatching uses it in order to decode syndromes. As far as I have understood from the documentation, ...
Antoni de Marti 's user avatar
0 votes
1 answer
46 views

Implementing a simple time-correlated error model in Stim

I'm aware Stim doesn't have the best capability for sampling arbitrary time-correlated errors. I was wondering what would be the best way to hack together the basic error model: Before each round, ...
jfids's user avatar
  • 13
0 votes
1 answer
89 views

How to use surface codes on a quantum circuit?

So far, I have used surface codes on Stim simulations only. The simulation is for a surface code and I want to understand how surface codes work when I comes to quantum circuit. How is this done for a ...
Avimita Chatterjee's user avatar
1 vote
1 answer
102 views

Y observable from surface code in Stim

I understand that, in the surface code, it is generally harder to measure $Y_L$ compared to $X_L$ or $Z_L$, and code deformations are generally required. However, is there an easier way to calculate ...
jchadwick's user avatar
  • 389
0 votes
0 answers
54 views

Why does Stim/PyMatching evaluate the threshold error rate differently for even and odd distances?

For the toric code, the threshold error rate value for no measurement errors should be around $p_{th}\approx 0.109$. If simulated with even distances, one finds that this is true. However, when I ...
JoJo P's user avatar
  • 179
0 votes
1 answer
49 views

How can we know the expected value of data errors in Stim?

In Stim, after performing syndrome measurements circuit using stabilizer codes like surface codes, how can we know the expected value of errors occurring on each data qubit? Even if there are no ...
david's user avatar
  • 61
3 votes
1 answer
126 views

Simulating erasures with stim

We're trying to simulate erasure errors on the surface code using Stim. The threshold for erasure errors on the data qubits (after initialization) is 50%. We followed the following post: How do I ...
MystMan's user avatar
  • 31
2 votes
1 answer
73 views

Efficiently computing weight enumerators of quantum codes

Are there any packages that efficiently compute weight enumerators (and dual weight enumerators) of quantum error correcting codes? I'm interested in a general method that works for both stabilizer ...
Ian Gershon Teixeira's user avatar
1 vote
1 answer
62 views

Why does adding a 50/50 Z error after every initialization, reset and measurement account for randomness of outcomes in Stim?

Stim generates multiple (say N many) noisy samples by first collecting one reference sample, then running a Pauli frame simulator N times to track which errors may flip which measurements and ...
Antal Szava's user avatar
1 vote
0 answers
129 views

How to get parity check matrix from a circuit in stim

I am working on QECC and, differently from classical ECC where everything is generally described by the parity-check matrices, QECC generally involves the low-level description of the circuit instead, ...
yoyoc's user avatar
  • 11
2 votes
2 answers
95 views

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 ...
QEC beginner's user avatar
0 votes
1 answer
40 views

About detectors after final round of surface code

Stim's surface code implementation example includes additional detectors after the final round to measure data qubits. ...
surface_code_beginner's user avatar
1 vote
1 answer
72 views

How to run Color code on STIM?

I am trying to simulate color code on STIM. I have provided my code below. But I am getting the following error ...
Subrata Das's user avatar
0 votes
1 answer
30 views

How to pass multiple arguments to sinter plot --filter_func?

I'm using stim and sinter and can't figure out how to pass multiple arguments to sinter plot --filter_func. A single argument works as ...
drumadoir's user avatar
2 votes
1 answer
38 views

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 ...
kong's user avatar
  • 21
1 vote
1 answer
56 views

Effect of too many syndrome measurement cycles on surface code threshold

Assume I have a surface code with distance $d$ and an i.i.d error model with both single qubit depolarization and measurement errors, both with probability $p$. In this case, one usually repeats the ...
Yaron Jarach's user avatar
0 votes
1 answer
35 views

Emulating repetition code data subsampling

In google's repetition code memory experiment, they use the subsampling technique to reduce the experimental burden of acquiring data and enforce the self-consistency in error rates. When I use ...
Inm's user avatar
  • 429
1 vote
1 answer
133 views

Simulating a small distance surface code with individual qubit addressing

I want to simulate a small-distance surface code with either STIM or Qiskit. I want individual control over all the qubits (including the ancillas) to induce controlled errors in my circuit. I want to ...
Aubrey Sharansky's user avatar
-1 votes
1 answer
35 views

Node num_detectors + 1 in detector_error_model_to_pymatching_graph

I understand that the node num_detectors is the boundary node, but what's the use of node num_detectors + 1? The code is from the honeycomb boundary paper. What are spandrels? ...
Jiakai Wang's user avatar
-1 votes
1 answer
35 views

PAULI_CHANNEL_2 decomposition with zero prob for single qubit cases

Why does the code associated with the paper "Benchmarking the Planar Honeycomb Code" set some PAULI_CHANNEL_2 errors to tiny values? ...
Jiakai Wang's user avatar
1 vote
1 answer
84 views

Intuition behind Stabilizer Tableau Simulation in Stim

I'm looking through section 4 of the Stim Paper and am having trouble understanding two points: Why is it okay to insert Hadamards and random Xs at the beginning of computation and Hadamards? In the ...
C. Kang's user avatar
  • 1,684
0 votes
1 answer
159 views

Zx graphs in Stim

It is possible to create an ASCII graph in Stimzx for a ZX calculus diagram. I would like to create something like this but I cannot seem to recreate the correct ASCII format. When I do something ...
Mark's user avatar
  • 38
1 vote
3 answers
155 views

Why is the error propagation by the CNOT gate considered without taking into account the state?

In the syndrome measurement circuit of a stabilizer code, I think you would consider that Pauli errors propagate through the CNOT gates. I don't understand why one usually considers the propagation of ...
lassel's user avatar
  • 31
1 vote
2 answers
89 views

Inbuilt Stim circuits showing unexpected Memory X and Memory Z logical error rates for unrotated surface code

When running memory experiments using Stim’s inbuilt unrotated surface code circuits to generate thresholds, I am getting the opposite behaviour to the rotated surface code for memory X and memory Z ...
drumadoir's user avatar
2 votes
0 answers
27 views

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) ...
mbejan's user avatar
  • 21
0 votes
1 answer
76 views

Commutation relationship and measurement results

There are things I do not understand about the following circuit, and I would appreciate it if you could explain. ...
david's user avatar
  • 61
0 votes
1 answer
47 views

Inverted memory X and memory Z logical error rates for unrotated surface code in Stim?

The circuit which measures a Z-type stabilisers in the surface code is: whereas for X-type stabilisers it's: Both types of stabilisers are measured in a memory experiment in the inbuilt surface code ...
drumadoir's user avatar
0 votes
1 answer
58 views

Handling lots of data points in Sinter Graphing

Sinter is really awesome for streamlining my circuit runs. It was incredibly easy to set up and switch into, and it's very fast. The save_resume_filepath is a life ...
buzzword12's user avatar
1 vote
0 answers
122 views

Correctability of X, Y, and Z Errors in Quantum Surface Codes and Color Codes

In surface codes and color codes, when the code distance is $d$, you can correct up to $[(d-1)/2]$ Pauli errors. I would like to know what this $[(d-1)/2]$ Pauli errors means for $X$, $Y$, and $Z$. ...
david's user avatar
  • 61
1 vote
0 answers
123 views

Stim: Implementing lattice surgery

This is an understanding check more than an actual question. Implementing lattice surgery has already been discussed on the forum: How to implement lattice surgery in stim? -- I'm just trying to make ...
control freak's user avatar
0 votes
1 answer
47 views

Sinter: save detection counts

Is there a way to extract all detection events (for each detector individually) that occur during a sinter.Task/sinter.collect ...
jchadwick's user avatar
  • 389
0 votes
1 answer
149 views

What's hook error in surface code?

this line of c++ in surface code generation says: // Define interaction orders so that hook errors run against the error grain instead of with it. So how does the interaction orders in surface code ...
Jiakai Wang's user avatar
0 votes
1 answer
105 views

How to resolve ValueError: The circuit contains non-deterministic observables

I constructed a part of the syndrome measurement circuit as follows using Stim. However, when I run dem = circuit.detector_error_model() and ...
lan's user avatar
  • 51
2 votes
1 answer
112 views

Are there qiskit or stim examples of how to decode a subsystem code

I can manage decoding a stabilizer code in qiskit and stim. I'd like to try a subsystem code next. For a stabilizer code, all stabilizers commute so simultaneous measurement of these produces ...
unknown's user avatar
  • 1,942
0 votes
1 answer
63 views

Differences in Simulating Syndrome Measurement Circuits with Prepared States : $|0_L \rangle$ vs $|0\rangle^{\otimes n}$

In the syndrome measurement circuit constructed using Stim, is there any difference between simulating with the data qubits prepared in the state $|0_L \rangle$ and simulating with data qubits ...
lan's user avatar
  • 51
1 vote
1 answer
93 views

Modelling correlated measurement errors in Stim

Is there a way to model correlated measurement errors in Stim? I see we can implement correlated Pauli errors, but couldn't find anything for correlated measurement errors.
siddharth dangwal's user avatar