2

I am testing a fault tolerant error correction scheme for a quantum error correcting code in the following way:

  1. Construct my circuit (data and ancilla qubits)
  2. Perform a round of error correction (set of projective measurements onto the ancilla qubits)
  3. Apply corrections based on the extracted syndromes
  4. Detect a logical error (by extracting the Pauli Frame and checking if the Pauli String anti-commutes with my logical operators)

I am having trouble with step 4 since I am not sure if stim allows you to extract the final Pauli Frame (as mentioned here: extracting the Pauli error on the data qubits at the end of circuit in stim).

Now, the reason I am asking this question is because the tagged answer is old(er), and also since (looking at other answers here) it seems there might be many ways of doing what I'm trying to do e.g. Tableau Simulation, using a Detector Error Model, etc.

I am trying to build a mental model of using stim properly/trying to find a de-facto way of running experiments like these where I want to use stim ONLY as a PF/circuit simulation tool where I can sample the Pauli Frame i.e. (X,Z) tuples for each data qubit where X(or Z)=1 means qubit has an X error w.r.t. an initial reference state.

Thank you.

ababar
  • 23
  • 2
  • Hi and welcome to Quantum Computing SE. Could you please be more specific on troubles you have? – Martin Vesely Apr 28 '23 at 06:10
  • 1
    Sorry @martinvesely, I didn't see your comment. My trouble was that I couldn't find an API that gave me access to the underlying Pauli Frame. Having this information is useful for developing and testing my experiments. – ababar Apr 30 '23 at 17:27

1 Answers1

1

There's an open issue to expose stim's Frame simulator to the python API, but it's not completed and not actively being worked on at the moment. That's the feature that would enable what you want.

Something to maybe keep in mind is that, on real hardware, you don't get access to this information. Being able to peek at which errors "really" occurred is helpful for learning and debugging, but ultimately in practice things have to be able to work end to end without this information. A more physically grounded approach is to make a circuit that starts and ends with perfect measurements of all observables and stabilizers. Noiseless measurements may be inplausible, but they at least don't imply violations of the Heisenberg uncertainty principle the way extracting the entire error frame does.

Craig Gidney
  • 36,389
  • 1
  • 29
  • 95
  • Yes indeed, but, as you said, this info is really helpful for debugging and development. Btw, if the issue isn’t too complicated, I can pick up the task! – ababar Apr 29 '23 at 07:55
  • @ababar The amount of work is high (~50 methods each tested and documented). The API design complexity is medium. The technical complexity is low; it's nearly all plumbing. – Craig Gidney Apr 29 '23 at 16:40
  • I wouldn't mind taking a stab at this. At the very least it will help me understand the tool better. The ticket doesn't seem to have a lot of details so I'd appreciate it if you could share some more information (filenames, tests, etc) with me:) – ababar Apr 30 '23 at 01:46
  • @ababar I added a bunch of details to the issue. You can email me if you want more guidance. – Craig Gidney Apr 30 '23 at 16:01