Implement amplitude damping noise model (closes #497)#525
Open
Vinny010 wants to merge 1 commit into
Open
Conversation
Add amplitude damping noise to the density-matrix simulation stack: - `amplitude_damping_channel` and `two_qubit_amplitude_damping_channel` in `graphix.channels`, returning the corresponding `KrausChannel`. The two-qubit channel is the tensor product of two independent single-qubit channels. - `AmplitudeDampingNoise` and `TwoQubitAmplitudeDampingNoise` (deriving from `Noise`), plus `AmplitudeDampingNoiseModel` (deriving from `NoiseModel`), mirroring the structure of `DepolarisingNoiseModel`. Channel parameters use a `_gamma` suffix to reflect the damping rate. - Tests covering the analytic channel action on basis and superposition states, two-qubit tensor structure, per-step noise insertion in a pattern, zero-damping/noiseless equivalence, and an end-to-end preparation-error simulation. Passes ruff, mypy --strict, pyright, and pytest locally. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #525 +/- ##
==========================================
+ Coverage 88.85% 88.91% +0.05%
==========================================
Files 49 50 +1
Lines 7135 7209 +74
==========================================
+ Hits 6340 6410 +70
- Misses 795 799 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 #497.
Adds amplitude damping noise to the density-matrix simulation stack.
Channels (
graphix.channels)amplitude_damping_channel(gamma)andtwo_qubit_amplitude_damping_channel(gamma), returning the correspondingKrausChannel. The single-qubit channel uses the standard Kraus operators K₁ = diag(1, √(1−γ)), K₂ = [[0, √γ], [0, 0]]; the two-qubit channel is the tensor product of two independent single-qubit channels.Noise model (
graphix.noise_models.amplitude_damping)AmplitudeDampingNoise/TwoQubitAmplitudeDampingNoise(deriving fromNoise) andAmplitudeDampingNoiseModel(deriving fromNoiseModel), mirroringDepolarisingNoiseModel. Channel parameters use a_gammasuffix to reflect that they are damping rates rather than Pauli probabilities. All three are exported fromgraphix.noise_models.Soundness of the tests
ApplyNoisecommands (carrying amplitude damping with the rightgamma, nodes, and domain) afterN/E/X/Zand beforeM, and for input nodes.prepare_error_gammareproduces the analytic Φ_γ(|+⟩⟨+|).Passes
ruff,mypy --strict,pyright, andpytestlocally (new tests plus the existing noise/density-matrix suites).Developed with LLM assistance, reviewed and tested by me.