0
$\begingroup$

I'm trying to simulate error correction with the Floquet Color Code. On the torus, this code has two logical qubits. For efficiency, I'm want to simulate two commuting logical operators at the same time - a product of Pauli Xs along the x direction of the torus and along the y direction. However, I find that the logical error rate for the x direction is different when I simulate the y logical at the same time compared to when I simulate the x logical alone.

The two stim files are available here - note they are identical up to the logical measurement of the y operator at the end and OBSERVABLE_INCLUDE instructions for y. This is the code I'm using to determine the logical error rates:

import stim
import pymatching
import numpy as np

filename = 'x_y_logical.stim' # or 'x_logical.stim'
circ = stim.Circuit.from_file(filename)
shots = 1000000

model = circ.detector_error_model(decompose_errors=True)
matching = pymatching.Matching.from_detector_error_model(model)
sampler = circ.compile_detector_sampler()
syndrome, actual_observables = sampler.sample(shots=shots, separate_observables=True)

predicted_observables = matching.decode_batch(syndrome)
num_errors = np.sum(predicted_observables != actual_observables, axis=0)

log_err_rate = num_errors / shots
print("logical error_rate", log_err_rate)

When run on x_y together the result is approximately [0.189516 0.207379], and for x alone it is [0.197398].

$\endgroup$
7
  • $\begingroup$ The issue is probably that (a) pymatching can't decode color codes, because they aren't matchable and (b) you appear to not be being careful with your sig figs so you may be interpreting random variations as actual differences. Pymatching unfortunately tries its best even when it's clear it can't work so it doesn't warn you about the problem. $\endgroup$ Commented Aug 19, 2024 at 17:34
  • $\begingroup$ Thanks Craig! I think it's indeed an issue with the decoder. I've now tried feeding the decoder created for the x logical alone with the data sampled from the circuit for both logicals (leaving out the y logical samples). This produced the same result as I got from the data sampled from the circuit for the x logical alone ~0.197. $\endgroup$ Commented Aug 19, 2024 at 19:55
  • $\begingroup$ The floquet color code is matching decodable. The name is somewhat confusing, as the code is in the toric code phase. An example of a floquet color code is the honeycomb code. $\endgroup$ Commented Aug 20, 2024 at 7:39
  • 1
    $\begingroup$ Peter, wouldn't that depend on the error model? For example, if I include measurement errors, that would trigger 4 detector events, right? $\endgroup$ Commented Aug 20, 2024 at 10:54
  • 1
    $\begingroup$ @Peter-Jan Oh. Well in that case pymatching should work, assuming the detector error model has suggested decompositions of the measurement errors. $\endgroup$ Commented Aug 23, 2024 at 2:57

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.