[qec] Share Stim measure-line emission in the emitter module - #540
Conversation
Both builders call stim_emit::emit_measure_line. Single-block memory still chooses MZ or MX. Lattice surgery still passes MZ and keeps its record count. Closing detectors stay in the builder. Checked-in Stim gold stays byte-identical. Refs #473 Co-authored-by: Arnab Ghosh <ag2583@cornell.edu>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| /// Single-block memory passes `MZ` or `MX`. Lattice surgery passes `MZ` and | ||
| /// keeps its own record counter. This function does not reorder or skip an | ||
| /// empty id list: an empty list is `{op}\n`. | ||
| pub(crate) fn emit_measure_line(out: &mut String, op: &str, atom_ids: &[u32]) { |
There was a problem hiding this comment.
Approve. I would merge this slice on b3d6572.
Both builders call stim_emit::emit_measure_line for {op} id id\n. The helper keeps caller order and does not skip an empty list. Single-block memory still chooses MZ or MX from the measure basis, then passes that op. Lattice surgery still passes MZ. Its record counter stays in the builder: after the line, rec_count increases by data_atoms.len(), the same total as the old per-id increments. An empty lattice window still continues before the call.
Closing detectors stay in the single-block builder, after this line. The checked-in Stim gold is not in the diff. The new function has no unwrap or expect. measure_line_keeps_caller_order locks MZ 4 0 4 and an empty MX line.
Title, body, and the commit mention the issue only as Refs #473. They do not use fixes/closes/resolves, and they do not say the issue stays open. This slice does not move closing detectors.
Summary
MZ/MXline intostim_emit::emit_measure_line.MZorMX. Lattice surgery still passesMZand keeps its record count.Refs #473
Test plan
cargo test -p quon_qecincludingstim_structure_matches_checked_in_goldMXlinecargo clippy -p quon_qec --all-targets -- -D warningsnpx @taskless/cli@0.9.0 checkon the changed files