Skip to main content

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
33 views

`predictions` and `fault_ids` in Stim and PyMatching for surface code decoding

When I tried to use Stim and PyMatching to decode errors in a Rotated Planar code, I noticed that, Regardedless of the code distance, predictions.shape, as well as ...
Yuhang Gu's user avatar
0 votes
1 answer
22 views

Effect of rounds in surface-code simulation with Stim

I'm learning Stim with the official tutorial and have a question. I made a small program: ...
Yutaka Hirano's user avatar
1 vote
1 answer
58 views

Projection and inner products in stim

In Stim, is it possible to compute the inner product $\langle\phi|\psi\rangle$ of two stabiliser states $|\phi\rangle$ and $|\psi\rangle$? It seems like this should be possible, since an algorithm to ...
xzd209's user avatar
  • 13
1 vote
1 answer
33 views

How to find the undetected errors for general stabilizer codes in Stim?

In Stim, we use the detectors to track syndrome flips and infer the error pattern. However, the syndrome stays the same if the actual error pattern is a logical operator of the code by coincidence. It'...
user30824's user avatar
1 vote
1 answer
53 views

How does OBSERVABLE_INCLUDE work?

I am trying to simulate the Steane code with circuit level noise using stim. I would like to use pymatching to correct errors. My circuit has detectors but does not include any logical observables to ...
Tomi's user avatar
  • 21
0 votes
1 answer
34 views

What does DETECTORs mean in the example circuit for rotated surface code in Stim?

In Stim, an example circuit for rotated surface code is provided: ...
lan's user avatar
  • 51
0 votes
1 answer
27 views

What is the easiest way to get path graph from Stim?

In Stim, we can get a detector graph with the probability of each error mechanism occurring. Now I want to construct a path graph from the detector graph, which is usually done by Dijkstra's algorithm....
david's user avatar
  • 61
0 votes
1 answer
37 views

Stim - Adding gates to the start of the circuit

Say I have circ = stim.Circuit() circ.append("CX", [0,1]) Now, I want to add a Hadamard to the beginning of the circuit. My current method entails ...
big_qubit's user avatar
1 vote
1 answer
48 views

How to implement circuit-level noise model?

I am currently trying to implement circuit-level noise on some quantum codes. Right now, I can encode the logical qubit by projecting the physical qubits into a +/-1 eigenstate of all the stabilizers ...
Tomi's user avatar
  • 21
0 votes
1 answer
47 views

Can a stabilizer tableau with a single row be updated?

The context for this problem is that I wish to know how logical operators evolve over a circuit that is composed of Clifford gates and single qubit measurements. Note that the measurements may be mid-...
Arsenal_fan's user avatar
0 votes
0 answers
33 views

See error samples in Stim+Pymatching [duplicate]

I have a surface code circuit written in Stim. Following Stim's intro I can use sinter to get logical error rates. I'd like to see what error patterns could lead to ...
Pei-Kai Tsai's user avatar
0 votes
0 answers
51 views

What sinter.plot_error_rate is actually doing with the data?

I don't quite understand what the **sinter.plot_error_rate** function is actually doing. From looking at the code, it seems to perform some kind of binomial fit. I'...
Omprakash Chandra's user avatar
0 votes
0 answers
37 views

detector_error_model with stim

The following code is a simple repetition code (for two qubits and one ancilla) for detecting Z errors: ...
reza's user avatar
  • 11
0 votes
1 answer
40 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
0 votes
3 answers
70 views

Does the threshold estimation of the surface code not need a fault-tolerant setup?

The threshold estimation of the $[[9,1,3]]$ surface code in stim's getting started tutorial extracts the syndromes by having a single ancilla for each stabilizer generator. It is the same setup as in ...
qubitzer's user avatar
  • 747
0 votes
1 answer
36 views

explain_detector_error_model_errors complains "no single circuit error had these exact symptoms"

I am using the explain_detector_error_model_errors() method, unfortunately I am receiving this: ...
edp23's user avatar
  • 11
1 vote
1 answer
29 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
77 views

Calculating the weights of error mechanisms in stim

Suppose we have a very simple stim circuit ...
Feng Pan's user avatar
1 vote
2 answers
65 views

Motivation for simulating multiround syndrome extraction circuits for quantum error correction code

I am a new learner in quantum error correction and I am curious about the motivation for simulating multiround syndrome extraction circuits of quantum error correction code. The purpose for single ...
Chris H's user avatar
  • 13
0 votes
1 answer
32 views

Parallelizing decode_to_edges_array (PyMatching)

I am trying to parallelise the function: matching.decode_to_edges_array() to somewhat batch decode, but I am consistently running into the same problem: ...
edp23's user avatar
  • 11
0 votes
1 answer
53 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
1 vote
1 answer
56 views

Efficiently Generating Expectation Values of Operators Using Stim

I am trying to generate expectation values of operators based on several shots. using the stim library and noticed that it has the option to get the expectation of ...
iknownothing's user avatar
0 votes
1 answer
54 views

stim: enhancing performance measuring Pauli strings without keeping the outcome

I have the following question. If I perform projective measurements of a given (multi-qubit) Pauli string in my TableauSimulator I implicitly perform some Gaussian-...
archxrk's user avatar
  • 45
0 votes
1 answer
35 views

Remove edges from PyMatching matching graph / Copy Matching object

