Add amplitude damping noise model (#497)#540
Open
NandanPatel24 wants to merge 2 commits into
Open
Conversation
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
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
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
tests/test_density_matrix.py(https://github.com/TeamGraphix/graphix/blob/master/tests/test_density_matrix.py)
tests/test_noise_model.py((https://github.com/TeamGraphix/graphix/blob/master/tests/test_noise_model.py)
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