Skip to content

Noise Model Theory

Theoretical foundations of quantum noise modeling, including CPTP maps, Kraus representations, quantum error channels, and practical noise considerations for NISQ devices. This guide connects the mathematical formalism to pyqpanda3's noise simulation capabilities.


The Need for Noise Modeling

Real quantum computers operate in noisy environments. Unlike classical bits, qubits are fragile quantum systems that lose their quantum properties through interactions with the environment. Noise modeling is essential for:

  1. Accurate simulation: Predicting real hardware behavior before running experiments
  2. Error mitigation: Designing strategies to reduce the impact of noise
  3. Error correction: Understanding the noise to build appropriate quantum error-correcting codes
  4. Benchmarking: Comparing hardware performance against theoretical noise models

In pyqpanda3, the NoiseModel class and associated error channels provide a comprehensive framework for noisy simulation.


Quantum Operations as Maps

Density Matrix Formalism

Before discussing noise, we need the density matrix formalism for describing quantum states:

Pure state: A state that can be written as a ket |ψ. Its density matrix is:

ρ=|ψψ|

Mixed state: A statistical mixture of pure states {pi,|ψi}:

ρ=ipi|ψiψi|

where pi0 and ipi=1.

Properties of a valid density matrix:

  • Hermitian: ρ=ρ
  • Positive semi-definite: ρ0 (all eigenvalues 0)
  • Unit trace: Tr(ρ)=1

Pure vs. Mixed States

A state is pure if and only if Tr(ρ2)=1, and mixed if Tr(ρ2)<1. The purity γ=Tr(ρ2) quantifies how "pure" a state is:

  • γ=1: pure state
  • 1/d<γ<1: mixed state (d is the Hilbert space dimension)
  • γ=1/d: maximally mixed state ρ=I/d

pyqpanda3's DensityMatrix class provides the purity() method for this calculation.


Completely Positive Trace-Preserving (CPTP) Maps

Definition

A quantum channel (noise model) is mathematically described by a Completely Positive Trace-Preserving (CPTP) map E that transforms input density matrices to output density matrices:

E:ρinρout

The two requirements are:

Complete Positivity (CP): For any auxiliary system of any dimension dA, the extended map (EIdA) maps positive operators to positive operators:

ρ0(EI)(ρ)0 extensions

Complete positivity is stronger than mere positivity — a map that is positive but not completely positive can produce unphysical results when applied to a subsystem of an entangled state.

Trace Preservation (TP): The trace of the density matrix is preserved:

Tr(E(ρ))=Tr(ρ)=1

This ensures total probability is conserved.

Why CPTP?

