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
0 answers
4 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
58 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
0 votes
1 answer
28 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
0 votes
0 answers
13 views

Computational basis absolute value coefficient of stabilizer state in STIM [duplicate]

Given a stabilizer state $|\psi\rangle$, I write it in the computational basis $|\psi\rangle = \sum_{n=0}^{2^N-1} c_n |n\rangle$. I was wondering if there is a way to compute the exact $|c_n|^2 = \...
archxrk's user avatar
  • 43
1 vote
1 answer
35 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
27 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
28 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
  • 37.1k
2 votes
1 answer
54 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
36 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
38 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
59 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
  • 2,925
1 vote
1 answer
31 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
45 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
  • 2,925
3 votes
1 answer
73 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
  • 37.1k
1 vote
1 answer
39 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
57 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
60 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
  • 476
1 vote
1 answer
49 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
52 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
38 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
1 vote
0 answers
33 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
51 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
53 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 ...
Maxwell Poster's user avatar
1 vote
1 answer
43 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
  • 2,925
0 votes
1 answer
41 views

How should large quantum computers use Clifford simulators like Stim?

High-level architecture question: When we have the ability to do useful quantum computations with plenty of qubits, error correction and fault tolerance, do Clifford simulators still have a role to ...
user1936752's user avatar
  • 2,925
1 vote
1 answer
45 views

Matching graph from "surface_code:rotated_memory_x" diagonal edges in time?

I was plotting the matching graph from the quantum memory experiment (surface_code:rotated_memory_x) with the circuit diagram command from stim, ...
user avatar
1 vote
1 answer
61 views

Are qubits initialized in $|0\rangle$ by default in Stim?

It is probably a silly question, but are qubits always initialized in $|0\rangle$ when we implement circuits in Stim? I am just using the introduction tutorial, and it seems to be the case, given the ...
Marco Fellous-Asiani's user avatar
1 vote
1 answer
59 views

How can fault tolerance be understood from the perspective of detecting regions in a circuit?

The language of detectors and detecting regions in the context of quantum error correction is introduced in https://arxiv.org/pdf/2302.02192.pdf. Detecting regions seem to be capable of specifying ...
Ezequiel Rodriguez Chiacchio's user avatar
1 vote
1 answer
36 views

I am getting an error on STIM: An error case in a composite error exceeded that max supported number of symptoms (<=15)

I tried putting some ELSE_CORRELATED_ERROR on my custom made surface code circuit and I am getting this error while counting logical errors. What does it mean? And how can I fix it?
Omprakash Chandra's user avatar
2 votes
1 answer
52 views

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 $...
jfids's user avatar
  • 47
3 votes
1 answer
77 views

Measuring observables in the $[\![5,3,1]\!]$ code with stim

Background This question was triggered when I wanted to learn about stim and how to use it to run simulations for error correction. The resources I used for learning about stim were basically Craig ...
Vincent's user avatar
  • 31
0 votes
1 answer
39 views

Why logical X_L measurements for planar code seems to be non-deterministic in stim

I have defined a stim circuit for distance 3 planar code in stim. Now as the vertical line is supposed to be the logical X operator, I defined the logical observable as ...
Mainak Bhattacharyya's user avatar
3 votes
1 answer
153 views

What is the best way to parallelise processes across multiple cores when computing logical error rates with Stim and PyMatching?

I am currently trying to compute logical error rates for the surface code using Stim's detector error models and PyMatching for different distances and noise strengths. tl;dr : What is the best ...
Ezequiel Rodriguez Chiacchio's user avatar
2 votes
1 answer
43 views

How to track back which error occurred during DEPOLARIZE mechanism in a stim circuit

Suppose I create a circuit, which applies depolarizing error to a single qubit with probability 0.04. ...
Mainak Bhattacharyya's user avatar
0 votes
1 answer
35 views

Sequential circuit sampling with properties of previous circuit round fixed

step 1: Define a quantum circuit of type: stim.circuit() This circuit measures some qubits. I use ...
Mainak Bhattacharyya's user avatar
1 vote
1 answer
51 views

