Skip to main content

emit_bloq_stim_segments_pair

Function emit_bloq_stim_segments_pair 

Source
pub fn emit_bloq_stim_segments_pair(
    program: &Bloq,
    noise: &NoiseModel,
) -> Result<(BloqStimSegments, BloqStimSegments), StimEmissionError>
Expand description

Emit the same program twice, clean and with noise, as (clean, noisy).

A Monte-Carlo consumer needs both: the noisy circuit to sample and the clean one to read reference signs and decoder recipes off. Because both come from one call, this guarantees what a caller emitting twice can only assert afterwards — the two share a node order and a measurement layout, so a column resolved against one indexes the other. If they ever disagree the emission is inconsistent and this fails rather than handing back a pair whose indices silently diverge.

§Errors

Anything either emission would return on its own, plus StimEmissionError::MalformedGraph if the two disagree on node order or measurement layout.