Conversation
…ge leakage per pair
ciaranra
force-pushed
the
noise-batched-two-qubit-pairs
branch
from
September 20, 2026 05:58
27fe4e7 to
c6f5c29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #791. Closes #792.
Problem
A two-qubit gate command in a
ByteMessagecan carry several pairs in one flattenedqubitsslice. Three noise models treated such a command as if it held one pair:DepolarizingNoiseModel::apply_tq_faultsandBiasedDepolarizingNoiseModel::apply_tq_faultsdrew one fault and applied it toqubits[0]andqubits[1]only, so every later pair ran noiselessly (Depolarizing and biased-depolarizing noise fault only the first pair of a batched two-qubit command #791).GeneralNoiseModel::apply_tq_faultsiterated pairs but evaluatedhas_leakageand the seepage loop over the whole command, so one leaked qubit removed every pair, healthy ones included (GeneralNoiseModel drops every pair of a batched two-qubit command when any one qubit is leaked #792).The workspace sweep found the same shape in
exp/pecos-eeg/src/noise.rs(UniformNoise::noise_after_gateinjected noise for the first pair only) and in twopecos-neochannels (TwoQubitChannel::handle_after_gate,PerGatePauliChannel::apply_after_gate).Change
Every site now iterates
qubits.as_chunks::<2>()and draws, faults, and judges leakage per pair. A single-pair command is byte-for-byte unchanged, including RNG consumption; the existing pinned-byte tests are untouched and still pass.CCXkeeps its current behaviour (one draw on its first two qubits), pinned by a new test rather than silently changed.Not in this PR
Splitting batched commands per pair inside the
pecos-neorunner was implemented and then reverted: the independent review reproduced that it changes what crosstalk and correlated channels observe. Per-pairSkipGatesuppression in neo needs a batch-preserving design and is tracked as #807.Tests
p2 = 0.5over 32 seeds, followed by a further command to detect RNG-stream drift (engines and neo).CX[(0,1),(2,3)]suppresses only(0,1);(2,3)survives and receives its own noise; seepage is pair-local.Verification
cargo test -p pecos-engines -p pecos-neo -p pecos-eeg --no-fail-fast(1852 passed),cargo clippy --locked ... --all-targets -- -D warningsandcargo fmt --checkon the three crates, all clean.How this was produced
Implemented by OpenAI
gpt-6-astra(Codex CLI 0.154.0) from a task packet written by Claude Fable 5.1 in Claude Code; Claude reviewed every hunk, re-ran all verification itself, and sent findings back for fix rounds. An independent Codex review arm with no access to the implementation session also reviewed the diff. Posted at the maintainer's request.