Skip to content

Add amplitude damping noise model (#497)#540

Open
NandanPatel24 wants to merge 2 commits into
TeamGraphix:masterfrom
NandanPatel24:amplitude-damping-noise
Open

Add amplitude damping noise model (#497)#540
NandanPatel24 wants to merge 2 commits into
TeamGraphix:masterfrom
NandanPatel24:amplitude-damping-noise

Conversation

@NandanPatel24

Copy link
Copy Markdown

Summary

  • Implements amplitude damping noise (issue Implement amplitude damping noise model #497), modeling energy relaxation (T₁ decay) where population flows from the excited state |1⟩ to the ground state |0⟩ with probability γ. Adds the single- and two-qubit channels, the Noise element classes, and an AmplitudeDampingNoiseModel, following DepolarisingNoiseModel as the reference.

Closes #497.

Changes

  • graphix/channels.py — adds amplitude_damping_channel(prob) and two_qubit_amplitude_damping_channel(prob), returning KrausChannel objects. Single-qubit operators are K₁ = diag(1, √(1−γ)) and K₂ = [[0, √γ], [0, 0]]; the two-qubit version is the tensor product of two independent single-qubit channels (four operators {Kᵢ⊗Kⱼ}). Unlike the existing Pauli-based channels these operators aren't scalar multiples of Pauli matrices, so they're built explicitly with coef=1.0.

  • graphix/noise_models/amplitude_damping.py (new) — defines AmplitudeDampingNoise, TwoQubitAmplitudeDampingNoise (both deriving from Noise), and AmplitudeDampingNoiseModel (deriving from NoiseModel). The model mirrors DepolarisingNoiseModel's command-injection logic. confuse_result returns the result unchanged, since amplitude damping is a purely quantum channel with no classical readout-error component; readout error can be added by composing with another model via ComposeNoiseModel. (This is why the model omits the measure_error_prob parameter that the depolarising model carries.)

  • graphix/noise_models/init.py — registers the three new classes for top-level import, alongside the depolarising exports.

A convention note

  • The backend (density_matrix.py) applies channels as ρ′ = Σᵢ KᵢρKᵢ† (verified in evolve/evolve_single). The KrausChannel docstring states the daggered-left form Σᵢ Kᵢ†ρKᵢ — for the existing Hermitian Pauli channels this makes no difference, but amplitude damping's K₂ is non-Hermitian, so the operators here are written for the backend's actual KρK† convention (downward |1⟩ → |0⟩ decay). Happy to also fix the docstring in this PR if maintainers prefer.

Tests and soundness

The suite is split between proving the channel matches the Kraus formula (random-state and by-hand-sum tests) and proving it is amplitude damping specifically (deterministic basis-state tests exploiting the channel's asymmetry — these are the soundness argument the issue asks for).

tests/test_kraus.py

  • test_amplitude_damping_channel — single-qubit channel builds the correct K₁, K₂ operators.
  • test_2_qubit_amplitude_damping_channel — two-qubit channel builds the correct four tensor-product operators.

tests/test_density_matrix.py(https://github.com/TeamGraphix/graphix/blob/master/tests/test_density_matrix.py)

  • test_apply_amplitude_damping_channel — channel application matches the by-hand Σ KᵢρKᵢ† sum, on a single qubit and embedded in a larger random register.
  • test_amplitude_damping_ground_state_fixed — |0⟩⟨0| is unchanged for any γ (ground state can't decay).
  • test_amplitude_damping_excited_state_decays — |1⟩⟨1| → (1−γ)|1⟩⟨1| + γ|0⟩⟨0|, the directional T₁ signature.
  • test_amplitude_damping_coherence_decay — off-diagonal coherences scale by √(1−γ), distinguishing amplitude damping from dephasing.
  • test_apply_two_qubit_amplitude_damping_channel — the two-qubit channel equals independent damping on each factor.

tests/test_noise_model.py((https://github.com/TeamGraphix/graphix/blob/master/tests/test_noise_model.py)

  • test_amplitude_damping_command_injection — noise is injected at the correct positions (after N, after E with two-qubit noise, before M, domain-conditioned on X/Z).
  • test_amplitude_damping_confuse_result_is_identity — the model introduces no classical readout error.
  • test_compose_amplitude_damping_depolarising_transpile — composing with a depolarising model injects both noises with the correct type and probability at every command position.
  • test_compose_amplitude_damping_depolarising_simulation — a composed model with both at default (zero) parameters reproduces the ideal statevector.

All checks pass locally (ruff, ruff-format, mypy, pyright, pytest).

Per unitaryHACK's AI-use guidelines: AI assistance was used while developing this contribution, especially to format this PR content, and for debugging. All ideas remain my own

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