Prototype: composable transition and Pauli-leakage noise channels - #518
Draft
qciaran wants to merge 3 commits into
Draft
Prototype: composable transition and Pauli-leakage noise channels#518qciaran wants to merge 3 commits into
qciaran wants to merge 3 commits into
Conversation
qciaran
force-pushed
the
general-noise-transition-channels
branch
from
August 14, 2026 22:45
e3c2276 to
d0a346a
Compare
qciaran
force-pushed
the
general-noise-transition-channels
branch
from
August 17, 2026 15:58
d0a346a to
4acff9e
Compare
qciaran
force-pushed
the
general-noise-transition-channels
branch
4 times, most recently
from
August 18, 2026 15:13
93db595 to
447257c
Compare
qciaran
force-pushed
the
general-noise-transition-channels
branch
from
August 20, 2026 01:52
447257c to
2a91c37
Compare
qciaran
force-pushed
the
general-noise-transition-channels
branch
from
August 20, 2026 15:12
2a91c37 to
3ee36aa
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.
{0, 1, L}state space{I, X, Y, Z, L}GeneralNoiseModelBuilderhooks0L -> L0andXL\n- support coherent*L/L*identity-wire rules that act on one gate leg without measuring or resolving the other*for tensor products and replace the old p2 gate-replacement spelling with~XXor:replace:XXChannel model
Conditional state transitions
TransitionChannel(p, transitions)represents a stochastic population map. Rows are conditioned on the incoming effective state and each nonempty row is normalized independently:The outer
pis the probability that the channel is considered. Conditional rows describeP(output | input)and therefore do not share one global relative-weight normalization. Missing input rows are identity rows. This naturally represents state-dependent leakage, seepage, bit-state transitions, and mixed recovery. PECOS consumes any internal population measurement; it is not returned as a program measurement.\n\nFor factorized two-qubit transition maps,*in the same source and destination position is a coherent identity wire. For example,\"*L\": {\"*0\": 0.45, \"*1\": 0.45, \"*L\": 0.10}acts only on the second leg.*LandL*rules may coexist and both apply toLLunder the channel's shared outer coin; wildcard legs never become computational measurement dependencies.Pauli plus leakage
PauliLeakageChannel(p, events)is the familiar overall-error-probability plus relative-event-weight model:The event weights are normalized as one conditional distribution and need not sum to one. Identity is implicit when the outer coin fails, so users do not need an
I: 0.999entry.Lmeansany -> L; Paulis act only in the computational subspace. Joint two-qubit events such asIX,XL, andLLare supported.Both families model fixed stochastic mixtures of trace-preserving component maps on the effective qutrit space, rather than exposing arbitrary Kraus operators. Leakage events use the existing leakage machinery and follow
leakage_scale; channel outer probabilities follow the global and p1/p2 scale factors.Composition and placement
Single-qubit dictionaries/channels use
*for tensor products and@for transition-channel composition. The p2add_*_transition_channel_{before,after}_gatemethods accept either aTransitionChannel(applied independently to both legs) or aTwoQubitTransitionChannel(applied jointly) directly. An explicit two-qubit step is only needed for different first/second-leg channels or mixed step lists. Multiple channels/steps can be installed at every hook and run in insertion order.At a gate site the fixed cross-family order is:
That ordering lets a transition channel recover leakage introduced by an earlier Pauli-plus-leakage channel at the same hook. Existing
GeneralNoiseModelbehavior is unchanged when the new channel lists are empty.Python surface
The following are exported from both
pecosandpecos_rslib.noise:TransitionDict,TransitionChannel,TwoQubitTransitionChannel,P2TransitionStepPauliLeakageDict,PauliLeakageChannel,TwoQubitPauliLeakageChannel,P2PauliLeakageStepThe Rust and Python builders provide matching
with_*andadd_*methods for before/after p1 and p2 sites. The user guide includes construction, conditional-probability, composition, and ordering examples.QEC replacement-label syntax
Plain
p2_weightslabels such asXXremain post-gate Pauli branches. Replacement branches use either~XXor the equivalent:replace:XX;~II/:replace:IIomits the ideal gate without applying a Pauli. The former*XXspelling is rejected with a migration hint, leaving*with the consistent tensor-product meaning in the new channel APIs.Validation
just lint(full workspace strict Clippy and pre-commit checks)cargo test -p pecos-engines(unit, integration, normal rustdoc, and compile-fail rustdoc tests)cargo clippy -p pecos-engines -p pecos-rslib --all-targets -- -D warningspecosandpecos_rslib.noiseexport smoke testsgit diff --checkFollow-up
The Selene PECOS wrapper does not yet expose these
GeneralNoiseModelchannel stacks. Wrapper integration can follow after the core API is reviewed.