I am simulating a surface code where the edges in the syndrome graph change slightly from shot to shot based on erasures that occur in the circuit (i.e. I have a syndrome graph corresponding to the ...
J Watty's user avatar
  • 13
1 vote
1 answer
54 views

Gates conditional on multiple measurement outcomes

We can apply gates conditional on measurement outcomes using: circ.append("CNOT",[stim.target_rec(-k),target]) Say I want the gate to be applied ...
big_qubit's user avatar
0 votes
0 answers
29 views

Tracking errors per round

I was wondering if there is a way (even if it may be manual than a single function call) to tag bit flips (or phase errors) in qubits in a circuit after each round. For example, suppose I examine the ...
Ulaşcan Sarıca's user avatar
0 votes
1 answer
36 views

Sinter, decode_to_edges_array

Does anyone know if sinter has the capability of decoding to edges array? It's a method in the pymatching. Thanks.
edp23's user avatar
  • 11
0 votes
1 answer
59 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
2 votes
1 answer
94 views

High logical error rates when implementing Lattice Surgery with Stim

I'm facing a strange issue with the logical error rate after implementing Lattice Surgery in Stim. For $d=3$ (I have some custom error annotations in the circuit), ...
control freak's user avatar
1 vote
1 answer
116 views

How to find a set of independent logical operators for a stabilizer code with Stim

As a simple example, say I am studying the stabilizer code with $n=4$ physical qubits and stabilizers $Z_0Z_1Z_2Z_3$ and $X_0X_1X_2X_3$ (I'll be using 0-based indexing throughout). Using Stim, I could ...
Imperishable Night's user avatar
1 vote
1 answer
44 views

Implement parity check gadget using stim

I want to implement the logical $\left|00\right\rangle$ state preparation for $C_4$([[4,2,2]]) code using Stim. And the circuit is as below: I have written a piece of code that seems to be effective: <...
Arkham Yu's user avatar
1 vote
1 answer
73 views

Stim: output decoded/predicted locations of Pauli errors

I created some Stim circuits to do circuit-level noise simulations of some Hyperbolic surface codes, and I was able to recover the thresholds in the literature. The detector error model is good at ...
edp23's user avatar
  • 11
1 vote
1 answer
55 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
  • 39.5k
2 votes
1 answer
72 views

How to convert stim circuit to a detector check matrix and a logical observable matrix?

I would like to output a detector check matrix and a logical observable matrix defined in this paper. I've also learned from the related question: How to convert stim encoder circuit to a parity ...
Qingwei Wang's user avatar
0 votes
1 answer
115 views

How to Use Stim for Noisy Simulation with Adaptive Circuit and Noise Tracking?

I am trying to learn stim to simulate noisy quantum circuits. My goal is to construct an adaptive circuit in which I can add quantum gates one by one and observe the changes in the circuit's check ...
iknownothing's user avatar
0 votes
1 answer
62 views

Does Stim support gates with multiple control qubits?

I want to have a gate with two measurements as its controls. I tried to look for either a straight-forward way: CX rec[-1] rec[-2] 2 or to use a DETECTOR for it, ...
Juval Bechar's user avatar
0 votes
1 answer
146 views

Initialization of surface code into a logical state

I read this nice answer about how to initialize a surface code into a logical state but have a basic question about it. If I take a surface code patch with all physical qubits in the $\vert 0\rangle$ ...
user1936752's user avatar
  • 3,085
1 vote
1 answer
39 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
55 views

What is the reason for qubit indexing in Stim's surface code skipping some indices?

A very silly question perhaps but why does Stim skip certain numbers when it initializes the surface code? For example, a distance 2 surface code has 4 data qubits and 3 ancilla qubits. The Stim ...
user1936752's user avatar
  • 3,085
3 votes
1 answer
129 views

How do I sample from a stim Tableau's stabilizer state?

(Copied from https://github.com/quantumlib/Stim/issues/708) [In stim], is there any way to directly generate the samples starting from a tableau and not a circuit? I understand that the standard way ...
Craig Gidney's user avatar
  • 39.5k
1 vote
1 answer
49 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
76 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
3 votes
1 answer
102 views

Uncertainty of estimates computed by stim/sinter

The sinter.plot_error_rate function handles the plotting of the error rates sampled by sinter. Along with the estimated error rates, it highlights a region within ...
AG47's user avatar
  • 598
2 votes
1 answer
78 views

Precise definition of a DETECTOR in Stim

I would like to check I precisely understand the definition of what a detector does in Stim. Below is my understanding and I am looking for confirmation that I understood correctly. If not, please ...
Marco Fellous-Asiani's user avatar
1 vote
1 answer
69 views

Understanding better the notation DETECTOR(X,Y) rec in Stim

In the tutorial example of Stim, there is a repetition code example. The circuit is the following: ...
Marco Fellous-Asiani's user avatar
0 votes
1 answer
61 views

Understanding how Stim stores measurement records (to be used in detectors)

I am trying to understand the syntax of Stim detector and measurements. Consider the following code (from the official pedagogic example) ...
Marco Fellous-Asiani's user avatar
2 votes
0 answers
49 views

How do I perform an two-qubit erasure error in stim?

I try to simulate two-qubit erasure error by using CORRELATED_ERROR, ELSE_CORRELATED_ERROR, and an ancilla which is mentioned in How do I perform an erasure error in stim?. Then I simulate two-qubit ...
You Chang's user avatar
1 vote
0 answers
61 views

Transversal CNOT implementation on stim

Re: a recent paper on the arXiv, Correlated decoding of logical algorithms with transversal gates (https://arxiv.org/abs/2403.03272). As MWPM (pymatching and stim) cannot handle errors that flip more ...
user avatar
2 votes
1 answer
92 views

Stim - Error Detector Model - Understanding approximate_disjoint_errors and decompose_errors

I am looking for clarification on two arguments for the detector error models used in Stim, appproximate_disjoint_errors and ...
decaf's user avatar
  • 25
1 vote
1 answer
57 views

How to implement a controlled gate in Stim with the following control logic?

I'm trying to implement the $[\![7,1,3]\!]$ Steane code on Stim. My circuit is below: ...
user1936752's user avatar
  • 3,085

1
2 3 4 5