Skip to content

[qec] Share Stim measure-line emission in the emitter module - #540

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/stim-measure-line-9f6a
Oct 1, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/stim-measure-line-9f6a

Conversation

@arniber21

Copy link
Copy Markdown
Owner

Summary

  • Move the final MZ / MX line into stim_emit::emit_measure_line.
  • Both builders call it. Single-block memory still chooses MZ or MX. Lattice surgery still passes MZ and keeps its record count.
  • Closing detectors stay in the single-block builder.
  • Checked-in Stim gold stays byte-identical.

Refs #473

Test plan

  • cargo test -p quon_qec including stim_structure_matches_checked_in_gold
  • Unit test locks caller order and an empty MX line
  • cargo clippy -p quon_qec --all-targets -- -D warnings
  • npx @taskless/cli@0.9.0 check on the changed files
  • Ubuntu and macOS fmt · clippy · build · test
Open in Web Open in Cursor 

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>
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
quon Ready Ready Preview Oct 1, 2026 1:40pm UTC

/// 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]) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cursor
cursor Bot marked this pull request as ready for review October 1, 2026 13:42
@cursor
cursor Bot merged commit 08ec778 into main Oct 1, 2026
22 of 23 checks passed

This branch was successfully deployed

1 active deployment
Preview — b3d65729 Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants