Skip to main content

emit_annotated_stim

Function emit_annotated_stim 

Source
pub fn emit_annotated_stim(
    circuit: &CoordCircuit,
    detectors: &[Vec<u32>],
    observables: &[(u32, Vec<u32>)],
) -> Result<String, StimVerifyError>
Expand description

Emits a flat coordinate circuit as standalone Stim text.

Trailing DETECTOR and OBSERVABLE_INCLUDE lines resolve circuit measurement ids to record lookbacks in emission order.

This is the escape-template distance-test entry point: restart parities are emitted as ordinary DETECTOR lines — msc-ls-faithful, since its .stim output carries every post-selected parity as a plain detector and keeps the post-selection index list on the Python side. Loop bodies are unsupported (resolve_measurement fails on unemitted ids); the T-block templates are all flat Single chunks.

§Errors

Returns StimVerifyError if circuit emission or measurement resolution fails.