Skip to content

Simulating Quantum Channels

This notebook guide specifies a reproducible finite-dimensional calculation for applying and validating quantum channels. The goal is not only to produce noisy density matrices, but to make every representation checkable: Kraus operators, Choi matrices, trace preservation, complete positivity, Bloch-vector action, and limiting cases.

As of this review, no executable notebook under notebooks/density-open-systems/quantum-channels/ is promoted as a reproduced artifact. This page is the admission contract for that notebook family: it states what the notebook should compute, what it should check, and what output is trustworthy enough to cite.

The notebook should demonstrate how to:

  • represent density matrices as finite arrays;
  • apply channels from Kraus operators;
  • build a Choi matrix with a declared convention;
  • test trace preservation and complete positivity;
  • compare numerical channel action with analytic formulas;
  • compose channels without losing conventions;
  • diagnose unphysical maps before using them as noise models.

The calculation should stay small enough that every expected result can be checked analytically. Qubit channels are the primary test bed.

Use a dedicated directory:

notebooks/density-open-systems/quantum-channels/
simulating-quantum-channels.ipynb
README.md

The opening notebook cell or README.md should state:

  • Python and package versions;
  • basis ordering;
  • vectorization convention;
  • Choi input-output ordering;
  • numerical tolerance;
  • random seed, if random states are generated;
  • whether all plots are exploratory or accepted outputs.

The notebook should represent a density matrix ρ\rho as a Hermitian positive semidefinite matrix with

Tr⁡ρ=1.\operatorname{Tr}\rho=1.

A channel in Kraus form is

Φ(ρ)=∑rKrρKr†,∑rKr†Kr=I.\Phi(\rho) = \sum_r K_r\rho K_r^\dagger, \qquad \sum_rK_r^\dagger K_r=I.

The adjoint channel is

Φ†(A)=∑rKr†AKr.\Phi^\dagger(A) = \sum_r K_r^\dagger A K_r.

With the output-input Choi convention used by Choi Matrix,

JΦ=∑i,jΦ(∣i⟩⟨j∣)⊗∣i⟩⟨j∣.J_\Phi = \sum_{i,j} \Phi(\lvert i\rangle\langle j\rvert) \otimes \lvert i\rangle\langle j\rvert.

The notebook should explicitly state this convention before any vectorization helper appears.

Implement at least four channels.

The identity channel is

Φid(ρ)=ρ.\Phi_{\mathrm{id}}(\rho)=\rho.

A unitary channel is

ΦU(ρ)=UρU†.\Phi_U(\rho)=U\rho U^\dagger.

These are sanity checks: trace, purity, spectrum, and positivity should be preserved exactly up to roundoff.

For real −1≤λ≤1-1\le\lambda\le1,

Φλ(ρ)=1+λ2ρ+1−λ2ZρZ.\Phi_\lambda(\rho) = \frac{1+\lambda}{2}\rho + \frac{1-\lambda}{2}Z\rho Z.

The expected Bloch-vector action is

(rx,ry,rz)↦(λrx,λry,rz).(r_x,r_y,r_z) \mapsto (\lambda r_x,\lambda r_y,r_z).

Use Dephasing Channel as the analytic reference.

For a qubit with shrink factor λ\lambda,

Φλ(ρ)=λρ+(1−λ)I2.\Phi_\lambda(\rho) = \lambda\rho + (1-\lambda)\frac{I}{2}.

Complete positivity requires

−13≤λ≤1.-\frac13\le\lambda\le1.

The notebook should test values inside and outside this interval and confirm that the Choi matrix detects the unphysical cases.

For zero-temperature damping with probability pp,

K0=(1001−p),K1=(0p00).K_0 = \begin{pmatrix} 1&0\\ 0&\sqrt{1-p} \end{pmatrix}, \qquad K_1 = \begin{pmatrix} 0&\sqrt p\\ 0&0 \end{pmatrix}.

The expected action is

ρ11′=(1−p)ρ11,ρ00′=ρ00+pρ11,ρ01′=1−p ρ01.\begin{aligned} \rho_{11}'&=(1-p)\rho_{11},\\ \rho_{00}'&=\rho_{00}+p\rho_{11},\\ \rho_{01}'&=\sqrt{1-p}\,\rho_{01}. \end{aligned}

