1
$\begingroup$

I am trying to simulate color code on STIM. I have provided my code below. But I am getting the following error

Traceback (most recent call last)
ValueError: Failed to decompose errors into graphlike components with at most two symptoms.
The error component that failed to decompose is 'D9, D18, D27'.

My code:

color_code_tasks = [
    sinter.Task(
        circuit = stim.Circuit.generated(
            "color_code:memory_xyz",
            rounds=10,
            distance=9,
            before_round_data_depolarization=1e-2,
        ),
    )
]

collected_color_code_stats: List[sinter.TaskStats] = sinter.collect(
    num_workers=4,
    tasks=surface_code_tasks,
    decoders=['pymatching'],
    max_shots=10000,
    max_errors=500,
    print_progress=True,
)

I tried to ignore this error by passing ignore_decomposition_failures=True to stim.Circuit.detector_error_model(...). Here is my modified code:

custom_dem = circuit.detector_error_model(
    decompose_errors=True,
    ignore_decomposition_failures=True,
)

color_code_tasks = [
    sinter.Task(
        circuit = stim.Circuit.generated(
            "color_code:memory_xyz",
            rounds=10,
            distance=9,
            before_round_data_depolarization=1e-2,
        ),
        detector_error_model=custom_dem,
    )
]

collected_color_code_stats: List[sinter.TaskStats] = sinter.collect(
    num_workers=4,
    tasks=surface_code_tasks,
    decoders=['pymatching'],
    max_shots=10000,
    max_errors=500,
    print_progress=True,
)

But this time I am getting another ValueError: circuit.num_detectors=300 != detector_error_model.num_detectors=132

How can I solve this issue?

$\endgroup$

1 Answer 1

1
$\begingroup$

The custom detector error model you're giving is from a totally different circuit.

Once you fix that, you're going to run into the issue that the decoder you've chosen (pymatching) can't decode color codes. Unfortunately, as far as I know, there aren't any open source color code decoders out there (nevermind one that can be used with sinter), which is a major obstacle to what you're trying to do.

$\endgroup$
1
  • $\begingroup$ Thank you for your help! $\endgroup$ Jul 22, 2023 at 20:52

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.