CPTP maps are the correct mathematical framework for quantum noise because:

  1. Physicality: CPTP maps are exactly the set of transformations that can occur in nature (by Stinespring's dilation theorem, any CPTP map can be realized by unitary evolution on a larger system)
  2. Composability: The composition of two CPTP maps is also CPTP — noise models can be chained
  3. Convexity: A probabilistic mixture of CPTP maps is CPTP — different noise sources combine correctly

Stinespring Dilation

Every CPTP map E on a system HS can be realized as a unitary evolution on a larger system:

E(ρ)=TrE[USE(ρ|e0e0|)USE]

where USE is a unitary on the joint system-environment Hilbert space HSHE, |e0 is a fixed environment state, and TrE is the partial trace over the environment.

This means all physical noise can be understood as unitary evolution with an unobserved environment — the randomness comes from tracing out (ignoring) the environment degrees of freedom.


Kraus Representation

Operator-Sum Representation

The most intuitive representation of a CPTP map is the Kraus (operator-sum) representation:

E(ρ)=iKiρKi

where the Kraus operators {Ki} satisfy the completeness relation:

iKiKi=I

This condition ensures trace preservation:

Tr(E(ρ))=Tr(iKiρKi)=Tr(ρiKiKi)=Tr(ρ)=1

Properties of Kraus Representations

  1. Non-uniqueness: The same channel can have different Kraus representations related by unitary mixing: Ki=juijKj where U=(uij) is unitary.

  2. Minimum number: The minimum number of Kraus operators needed is the Choi rank of the channel. For a qubit channel, this is between 1 (unitary) and 4 (completely depolarizing).

  3. Single Kraus operator: If there is only one Kraus operator, the channel is unitary: E(ρ)=UρU.

Kraus Operators for Common Channels

ChannelNumber of Kraus OpsKraus Operators
Unitary (U)1K0=U
Bit Flip2K0=1pI, K1=pX
Phase Flip2K0=1pI, K1=pZ
Depolarizing4K0=13p/4I, K1,2,3=p/4{X,Y,Z}
Amplitude Damping2K0=(1001γ), K1=(0γ00)
Phase Damping2K0=(1001λ), K1=(000λ)

pyqpanda3's Kraus class in the quantum_info module represents channels in this form. Channels can also be represented as Chi, Choi, SuperOp, or PTM, all of which are interconvertible.


Quantum Error Channels

Depolarizing Channel

The depolarizing channel is the most commonly used noise model. With probability p, the state is replaced by the maximally mixed state I/2:

Edepol(ρ)=(1p)ρ+p3(XρX+YρY+ZρZ)

Alternative parametrization (using depolarizing parameter pdep):

Edepol(ρ)=(1pdep)ρ+pdepI2

The relationship is pdep=4p3.

Kraus operators (4 operators):

K0=13p4I,K1=p4X,K2=p4Y,K3=p4Z

Properties:

  • Symmetric: treats all three axes equally
  • Shrinks the Bloch vector uniformly: r(1pdep)r
  • Often used as a worst-case noise model
  • pdep=1 gives the completely random state I/2

Amplitude Damping Channel

The amplitude damping channel models energy dissipation — the decay of an excited state |1 to the ground state |0:

EAD(ρ)=K0ρK0+K1ρK1

Kraus operators:

K0=(1001γ),K1=(0γ00)

where γ[0,1] is the damping probability (related to T1 relaxation time).

Action on basis states:

|00||00|(ground state unchanged)|11|(1γ)|11|+γ|00|(decay to ground)

Properties:

  • Non-unital: E(I)I (the channel doesn't preserve the identity)
  • Drives states toward |0
  • Models spontaneous emission, T1 decay
  • γ=0: identity (no damping); γ=1: complete relaxation to |0

Connection to T1 time: For a gate of duration tg:

γ=1etg/T1

Phase Damping (Dephasing) Channel

The phase damping channel models loss of phase coherence without energy loss:

EPD(ρ)=K0ρK0+K1ρK1

Kraus operators:

K0=(1001λ),K1=(000λ)

where λ[0,1] is the dephasing probability.

Equivalent form using Pauli Z:

EPD(ρ)=(1p2)ρ+p2ZρZ

where p=1etg/Tϕ.

Properties:

  • Unital: E(I)=I
  • Preserves computational basis: diagonal elements unchanged
  • Destroys off-diagonal elements (coherences): ρ01(1λ)ρ01
  • Models T2 decoherence
  • λ=0: identity; λ=1: complete dephasing (classical mixture)

Connection to T2 time:

1T2=12T1+1Tϕ

where Tϕ is the pure dephasing time.

Bit Flip Channel

The bit flip channel randomly applies an X gate:

EBF(ρ)=(1p)ρ+pXρX

Kraus operators: K0=1pI, K1=pX

Bloch sphere action: Flips the x-component with probability p: rx(12p)rx, ry(12p)ry, rz unchanged.

Connection: Equivalent to phase flip in the Hadamard basis: HEBFH=EPF.

Phase Flip Channel

The phase flip channel randomly applies a Z gate:

EPF(ρ)=(1p)ρ+pZρZ

Kraus operators: K0=1pI, K1=pZ

Bloch sphere action: rz unchanged, rx(12p)rx, ry(12p)ry.

Bit-Phase Flip Channel

The bit-phase flip channel randomly applies a Y gate (simultaneous bit and phase flip):

EBPF(ρ)=(1p)ρ+pYρY

Kraus operators: K0=1pI, K1=pY

Note: Y=iXZ, so this is a combined bit flip and phase flip (with an additional global phase).

Pauli Noise Channel

The general Pauli noise channel applies random Pauli operators with individual probabilities:

EPauli(ρ)=pIρ+pXXρX+pYYρY+pZZρZ

where pI+pX+pY+pZ=1.

This is the most general single-qubit Pauli channel and includes bit flip, phase flip, and depolarizing as special cases.

Thermal Relaxation Channel

The thermal relaxation channel models the combined effect of T1 (amplitude damping) and T2 (dephasing) processes over a gate duration t:

Ethermal(ρ)=E0ρE0+E1ρE1+E2ρE2

where the Kraus operators depend on the relaxation times T1, T2, and the gate time t:

preset=1et/T1pdephasing=1et/T2

This channel is essential for realistic simulations of superconducting qubit hardware.

Summary: Error Channel Comparison

ChannelParameterUnital?Physical Origin
Depolarizingp[0,1]YesGeneric noise
Amplitude Dampingγ[0,1]NoT1 relaxation
Phase Dampingλ[0,1]YesT2 dephasing
Bit Flipp[0,0.5]YesX errors
Phase Flipp[0,0.5]YesZ errors
Bit-Phase Flipp[0,0.5]YesY errors
Pauli NoisepI,pX,pY,pZYesGeneral Pauli errors
Thermal RelaxationT1,T2,tNoCombined relaxation

Quantum Channel Representations

A single quantum channel can be represented in multiple mathematically equivalent ways. pyqpanda3 supports five representations, all interconvertible:

Kraus Representation

E(ρ)=iKiρKi

Most intuitive; directly shows the physical operations.

Superoperator (Liouville) Representation

The channel is represented as a d2×d2 matrix S acting on vectorized density matrices:

vec(E(ρ))=Svec(ρ)

where vec() stacks matrix columns. In pyqpanda3, this is the SuperOp class.

Chi Matrix Representation

The channel is expanded in the Pauli basis:

E(Pj)=iχijPi

The χ matrix (not to be confused with the Choi matrix) is the Pauli-basis representation. In pyqpanda3, this is the Chi class.

Choi Matrix Representation

The Choi matrix is defined as:

J(E)=(EI)(|ΩΩ|)

where |Ω=i|i|i is the maximally entangled state. The channel is CPTP if and only if J(E)0 (positive semidefinite) and Tr1(J)=I (partial trace condition). In pyqpanda3, this is the Choi class.

Pauli Transfer Matrix (PTM)

The PTM represents the channel's action on the generalized Pauli basis:

Rij=1dTr(PiE(Pj))

where {Pi} are normalized Pauli operators. The PTM is a real matrix for Hermiticity-preserving channels. In pyqpanda3, this is the PTM class.

Conversion Between Representations

All five representations are interconvertible in pyqpanda3 by constructing one from another:


Noise in NISQ Devices

Characteristics of NISQ Noise

Current Noisy Intermediate-Scale Quantum (NISQ) devices exhibit several types of noise:

1. Gate Errors: Imperfect gate implementation causes unitary errors and over/under-rotation:

  • Single-qubit gate error rate: 104 to 103
  • Two-qubit gate error rate: 103 to 102
  • Typically modeled as depolarizing or coherent rotation errors

2. Measurement Errors: Readout (SPAM — State Preparation And Measurement) errors:

  • Assignment error rate: 1% to 5%
  • P(read 0|state 1) and P(read 1|state 0) can be asymmetric
  • Modeled as a classical confusion matrix

3. Decoherence: Qubits lose quantum information over time:

  • T1 (relaxation time): Energy decay, typically 20μs to 200μs
  • T2 (dephasing time): Phase coherence loss, typically 10μs to 150μs
  • Gate times: 20ns to 200ns

4. Cross-Talk: Unwanted coupling between qubits during operations:

  • Spectral cross-talk: Simultaneous gate operations interfere
  • Always-on coupling: Residual interaction between neighboring qubits

5. Leakage: Qubit state escapes the computational subspace:

  • Population in |2 or higher energy levels
  • Particularly problematic for superconducting transmon qubits

Modeling Noise with pyqpanda3

pyqpanda3's NoiseModel class supports configuring noise for realistic simulations:

python
from pyqpanda3.core import CPUQVM, NoiseModel, QProg, QGate
from pyqpanda3.core import H, CNOT, measure, depolarizing_error, GateType

# Create a noise model
noise = NoiseModel()

# Add depolarizing noise to all single-qubit gates
error_1q = depolarizing_error(0.001)
noise.add_all_qubit_quantum_error(error_1q, GateType.H)

# Add depolarizing noise to all two-qubit gates
error_2q = depolarizing_error(0.01)
noise.add_all_qubit_quantum_error(error_2q, GateType.CNOT)

# Run noisy simulation
qvm = CPUQVM()
prog = QProg()
prog << H(0) << CNOT(0, 1) << measure([0, 1], [0, 1])
qvm.run(prog, shots=1000, model=noise)
result = qvm.result()

Noise-Aware Circuit Design

Principles for designing circuits that are robust to noise:

  1. Minimize two-qubit gates: They have the highest error rates
  2. Minimize circuit depth: Errors accumulate with each time step
  3. Use noise-aware transpilation: Map circuits to qubits with best connectivity and coherence
  4. Exploit symmetries: Design circuits where noise cancels (e.g., dynamical decoupling)

Error Mitigation Techniques

Error mitigation reduces the impact of noise without full error correction:

Zero-Noise Extrapolation (ZNE):

  • Run the circuit at multiple noise levels (by folding gates to amplify noise)
  • Extrapolate results to the zero-noise limit
  • Typically uses linear or exponential fitting

Probabilistic Error Cancellation (PEC):

  • Characterize the noise channel E
  • Apply the inverse channel E1 probabilistically
  • Produces unbiased estimates at the cost of increased sampling

Measurement Error Mitigation:

  • Characterize the readout error matrix M
  • Apply M1 to the observed probability distribution
  • Requires calibration runs for each measurement basis

Twirled Readout Error Extinction (TREX):

  • Randomly flip qubits before measurement (twirling)
  • Converts correlated readout errors into simpler diagonal form
  • Easier to invert

Mathematical Summary

Key Relationships

CPTP MapKraus OpsChoi MatrixSuperOpPTM

Bloch Sphere Picture

For single-qubit channels, the CPTP map acts on the Bloch vector r as an affine transformation:

r=Mr+t

where M is a 3×3 real matrix and t is a translation vector.

Channel TypeMt
Depolarizing (p)(14p3)I0
Bit Flip (p)diag(12p,12p,1)0
Amplitude Damping (γ)(1γ0001γ0001γ)(0,0,γ)
Phase Damping (λ)diag(1λ,1λ,1)0

Unital channels (t=0) preserve the maximally mixed state and only shrink/rotate the Bloch sphere. Non-unital channels (t0) also translate the Bloch sphere, driving it toward a preferred state.


See Also

Released under the MIT License.