Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
75 views

generating pure errors (destabilizers) by given stabilizer and logical group

Suppose we have a stabilizer code on n physical qubits, with stabilizer group S and assume fixed representatives of the logical operators L. Given this fixed set of generators for S and L, can we ...
reza's user avatar
  • 11
0 votes
1 answer
71 views

Obtaining and Applying XX and ZZ Parity in Stim for Controlled Paulis

I am attempting to perform a CNOT between two surface code qubits in Stim, based on this paper by Daniel Litinski and Felix von Oppen. The CNOT they perform is shown in the figure below (Figure 3 from ...
decaf's user avatar
  • 25
1 vote
1 answer
58 views

having REPEAT with circuit append

In Stim's domain specific language, you can reapetdly add a code clock, as following REPEAT 10 { # code block } Is there a way to add that with ...
reza's user avatar
  • 11
0 votes
1 answer
101 views

What is TICK layer in stim

I'm trying to simulate a circuit in stim and I get the following error in my stack trace. ...
Palash Goiporia's user avatar
0 votes
1 answer
79 views

How to use stim to implement a specific circuit

I'm doing a QEC job, and I want to apply an error like $U_{err}(\theta) = \prod_j e^{-i\frac{\theta_j}{2}P_j} = \prod_j (I\cos(\frac{\theta_j}{2}) - iP_j\sin(\frac{\theta_j}{2}))$, where $\theta_j$ is ...
Yule Su's user avatar
1 vote
1 answer
89 views

How do I extract information from stim.PauliString?

Suppose I have stim.PauliString("+Z_Z_ZZ__"). I want to extract its data information in Python: either as a string ...
Craig Gidney's user avatar
  • 41.9k
1 vote
1 answer
64 views

ValueError: non-deterministic detectors while using Stim to simulate Toric code

I am trying to simulate Toric code using Stim. Below is my simple circuit specification in Stim: ...
Mohammad Alam's user avatar
1 vote
1 answer
71 views

Appending a gate to a Stim circuit in C++

I am trying to use Stim in C++. Until now, most functionality worked as expected. However, I recently tried to construct a Stim circuit in C++ and pass it to Python via ...
Maurice Hanisch's user avatar
2 votes
2 answers
124 views

Why I am continuously getting "failed to decompose hyperedges into edges" in Stim?

I have written a Hypergraph product quantum error correction circuit on Stim. The code is $[\![65,9,4]\!]$. I have put circuit level noise and I am using the sinter ...
Omprakash Chandra's user avatar
-2 votes
1 answer
74 views

Python C++ Debugging Setup for Stim

If I want to build Stim from source so I can use the debugger to step through and better understand the C++ code, is there a recommended setup? Is there a way to compile/debug only the C++ portion of ...
user27946's user avatar
1 vote
1 answer
103 views

Using stim.TableauSimulator with python multiprocessing

I am trying to run some Monte-Carlo simulations whereby I have to call the TableauSimulator N times and use the measurement results to get an average. Is there any way to parallelise this loop? I am ...
Q W's user avatar
  • 11
1 vote
1 answer
164 views

Seeding a stim.TableauSimulator

When creating a sampler from a stim.Circuit (say, for example, using stim.Circuit.compile_sampler), one can provide a ...
user21806's user avatar
1 vote
1 answer
235 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?
squiggles's user avatar
  • 1,060
5 votes
2 answers
1k views

How can I visualize a stim circuit?

Is there any function I can call to visualize a stim circuit?
Inm's user avatar
  • 535
1 vote
2 answers
172 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 ...
Ruchi Pendse's user avatar
1 vote
2 answers
351 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?
MatthewS1990's user avatar
5 votes
1 answer
647 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 code repository, as ...
MatthewS1990's user avatar
3 votes
1 answer
192 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 ...
MatthewS1990's user avatar
6 votes
2 answers
570 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: ...
Craig Gidney's user avatar
  • 41.9k
3 votes
1 answer
143 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 ...
user18859's user avatar
3 votes
1 answer
187 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 ...
squiggles's user avatar
  • 1,060
3 votes
1 answer
640 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 ...
unknown's user avatar
  • 2,252
4 votes
1 answer
680 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 ...
archxrk's user avatar
  • 45
2 votes
2 answers
912 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 : ...
unknown's user avatar
  • 2,252
2 votes
1 answer
145 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,...
unknown's user avatar
  • 2,252
4 votes
1 answer
563 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 ...
unknown's user avatar
  • 2,252
4 votes
1 answer
664 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)
Craig Gidney's user avatar
  • 41.9k
4 votes
1 answer
390 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 ...
Craig Gidney's user avatar
  • 41.9k
7 votes
1 answer
617 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. ...
squiggles's user avatar
  • 1,060