0
$\begingroup$

In Stim, an example circuit for rotated surface code is provided:

surface_code_circuit = stim.Circuit.generated(
    "surface_code:rotated_memory_z",
    rounds=3,
    distance=3,
    after_clifford_depolarization=0.001,
    after_reset_flip_probability=0.001,
    before_measure_flip_probability=0.001,
    before_round_data_depolarization=0.001)

In this circuit, in the first round, the instructions

DETECTOR(0, 4, 0) rec[-4]
DETECTOR(2, 2, 0) rec[-7]
DETECTOR(4, 4, 0) rec[-2]
DETECTOR(6, 2, 0) rec[-5]

are inserted. I think these instructions correspond to the syndrome values of the Z-type stabilizers.

At the end of the circuit, the instructions

DETECTOR(0, 4, 1) rec[-3] rec[-6] rec[-13]
DETECTOR(2, 2, 1) rec[-5] rec[-6] rec[-8] rec[-9] rec[-16]
DETECTOR(4, 4, 1) rec[-1] rec[-2] rec[-4] rec[-5] rec[-11]
DETECTOR(6, 2, 1) rec[-4] rec[-7] rec[-14]

are inserted. I think these instructions correspond to the detectors for measurement errors in the final round of measuring Z-type stabilizers, i.e. time-like boundary nodes in the detector graph.

Now I have two questions:

1. In the middle of the circuit, the instructions

DETECTOR(2, 0, 0) rec[-8] rec[-16]
DETECTOR(2, 2, 0) rec[-7] rec[-15]
DETECTOR(4, 2, 0) rec[-6] rec[-14]
DETECTOR(6, 2, 0) rec[-5] rec[-13]
DETECTOR(0, 4, 0) rec[-4] rec[-12]
DETECTOR(2, 4, 0) rec[-3] rec[-11]
DETECTOR(4, 4, 0) rec[-2] rec[-10]
DETECTOR(4, 6, 0) rec[-1] rec[-9]

are inserted. It looks like these instructions define syndrome values of both X-type and Z-type as detectors. Here, we intend to decode only X errors, so we need detectors for only Z-type stabilizers. I do not understand why both X-type and Z-type detectors are included as detectors.

2. In the rotated surface code, we need space-like boundary nodes in the detector graph, so we should define DETECTORs that correspond to the space-like boundary nodes. It seems that those detectors are not included in the surface_code:rotated_memory_z provided in Stim. Is there a reason of that, or am I misunderstanding something?

$\endgroup$

1 Answer 1

1
$\begingroup$

we intend to decode only X errors, so we need detectors for only Z-type stabilizers

First, because to do otherwise would be cheating at the benchmark.

Second, because no actually they are useful.

In real quantum computations, you essentially always need to protect both the X and the Z observable. You want your benchmarking circuits to look as identical as possible to the real thing. Yes, a memory experiment is an artificially simple situation where you only protect one observable, but taking advantage of that makes your benchmark less representative. For example, it's unfortunately pretty common to see decoder papers report speed numbers that skipped half the problem. This is particularly galling in the context of real time decoding, where speed interacts with accuracy. Sometimes you also see papers cheat by skipping measuring half the stabilizers, so the circuit has totally different performance characteristics (e.g. no hook errors).

The Z basis detectors may not be necessary for protecting X, but they are regardless useful for protecting X. Y basis errors set off detection events in both the X and Z subgraphs, and therefore the Z detectors are hints to the locations of Y errors that can flip the X observable. Correlated decoders that use information from both bases are demonstrably more accurate than ones that don't. In some circuits, such as the superdense color code circuit, achieving the full fault distance requires looking at both bases because hook errors are flagged as measurement errors in the other basis.

In the rotated surface code, we need space-like boundary nodes in the detector graph, so we should define DETECTORs that correspond to the space-like boundary nodes.

You are confusing the number of measurements declared in a detector with the number of detectors set off by error mechanisms. If you look at circuit.detector_error_model(), you will see that there are single-detector error mechanisms during the bulk of the circuit (inside the repeat block). These are the spatial boundary errors.

You can also see the spatial boundary errors in circuit.diagram("match-graph-svg"), as edges pointing outward with no detector at one end. It will be clearer which ones are spatial and which ones are temporal if you increase the distance and number of rounds in the circuit.

$\endgroup$
1
  • $\begingroup$ Thank you. Is it true that the instructions DETECTOR(0, 4, 1) rec[-3] rec[-6] rec[-13] DETECTOR(2, 2, 1) rec[-5] rec[-6] rec[-8] rec[-9] rec[-16] DETECTOR(4, 4, 1) rec[-1] rec[-2] rec[-4] rec[-5] rec[-11] DETECTOR(6, 2, 1) rec[-4] rec[-7] rec[-14] correspond to the detectors for measurement errors in the final round of measuring Z-type stabilizers, i.e. time-like boundary nodes in the detector graph? $\endgroup$
    – lan
    Commented Sep 2 at 12:43

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.