Skip to content

Implement amplitude damping noise model (closes #497)#525

Open
Vinny010 wants to merge 1 commit into
TeamGraphix:masterfrom
Vinny010:amplitude-damping-noise
Open

Implement amplitude damping noise model (closes #497)#525
Vinny010 wants to merge 1 commit into
TeamGraphix:masterfrom
Vinny010:amplitude-damping-noise

Conversation

@Vinny010
Copy link
Copy Markdown

@Vinny010 Vinny010 commented Jun 3, 2026

Closes #497.

Adds amplitude damping noise to the density-matrix simulation stack.

Channels (graphix.channels)

  • amplitude_damping_channel(gamma) and two_qubit_amplitude_damping_channel(gamma), returning the corresponding KrausChannel. 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 from Noise) and AmplitudeDampingNoiseModel (deriving from NoiseModel), mirroring DepolarisingNoiseModel. Channel parameters use a _gamma suffix to reflect that they are damping rates rather than Pauli probabilities. All three are exported from graphix.noise_models.

Soundness of the tests

  • Channel action: amplitude damping has the closed form Φ_γ(|0⟩⟨0|) = |0⟩⟨0| (ground state unaffected) and Φ_γ(|1⟩⟨1|) = γ|0⟩⟨0| + (1−γ)|1⟩⟨1| (excited state decays with probability γ); the action on |+⟩⟨+| and the trace-preservation are checked against the analytic result. The two-qubit channel is verified to equal the Kronecker product of single-qubit actions on a product state.
  • Per-step application: the model is checked to insert the expected ApplyNoise commands (carrying amplitude damping with the right gamma, nodes, and domain) after N/E/X/Z and before M, and for input nodes.
  • End-to-end: a zero-damping model reproduces the noiseless result, and a single-preparation pattern with prepare_error_gamma reproduces the analytic Φ_γ(|+⟩⟨+|).

Passes ruff, mypy --strict, pyright, and pytest locally (new tests plus the existing noise/density-matrix suites).

Developed with LLM assistance, reviewed and tested by me.

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
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 91.89189% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.91%. Comparing base (fcdb8f4) to head (7885583).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
graphix/noise_models/amplitude_damping.py 90.90% 6 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement amplitude damping noise model

1 participant