0
$\begingroup$

I'm trying to simulate a circuit in stim and I get the following error in my stack trace.

ValueError: Failed to decompose errors into graphlike components with at most two symptoms.
The error component that failed to decompose is 'D1368, D1369, D1424'.

In Python, you can ignore this error by passing `ignore_decomposition_failures=True` to `stim.Circuit.detector_error_model(...)`.
From the command line, you can ignore this error by passing the flag `--ignore_decomposition_failures` to `stim analyze_errors`.

Circuit stack trace:
    during TICK layer #773 of 931
    at instruction #1156 [which is a REPEAT 11 block]

What is the TICK layer referring to here? Also, could someone explain to me what the ValueError message is saying? Thank you!

$\endgroup$

1 Answer 1

1
$\begingroup$

In Stim, TICK is an instruction that does nothing except indicate the passage of time. Conceptually, ticks split the circuit up into steps. Ticks have no effect on simulations, but are very useful for other purposes. For example:

  • A function adding noise annotations to a circuit can use TICK instructions as a signal to insert errors related to idling.
  • A function creating a diagram of a circuit can use TICK instructions to divide the diagram into steps, instead of drawing one big ball of operations.
  • An error diagnostic can say the TICK closest to a problem.

could someone explain to me what the ValueError message is saying?

The error message is saying that you asked for errors to be decomposed into graphlike pieces, but it can't figure out how to do that. Probably the 3 listed symptoms always come together, never as just 1 or 2, so it's impossible to tell if one is safe to separate from the others without breaking some important invariant (like color conservation in the color code). Typically you'd fix this by correcting a detector declaration, or by not passing decompose_errors=True if you're not using a graphlike code, or by passing ignore_decomposition_failures=True to just YOLO forward.

What is the TICK layer referring to here?

The TICK part of the message is telling you roughly where the problem is happening by telling you how many TICK instructions were executed in the circuit before running into the problem. You can use this information to debug the problem.

The error message says the problem is near TICK 773 and involves detectors D1368 D1369 D1424. For example, you can use this with stim.Circuit.diagram. Running

circuit.diagram(
    "detslice-with-ops-svg",
    tick=range(770, 790),
    filter_coords=["D1368", "D1369", "D1424"],
)

should give you an SVG image of what's going on with those three detectors at that time.

$\endgroup$
2
  • $\begingroup$ This is super helpful, thank you so much! Quick follow up, how do I specify the size of the image being generated. I have a circuit with ~300 qubits, so it generates something impossible to read. $\endgroup$ Commented May 28 at 16:30
  • 1
    $\begingroup$ @PalashGoiporia It's an SVG image so you can just zoom in indefinitely. Make sure you've specified QUBIT_COORDS in the circuit, to help it use a reasonable layout. You can look at the other diagram types, or methods like stim.Circuit.detecting_regions, to get other views of the information. $\endgroup$ Commented May 28 at 17:33

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.