Use Amplitude-Damping Channel as the reference for conventions.

The notebook should follow a validation-first workflow:

  1. Define basis ordering and Pauli matrices.
  2. Define helpers for Hermiticity, trace, eigenvalue positivity, and matrix norms.
  3. Define channel application from Kraus operators.
  4. Verify Kraus completeness before applying a channel.
  5. Build the Choi matrix from basis operators, not from an unexplained reshaping trick.
  6. Verify Choi positivity and trace-preservation partial trace.
  7. Apply each channel to a fixed set of test states.
  8. Compare against analytic matrix-element or Bloch-vector formulas.
  9. Compose channels and verify the composed channel again.

The first version should not use random states as the only tests. Fixed states make failures easier to diagnose.

Use a minimal but revealing set:

ρ0=∣0⟩⟨0∣,ρ1=∣1⟩⟨1∣,\rho_0=\lvert0\rangle\langle0\rvert, \qquad \rho_1=\lvert1\rangle\langle1\rvert, ρ+=∣+⟩⟨+∣,∣+⟩=∣0⟩+∣1⟩2,\rho_+ = \lvert+\rangle\langle+\rvert, \qquad \lvert+\rangle = \frac{\lvert0\rangle+\lvert1\rangle}{\sqrt2},

and

ρy=∣+y⟩⟨+y∣,∣+y⟩=∣0⟩+i∣1⟩2.\rho_y = \lvert +y\rangle\langle +y\rvert, \qquad \lvert +y\rangle = \frac{\lvert0\rangle+i\lvert1\rangle}{\sqrt2}.

Also test the maximally mixed state I/2I/2. It distinguishes unital channels from nonunital channels: dephasing and depolarizing are unital, but amplitude damping is not.

The notebook should report pass/fail checks with numerical tolerances.

CheckRequirement
Hermiticity∥ρ−ρ†∥<ϵ\|\rho-\rho^\dagger\|\lt\epsilon
Trace$
Positivitysmallest eigenvalue ≥−ϵ\ge-\epsilon
Kraus completeness∥∑rKr†Kr−I∥<ϵ\|\sum_rK_r^\dagger K_r-I\|\lt\epsilon
Choi positivityeigenvalues of JΦJ_\Phi nonnegative within tolerance
Trace preservation∥Tr⁡outJΦ−Iin∥<ϵ\|\operatorname{Tr}_{\mathrm{out}}J_\Phi-I_{\mathrm{in}}\|\lt\epsilon
Analytic actionmatrix elements match the linked formula page
Compositioncomposition remains CPTP when each factor is CPTP

Use a tolerance appropriate to double precision, such as ϵ=10−12\epsilon=10^{-12} for exact 2×22\times2 formulas, while keeping the tolerance declared in one place.

The notebook should produce tables rather than only plots:

  • Kraus-completeness residuals for each channel;
  • Choi eigenvalues for representative parameters;
  • trace and minimum-eigenvalue checks for every output state;
  • analytic-versus-numerical residuals;
  • Bloch-vector input and output table;
  • optional plots of Bloch-vector contraction or affine shift.

Plots are helpful, but the validation table is the evidence.

Use small parameter grids:

λdeph∈{1,0.5,0,−0.5},\lambda_{\mathrm{deph}} \in \{1,0.5,0,-0.5\}, λdepol∈{1,0.5,0,−0.2,−0.4},\lambda_{\mathrm{depol}} \in \{1,0.5,0,-0.2,-0.4\},

and

pamp∈{0,0.25,0.75,1}.p_{\mathrm{amp}} \in \{0,0.25,0.75,1\}.

The depolarizing value λ=−0.4\lambda=-0.4 should fail complete positivity for a qubit. Keeping one controlled failure in the notebook is useful: it proves the validation test can catch an invalid channel.

Channel composition should be implemented explicitly:

(Φ∘Ψ)(ρ)=Φ(Ψ(ρ)).(\Phi\circ\Psi)(\rho) = \Phi(\Psi(\rho)).