How can I use surface code measurement data produced with Qiskit to run matching algorithms (e.g. PyMatching)?

I built a complex time-space dependent error model with Qiskit, and I am simulating surface codes with such error model to test their error correction capabilities. Qiskit supplies measurement data as ...
Marzio Vallero's user avatar
0 votes
2 answers
142 views

Simulating any stabilizer code

While simulating any Stabilizer code on STIM do we need an explicit encoding circuit before performing circuit-level noise simulation and error-correction ?
Omprakash Chandra's user avatar
0 votes
1 answer
40 views

Correlated errors in Stim

In Stim, I want to simulate correlated errors having the following behavior: R 0 1 H 0 ERROR_1(p) 0 CX 0 1 ERROR_2(conditioned on ERROR_1) 1 ... The ...
Inm's user avatar
  • 505
-2 votes
1 answer
55 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
75 views

What is the purpose of the "SHIFT_COORDS" command in Stim?

I have been looking at several circuits being generated by Stim in the literature, e.g. in https://arxiv.org/pdf/2302.02192.pdf, and I have stumbled upon the operation ...
Ezequiel Rodriguez Chiacchio's user avatar
0 votes
2 answers
144 views

Integrating BPOSD into STIM

Pymatching doesn't seems to be working for Steane's code on STIM. I am wondering is there any other decoder that I could possibly use? I am trying to simulate circuit-level noise in syndrome ...
Omprakash Chandra's user avatar
0 votes
1 answer
91 views

Stim + PyMatching Phenomenological and Circuit-Level Noise simulation seeing logical error rate of 0

I'm trying to simulate surface-like codes under phenomenological and circuit-level noise using stim with PyMatching for the decoding algorithm. I've constructed error correction circuits in stim ...
Itrus's user avatar
  • 1
2 votes
1 answer
53 views

Advantage of backward analysis of a circuit over forward analysis in Stim

I'm trying to understand the theory behind how a Stim Detector Error Model is created from a circuit. It is mentioned in the documentation that during analyzing the errors in the circuit, the circuit ...
curiousquantum's user avatar
1 vote
1 answer
86 views

What is the point of defect diagrams?

Gidney's Understanding Defect Diagrams has been helpful to better understand defect diagrams. The pictures are cool, I'm just struggling to connect them to specific questions we can answer with them. ...
C. Kang's user avatar
  • 1,716
1 vote
1 answer
121 views

Obtaining both $X$ and $Z$ observables for a surface code

I am trying to reproduce the dataset in this paper [arXiv:1705.00857] using Stim. The paper decomposes the errors into a "pure-error", which is any error that generates the observed syndrome,...
lbello's user avatar
  • 11
1 vote
1 answer
85 views

On DEMs in stim

I was looking into the stim library (very new to it) and was wondering if someone who has been using it or has experience with DEMs could explain a little of the following. What exactly are detector ...
Arjo's user avatar
  • 113
0 votes
1 answer
64 views

Post-selection with FlipSimulator

I'd like to use Stim to simulate an error correction protocol that includes entanglement purification. I've seen this post, but I'd prefer not to do post-selection and instead keep in the purification ...
q_bert's user avatar
  • 1
1 vote
1 answer
42 views

Incremental simulation with `stim.DetectorErrorModel`

In Google's neural network decoder paper Appendix A.4.6, they said: By calling the simulator repeatedly with the same seed for increasing numbers of cycles, or through access to the internal ...
Inm's user avatar
  • 505
0 votes
1 answer
48 views

In stim's `CORRELATED_ERROR` docs example, where does the 60% come from? [closed]

I do not see what exactly adds up to 60%.
Tejas Nirantar's user avatar
1 vote
1 answer
67 views

Post selection during hook injection

I was reading the paper about "Cleaner magic states with hook injection"1, which is really cool, and I get technically, but it is unclear in which stages do you perform the post-selection. ...
Yaniv Kurman's user avatar

1
2 3 4 5