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
0 votes
1 answer
31 views

Modifying stim simulator state by resetting the current inverse tableau not working as desired?

My goal is to run the Clifford simulation in stim where I apply Clifford gates (not neccesarily listed in the “named gates” list) e.g., random 2-qubit Clifford gates with tableau given by stim.Tableau....
user avatar
2 votes
1 answer
25 views

Read/Write circuit to file in Stim

I'm trying to save and load large circuits from files in Stim. For example, if I use a generated surface code from the intro notebook ...
user avatar
  • 163
1 vote
1 answer
87 views

How are non-clifford gates simulated in Stim and other simulators?

I know that Clifford gates can be efficiently simulated on classical computers using tableaux. How are non-clifford gates handled? Can simulators handle 100 qubit non-clifford gates?
user avatar
  • 910
0 votes
1 answer
21 views

Within Stim, how to trace back DEM error instructions to Stim circuit faults

If I have a line in a DEM e.g. error(0.001) D0 is there an easy way to see which circuit faults in the original circuit contributed to that error mechanism?
user avatar
  • 197
2 votes
1 answer
32 views

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 ...
user avatar
  • 22.4k
2 votes
1 answer
101 views

How can I apply 2 qubit pauli operator error instead of CNOT operator in stim code?

Currently I am building up quantum error correction code with stim code. According to this paper [https://journals.aps.org/pra/abstract/10.1103/PhysRevA.86.032324], I need to make an error channel ...
user avatar
5 votes
2 answers
204 views

How can I visualize a stim circuit?

Is there any function I can call to visualize a stim circuit?
user avatar
  • 317
0 votes
1 answer
20 views

Is there any implementation in `stim` that takes correlated edges into consideration?

When we decode X/Z graph separately, we didn't consider about the correlation between this two graphs. There are some techniques like reweighting X/Z graphs recursively to explain the correlation ...
user avatar
  • 317
2 votes
1 answer
47 views

Adding dephasing to stim's generated surface code circuits

I'm trying to find the threshold for dephasing error on a surface code. I've used the stim.Circuit.generated("surface_code_unrotated_memory_x") function to generate a surface code lattice. ...
user avatar
1 vote
1 answer
43 views

extracting the Pauli error on the data qubits at the end of circuit in stim

Let's say one implements the following circuit in stim from the stim tutorial: ...
user avatar
  • 113
1 vote
2 answers
46 views

How do I specify the coordinates of dephasing errors in the surface code using Stim

I am trying to find the threshold of a surface code for dephasing error using pymatching and stim. I am unable to apply the Z_ERROR onto the qubits using the given format since a surface code will ...
user avatar
1 vote
2 answers
73 views

Is there any reasonably efficient way of performing qudit circuit simulations using Stim?

Is there any reasonably efficient way of performing qudit circuit simulations using Stim? If so, then how much worse would the computational complexity scale?
user avatar
2 votes
1 answer
51 views

nonlinear behavior of $1/\Lambda$ in surface code simulations around threshold

I am simulating the dependence of $\Lambda$, as defined in google's Exponential suppression of bit or phase errors with cyclic error correction paper as a function of physical error rate. The $\Lambda$...
user avatar
  • 998
2 votes
1 answer
48 views

when calculating code thresholds, why do we need to take a number of rounds that scales with the code distance?

In stim's error corretion example here, and in pymatching's toric code example here, the threshold calculation involves taking a number of rounds that scales as the code distance. Why is that the ...
user avatar
  • 998
2 votes
1 answer
55 views

How do I add an MPP operation to a stim circuit using append_operation?

How should I use the 'MPP' gate with append_operation in stim? For example it's clear from the documentation that circuit.append_operation('MX', [1,2]) will append two X-base measurements on qubits 1 ...
user avatar
  • 22.4k
4 votes
1 answer
67 views

compatibility of stim's error model with conventional decoding schemes

I am working with stim's excellent code generator together with pymatching, using stim's generated error model and the glue code in the tutorial here. I am trying to understand better what the output ...
user avatar
  • 998
3 votes
1 answer
95 views

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 ...
user avatar
  • 317
2 votes
1 answer
69 views

Where do lines like "error(0.00033) D0 D9 L0 ^ D7 ^ D8" come from in a stim detector error model?

I have a Stim detector error model file derived from a surface code circuit. I'm trying to understand exactly what lines like error(0.00033) D0 D9 L0 ^ D7 ^ D8 from ...
user avatar
  • 22.4k
2 votes
1 answer
185 views

Incorporating Idling Errors while using Stim

Is there a smart way to incorporate idling errors for a quantum error correction code using the open-source tool Stim (preferably using the tableau simulator)? I have perused the github website (https:...
user avatar
3 votes
1 answer
49 views

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 ...
user avatar
  • 22.4k
3 votes
1 answer
93 views

Efficient Way to Create an LUT in Stim

What is the fastest and most resource-efficient way to create an LUT decoder for a quantum error correction code using Stim (https://quantum-journal.org/papers/q-2021-07-06-497/)? Specfically, I am ...
user avatar
5 votes
2 answers
158 views

Simulating flag qubits and conditional branches using Stim

In a quantum error correcting code using flag qubits, it's common to have flag measurements that tell you it's necessary to do some extra measurements for safety. So, for example, I want to say: ...
user avatar
  • 22.4k
3 votes
1 answer
49 views

Stim: is it possible to add comments when creating a circuit?

I'm trying to create a Stim.Circuit, given a list of qubits and operations on them. Does the API support adding comments to the circuit's string representation? I've tried using ...
user avatar
2 votes
1 answer
56 views

Measurement bitstrings to detection event bitstrings in stim

Does Stim have exposed functionality for converting a measurement outcome string into a detection event string? I.e. I feed stim a string of 0,1's corresponding to measurements in a circuit along with ...
user avatar
  • 197
3 votes
1 answer
395 views

What is the meaning of "shots" and "rounds" in Stim?

I'm running simulations using Stim to get logical error rate vs. physical error rates of some quantum error correcting codes (QECC). I looked into the documentation, but I'm confused about the meaning ...
user avatar
  • 910
1 vote
1 answer
189 views

how to simulate toric and surface codes with stim + PyMatching

According to PyMatching's github page the package can be decode toric and surface codes. Stim's example uses stim + PyMatching combination to get logical error rate vs physical error rate curves for ...
user avatar
  • 910
3 votes
1 answer
182 views

Computing expectation value of a Pauli string on stabilizer states

I need some help on stim, where I'm trying to compute expectation values of Pauli strings. Hopefully I did not overlook on the documentation an implementation of ...
user avatar
  • 33
2 votes
2 answers
150 views

How to perform encoding and syndrome measurement in stim

I can generate the encoding circuit of a stabilizer code and can read it into stim. For example for the $[[5,1,3]]$ code : ...
user avatar
  • 910
2 votes
1 answer
66 views

What is the syntax for general control gate in stim

For a stabilizer code with the stabilizers in canonical form, an encoding circuit has the form that's a product of hadamard gates and general control gates : $H_i C_i(U_i)$. For example for the $[[5,1,...
user avatar
  • 910
3 votes
1 answer
111 views

How to import a generic stabilizer code in stim

I just started using stim to simulate the performance of quantum error correcting codes. I hope this is the right place to ask questions about the subject. The example code with the repetition code ...
user avatar
  • 910
2 votes
1 answer
161 views

How do I pick a random Clifford operation in Stim?

I want to sample random n-qubit Clifford operations. How do I do that in Stim? (Self-answering because this was requested when the feature already existed)
user avatar
  • 22.4k
4 votes
1 answer
103 views

Performing a generic single-qubit Pauli error channel in stim

I have a Pauli channel with disjoint probabilities $P_I$, $P_X$, $P_Y$, $P_Z$ (meaning $P_I + P_X + P_Y + P_Z = 1$) corresponding to Pauli errors I, X, Y, Z. Is there some way apply this Pauli ...
user avatar
  • 22.4k
7 votes
1 answer
233 views

'Best practices' for making Stim run as fast as possible?

I'm currently testing out an error-correction surface code circuit in Stim. I've tried a 19x19 surface code over 10k rounds of syndrome extraction sampled 256 times, and this takes about 165 seconds. ...
user avatar
  • 197
3 votes
2 answers
375 views

Measuring entanglement entropy using a stabilizer circuit simulator

I'm trying to simulate stabilizer circuits using the Clifford tableau formalism that lets you scale up to hundreds of qubits. What I want to do is find the entanglement entropy on by splitting my ...
user avatar
  • 155