The notebook should compare two ways to compute the same composition:

  • applying Ψ\Psi and then Φ\Phi to test states;
  • constructing composed Kraus operators KrLsK_rL_s.

For

Φ(ρ)=∑rKrρKr†,Ψ(ρ)=∑sLsρLs†,\Phi(\rho)=\sum_rK_r\rho K_r^\dagger, \qquad \Psi(\rho)=\sum_sL_s\rho L_s^\dagger,

the composed channel has Kraus operators

Mrs=KrLs.M_{rs}=K_rL_s.

This test catches ordering mistakes.

Record:

  • programming language and version;
  • NumPy or linear-algebra backend version;
  • exact basis ordering;
  • vectorization and Choi convention;
  • norm used for residuals;
  • tolerance values;
  • parameter grids;
  • random seed if random states are included;
  • date and commit identifier when the notebook is promoted.

The calculation should run from a clean kernel without hidden global state. See Notebook Index and Reproducibility Status for the repository-wide policy.

  • Building a Choi matrix with the opposite tensor-factor order and interpreting the wrong partial trace.
  • Testing positivity on system states but forgetting complete positivity with a reference system.
  • Treating small negative eigenvalues from roundoff the same way as real physical violations.
  • Using an amplitude-damping channel with the excited and ground labels swapped.
  • Forgetting that amplitude damping is nonunital.
  • Composing Kraus operators in the wrong order.
  • Reporting only plots, with no residual table.
  • Promoting a notebook without a clean-kernel rerun.

For the amplitude-damping Kraus operators above, compute ∑rKr†Kr\sum_rK_r^\dagger K_r.

Solution

One has

K0†K0=(1001−p),K1†K1=(000p).K_0^\dagger K_0 = \begin{pmatrix} 1&0\\ 0&1-p \end{pmatrix}, \qquad K_1^\dagger K_1 = \begin{pmatrix} 0&0\\ 0&p \end{pmatrix}.

Adding gives

K0†K0+K1†K1=I.K_0^\dagger K_0+K_1^\dagger K_1=I.

Which baseline channels in this notebook are unital?

Solution

The identity, unitary, dephasing, and depolarizing channels are unital: they map I/2I/2 to I/2I/2 for a qubit. Amplitude damping is not unital for p>0p>0 because

Ap(I/2)=12(1+p001−p).\mathcal A_p(I/2) = \frac12 \begin{pmatrix} 1+p&0\\ 0&1-p \end{pmatrix}.

Why should the qubit depolarizing channel with λ=−0.4\lambda=-0.4 fail the notebook’s complete-positivity test?

Solution

For a qubit depolarizing shrink factor, complete positivity requires

−13≤λ≤1.-\frac13\le\lambda\le1.

Since −0.4<−1/3-0.4\lt-1/3, the Choi matrix must have a negative eigenvalue. A correct Choi-positivity test should flag this parameter value as invalid.

If Φ(ρ)=∑rKrρKr†\Phi(\rho)=\sum_rK_r\rho K_r^\dagger and Ψ(ρ)=∑sLsρLs†\Psi(\rho)=\sum_sL_s\rho L_s^\dagger, what Kraus operators represent Φ∘Ψ\Phi\circ\Psi?

Solution

By definition,

(Φ∘Ψ)(ρ)=Φ(∑sLsρLs†)=∑r,sKrLsρLs†Kr†.(\Phi\circ\Psi)(\rho) = \Phi \left( \sum_sL_s\rho L_s^\dagger \right) = \sum_{r,s} K_rL_s\rho L_s^\dagger K_r^\dagger.

Thus the composed Kraus operators are

Mrs=KrLs.M_{rs}=K_rL_s.

The order matters: Ψ\Psi acts first, then Φ\Phi.

  • K. Kraus, States, Effects, and Operations: Fundamental Notions of Quantum Theory, Springer (1983).
  • M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, Cambridge University Press (2010).
  • J. Watrous, The Theory of Quantum Information, Cambridge University Press (2018).
  • C. R. Harris et al., “Array programming with NumPy,” Nature 585, 357–362 (2020).
  • L. N. Trefethen and D. Bau III, Numerical Linear Algebra, SIAM (1997).