Make two-qubit gate leakage suppression and seepage pair-local in the general noise model - #671
Open
ciaranra wants to merge 1 commit into
Open
Make two-qubit gate leakage suppression and seepage pair-local in the general noise model#671ciaranra wants to merge 1 commit into
ciaranra wants to merge 1 commit into
Conversation
… general noise model
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.
Summary
GeneralNoiseModel::apply_tq_faultsprocesses a batched two-qubit gate pair by pair, but two decisions inside that loop looked at the whole gate instead of the current pair:Both are now scoped to the pair being processed. For a gate with a single pair, behavior and RNG consumption are unchanged.
Behavior change
Seeded output changes for batched two-qubit gates (more than one pair in one gate) when at least one qubit is leaked: unaffected pairs now execute and sample noise as they would as standalone gates, and each leaked qubit gets exactly one seepage attempt at its own pair site. Single-pair gates reproduce their previous byte stream, pinned by a captured-bytes test.
Tests
tq_leakage_only_removes_the_affected_pair: a leaked qubit in pair[0, 1]no longer suppresses theCZon[2, 3].tq_emission_and_seepage_are_pair_local: the batched call reproduces the operations and the subsequent RNG stream of driving the same seeded model pair by pair.tq_seepage_scan_is_pair_local: with leaked qubits in both pairs, each gets one seepage attempt; reverting only the seepage loop makes this test fail on the RNG stream.single_pair_tq_leakage_keeps_captured_legacy_bytes: single-pair output is byte-identical to the previous implementation.The first three fail on the previous code; the fourth passes on both by design.
Verification
cargo test -p pecos-enginescargo clippy -p pecos-engines --all-targets --all-features -- -D warningscargo fmt -p pecos-engines -- --checkContext
First of the separable changes ahead of the state-transition noise channel work; that work's compatibility fixture will be captured after this lands.