Skip to content

[qec] Share Stim reset assembly in the emitter module - #532

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

cursor[bot] merged 1 commit into
mainfrom
cursor/stim-reset-tick-9f6a

Conversation

@arniber21

Copy link
Copy Markdown
Owner

Summary

Partial slice of #473. Both Stim builders call emit_reset_tick in the emitter module for the prepare-R / TICK line. Single-block memory still passes layout order. Lattice surgery still passes the sorted unique id list. The helper does not reorder.

Issue 473 stays open. Headers and observable assembly stay in the builders. emit_stim_lattice_surgery_cx is still a long function.

Behavior

  • Checked-in Stim gold for repetition d=3, surface d=3 (Z and X), and lattice-surgery CX d=3 stays byte-identical.
  • An empty id list still writes R then TICK, matching the previous inline loops.

Out of scope

  • Header comments
  • Observable assembly
  • Shrinking either builder under about 80 lines
Open in Web Open in Cursor 

Both circuit builders call emit_reset_tick for the prepare-R line.
Callers still choose the id list: layout order for single-block memory,
sorted unique ids for lattice surgery. Checked-in Stim gold stays
byte-identical.

Issue 473 stays open. Headers and observable assembly stay in the builders.

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 8:24am UTC

///
/// Single-block memory passes layout order. Lattice surgery passes the sorted
/// unique id list. This function does not reorder.
pub(crate) fn emit_reset_tick(out: &mut String, 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.

Both builders call emit_reset_tick for the prepare-R / TICK line. The helper writes ids in caller order and does not sort or dedup. Single-block memory still passes block.atoms in layout order. Lattice surgery still sorts and dedups before the call. An empty list still writes R then TICK, and reset_tick_keeps_caller_order locks [4, 0, 4] so a hidden reorder would fail.

The diff does not touch the checked-in Stim gold, so repetition d=3, surface d=3 Z/X, and lattice-surgery CX stay byte-identical. This function has no unwrap or expect. The PR body and commit say issue 473 stays open; there is no Fixes/Closes/Resolves keyword.

Headers and observable assembly stay in the builders, on the open issue.

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

This branch was successfully deployed

1 active deployment
Preview — ab3936ad 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