2
$\begingroup$

I would like to simulate the rotated surface code using stim for various code sizes. For my application, I would like to know where the stabilizers are located.

What is the meaning of the coordinates provided by stim? Is it (X, Y, time)? If so, how is the code orientated? Ideally, I would like to have a function that maps between the stim coordinates, and the distance to the western (weight-2 Z stabilizer) and northern (weight-2 X stabilizer) boundary for different code sizes.

I guess one could figure that out by studying the circuit diagrams. I would be happy to have a faster solution, such as the following figure picturing the surface code together with the stim coordinates:

enter image description here

Thanks for your help!

$\endgroup$

2 Answers 2

2
$\begingroup$

Originally, Stim itself imposed no meaning on the coordinate data. As far as stim is concerned, the coordinates are arbitrary opaque numbers that have no effect on the simulation and could mean anything. For example, in the color code, perhaps one of the coordinates could be the red/green/blue coloring of stabilizers. Some circuits won't even have any coordinates at all.

Since diagrams were added, there is definitely a stronger sense that these are spatial coordinates, as the diagrams use them that way. But this is still strictly speaking not required to be the interpretation of the numbers.

Based on the image you included in your question, I'm assuming you're looking specifically at the circuits from 'Data for "Suppressing quantum errors by scaling a surface code logical qubit"'. In those specific circuits, the first two coordinates are X/Y coordinates. The qubits only have those two. Detectors have a third coordinate which is a time coordinate.

$\endgroup$
2
  • $\begingroup$ Thanks Craig. Actually, I'm not interested in the google data, the purpose of the figure was to illustrate the mapping I need: A picture/function (whatever) that translates coordinates (or qubit indices, if you like) generated by stim.Circuit.generated("surface_code:rotated_memory_z(x)") to a representation from which I can deduce the location and type of each stabilizer for various code sizes. Is there a way to plot the qubit indices (coordinates) in a stim diagram? $\endgroup$ Mar 24, 2023 at 7:58
  • $\begingroup$ @MoritzLange there isn't an option to annotate the numbers, though they are used to position things $\endgroup$ Mar 24, 2023 at 14:40
2
$\begingroup$

I figured it out, for anyone interested:

The coordinates are (distance from western boundary, distance from northern boundary) for a rotated surface code with a weight-2 X-stabilizer in the north-westernmost corner. The qubit indices run in a zig-zag order from left to right and from top to bottom, like in the following example for d = 5:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.