Repository navigation
[qec] Route single-block memory Stim through StimRoundEmitter - #529
Conversation
emit_stim_single_block_memory walks the schedule with the same lattice_round_emitter registry. Construct, memory, and measure-logical use emit_single_block. Surgery-only kinds stay silent on this path. Checked-in Stim gold stays byte-identical. Issue 473 stays open. The single-block builder is still about 155 lines because the header, reset, and observable assembly stay in place. Co-authored-by: Arnab Ghosh <ag2583@cornell.edu>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| emit_local_ops(&mut ctx.out, &prep); | ||
| } | ||
| for round in &expanded.rounds { | ||
| stim_emit::lattice_round_emitter(round.kind).emit_single_block(&mut ctx, round)?; |
There was a problem hiding this comment.
Approve. I would merge this slice.
The schedule walk calls StimRoundEmitter::emit_single_block on the impl lattice_round_emitter returns. MemoryRoundEmit writes the MR line and detectors; ConstructEmit emits the first construct's locals and skips a later one; MeasureLogicalEmit records the first round and does not emit MZ here. Surgery-only kinds keep the trait's empty default, which is what this builder already did.
stim_structure_matches_checked_in_gold still locks repetition d=3, surface d=3 Z/X, and lattice-surgery CX. New tests cover one-shot construct, the first memory-round detector line, measure-logical recording, and silent surgery kinds. The new library code has no unwrap or expect outside #[cfg(test)]. The PR body and commit say issue 473 stays open; there is no Fixes/Closes/Resolves keyword.
Left on 473: this function is still 154 lines because the header, reset, X-init fallback, and observable assembly stay here, and emit_stim_lattice_surgery_cx is still over 80 lines.
Summary
Partial slice of #473.
emit_stim_single_block_memorynow walks the schedule through the sameStimRoundEmitterregistry as lattice surgery. Construct, memory, and measure-logical implementemit_single_block. Surgery-only kinds stay silent on this path, which is what the single-block builder already did.Issue 473 stays open. The single-block builder is still about 155 lines: the header, reset, and observable assembly stay there.
emit_stim_lattice_surgery_cxis unchanged and still over 80 lines.Behavior
MZ/MX, closing detectors, andOBSERVABLE_INCLUDEstill run after the walk. The measure-logical impl only records the first round.Out of scope