Skip to content

Quantum Information Theory

Fundamentals of quantum information theory covering state representations, entropy, fidelity, distance measures, and quantum channel representations. This guide connects the theoretical formalism to the classes and functions provided by pyqpanda3's quantum_info module.


Quantum State Representations

State Vectors

A pure quantum state of n qubits is a normalized vector in the Hilbert space H=C2n:

|ψ=i=02n1αi|i,i|αi|2=1

where {|i} is the computational basis and αiC are probability amplitudes.

Properties:

  • Normalization: ψ|ψ=1
  • Global phase: |ψ and eiϕ|ψ represent the same physical state
  • Superposition: A state can be in a superposition of multiple basis states simultaneously

pyqpanda3's StateVector class represents pure states and provides:

  • Construction from arrays, circuits, or computational basis states
  • Evolution via quantum circuits: sv.evolve(circuit)
  • Conversion to density matrix: sv.get_density_matrix()
  • Purity computation: sv.purity()

Density Matrices

A mixed quantum state is described by a density matrix (density operator):

ρ=ipi|ψiψi|

where {pi,|ψi} is an ensemble of pure states with pi0 and ipi=1.

Equivalent definition: A density matrix is any matrix ρ satisfying:

  1. Hermiticity: ρ=ρ
  2. Positive semi-definiteness: ρ0 (all eigenvalues 0)
  3. Unit trace: Tr(ρ)=1

Bloch sphere (single qubit): Any single-qubit density matrix can be written as:

ρ=12(I+rσ)=12(1+rzrxiryrx+iry1rz)

where r=(rx,ry,rz) is the Bloch vector with |r|1.

  • Pure states: |r|=1 (on the surface of the Bloch sphere)
  • Mixed states: |r|<1 (inside the Bloch sphere)
  • Maximally mixed: r=0, ρ=I/2 (center of the sphere)

pyqpanda3's DensityMatrix class provides:

  • Construction from matrices, state vectors, or circuits
  • Evolution via quantum circuits: dm.evolve(circuit); evolution via quantum channels: use the channel's own channel.evolve(dm) method
  • Purity: dm.purity()
  • Conversion to state vector (if pure): dm.to_statevector()

Pure vs. Mixed States

PropertyPure StateMixed State
Representation|ψρ=ipi|ψiψi|
PurityTr(ρ2)=1Tr(ρ2)<1
Bloch vector|r|=1|r|<1
Idempotencyρ2=ρρ2ρ
von Neumann entropyS(ρ)=0S(ρ)>0
Example|0, |0+|12I2, 12|00|+12|11|

Partial Trace and Reduced States

For a bipartite system ρAB, the partial trace over subsystem B gives the reduced density matrix:

ρA=TrB(ρAB)=iiB|ρAB|iB

The reduced state ρA captures all information accessible by measuring subsystem A alone.

Separability: A state ρAB is separable if it can be written as:

ρAB=ipiρA(i)ρB(i)

Otherwise, the state is entangled.


Von Neumann Entropy

Definition

The von Neumann entropy of a quantum state ρ is:

S(ρ)=Tr(ρlog2ρ)=iλilog2λi

where {λi} are the eigenvalues of ρ.

This is the quantum generalization of the Shannon entropy H(X)=ipilog2pi.

Properties

1. Non-negativity:

S(ρ)0

with equality if and only if ρ is a pure state.

2. Maximum entropy:

S(ρ)log2d

where d is the Hilbert space dimension. Equality holds for the maximally mixed state ρ=I/d.

3. Invariance under unitaries:

S(UρU)=S(ρ)

Unitary evolution preserves entropy (information is conserved).

4. Concavity:

S(ipiρi)ipiS(ρi)

Mixing states increases entropy.

5. Subadditivity:

S(ρAB)S(ρA)+S(ρB)

6. Strong subadditivity (the most powerful inequality):

S(ρABC)+S(ρB)S(ρAB)+S(ρBC)

Entanglement Entropy

For a pure bipartite state |ψAB, the entanglement entropy is:

E(|ψAB)=S(ρA)=S(ρB)

where ρA=TrB(|ψψ|) and ρB=TrA(|ψψ|).

Note that S(ρA)=S(ρB) for pure bipartite states — the entanglement is symmetric.

Examples:

  • Product state |0A|0B: E=0 (no entanglement)
  • Bell state |00+|112: E=1 (maximally entangled, 1 ebit)
  • GHZ state |000+|1113: E=1 (1 ebit for any bipartition)

Quantum Mutual Information

The quantum mutual information measures total correlations between two systems:

I(A:B)=S(ρA)+S(ρB)S(ρAB)
  • I(A:B)=0: A and B are uncorrelated (ρAB=ρAρB)
  • I(A:B)>0: A and B are correlated (includes both classical and quantum correlations)

Conditional Entropy

The quantum conditional entropy:

S(A|B)=S(ρAB)S(ρB)

Unlike the classical case, quantum conditional entropy can be negative:

  • S(A|B)<0 indicates quantum entanglement
  • This negativity has operational meaning: it corresponds to quantum state merging (the ability to transfer quantum information using entanglement)

Quantum Fidelity

Definition

The fidelity between two quantum states ρ and σ is:

F(ρ,σ)=(Trρσρ)2

For pure states |ψ and |ϕ:

F(|ψ,|ϕ)=|ψ|ϕ|2

For a pure state |ψ and a mixed state ρ:

F(|ψ,ρ)=ψ|ρ|ψ

Uhlmann's Theorem

The fidelity can be expressed in terms of purifications:

F(ρ,σ)=max|ψ,|ϕ|ψ|ϕ|2

where |ψ and |ϕ are purifications of ρ and σ respectively. This provides a geometric interpretation: fidelity is the maximum overlap between any purifications of the two states.

Properties

1. Symmetry: F(ρ,σ)=F(σ,ρ)

2. Bounds: 0F(ρ,σ)1

  • F=1: identical states (ρ=σ)
  • F=0: orthogonal states

3. Multiplicativity under tensor products:

F(ρ1ρ2,σ1σ2)=F(ρ1,σ1)F(ρ2,σ2)

4. Monotonicity under CPTP maps:

F(E(ρ),E(σ))F(ρ,σ)

Quantum channels cannot decrease fidelity.

Bures Distance

The Bures distance is related to fidelity:

DB(ρ,σ)=2(1F(ρ,σ))

It is a proper metric on the space of density matrices, satisfying triangle inequality.


Distance Measures

pyqpanda3 provides three distance measures for comparing probability distributions and quantum states.

Hellinger Distance

The Hellinger distance between two discrete probability distributions P and Q:

H(P,Q)=12|PQ|2=12x(P(x)Q(x))2

Properties:

  • 0H(P,Q)1
  • H(P,Q)=0P=Q
  • Symmetric: H(P,Q)=H(Q,P)
  • Related to the Bhattacharyya coefficient: H=1BC(P,Q)

pyqpanda3 implementation:

python
from pyqpanda3.quantum_info import hellinger_distance

# Using integer keys
p = {0: 0.5, 1: 0.3, 2: 0.2}
q = {0: 0.4, 1: 0.4, 2: 0.2}
dist = hellinger_distance(p, q)

# Using string keys
p = {"00": 0.25, "01": 0.25, "10": 0.25, "11": 0.25}
q = {"00": 0.5, "01": 0.0, "10": 0.0, "11": 0.5}
dist = hellinger_distance(p, q)

Hellinger Fidelity

The Hellinger fidelity is derived from the Hellinger distance:

FH(P,Q)=(1H(P,Q)2)2=(xP(x)Q(x))2

Properties:

  • 0FH(P,Q)1
  • FH=1P=Q
  • Related to the Bhattacharyya coefficient: FH=BC2

pyqpanda3 implementation:

python
from pyqpanda3.quantum_info import hellinger_fidelity

p = {0: 0.5, 1: 0.5}
q = {0: 0.5, 1: 0.5}
fid = hellinger_fidelity(p, q)  # 1.0 (identical)

Kullback-Leibler (KL) Divergence

The KL divergence measures the information gain when using Q instead of P:

Discrete distributions:

DKL(P|Q)=xP(x)log2P(x)Q(x)

Continuous distributions:

DKL(p|q)=p(x)log2p(x)q(x)dx

Properties:

  • DKL(P|Q)0 (Gibbs' inequality)
  • DKL(P|Q)=0P=Q (almost everywhere)
  • Not symmetric: DKL(P|Q)DKL(Q|P) in general
  • Not a metric: Does not satisfy the triangle inequality

pyqpanda3 supports both discrete and continuous KL divergence:

python
from pyqpanda3.quantum_info import KL_divergence

# Discrete distributions (lists)
p = [0.5, 0.3, 0.2]
q = [0.4, 0.4, 0.2]
div = KL_divergence(p, q)

# Continuous distributions (functions)
import numpy as np
div = KL_divergence(
    p_pdf=lambda x: np.exp(-x),  # exponential
    q_pdf=lambda x: np.exp(-x**2/2) / np.sqrt(2*np.pi),  # Gaussian
    x_start=0.0,
    x_end=10.0,
    dx=1e-4
)

Trace Distance

The trace distance between two density matrices:

T(ρ,σ)=12|ρσ|1=12Tr(ρσ)(ρσ)

Properties:

  • 0T(ρ,σ)1
  • Proper metric (symmetric, triangle inequality)
  • Related to the optimal probability of distinguishing ρ from σ:
Pcorrect=1+T(ρ,σ)2
  • For qubits: T(ρ,σ)=12|rρrσ| (half the Euclidean distance between Bloch vectors)

Comparison of Distance Measures

MeasureTypeSymmetric?Metric?Range
Hellinger distanceClassical distributionsYesYes[0,1]
Hellinger fidelityClassical distributionsYesNo[0,1]
KL divergenceClassical distributionsNoNo[0,)
Trace distanceQuantum statesYesYes[0,1]
FidelityQuantum statesYesNo[0,1]
Bures distanceQuantum statesYesYes[0,2]

Relationships:

1F(ρ,σ)T(ρ,σ)1F(ρ,σ)DB(ρ,σ)T(ρ,σ)2DB(ρ,σ)

Quantum Channel Representations

A quantum channel (CPTP map) can be represented in several equivalent forms. pyqpanda3's quantum_info module provides five interconvertible representations.

Kraus Representation

E(ρ)=iKiρKi,iKiKi=I

The most physically intuitive representation — each Kraus operator Ki represents a "quantum jump" that occurs with probability pi=Tr(KiρKi).

pyqpanda3 class: Kraus

Superoperator (Liouville) Representation

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

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

The vectorization vec(ρ) stacks the columns of ρ into a vector. The superoperator is:

S=iKiKi

where Ki is the complex conjugate (not the adjoint).

pyqpanda3 class: SuperOp

Chi (Process Matrix) Representation

The channel is expanded in the normalized Pauli basis {Pi/d}:

E(ρ)=i,jχijPiρPj

The χ matrix (also called the "process matrix" in some contexts) fully characterizes the channel in the Pauli basis.

pyqpanda3 class: Chi

Choi Matrix Representation

The Choi matrix is obtained by applying the channel to one half of a maximally entangled state:

J(E)=(EId)(|ΩΩ|)=i,j|ij|E(|ij|)

where |Ω=1di|i|i.

Choi-Jamiolkowski isomorphism: There is a bijection between CPTP maps and positive semidefinite matrices J satisfying Tr1(J)=I.

pyqpanda3 class: Choi

Pauli Transfer Matrix (PTM)

The PTM represents the channel in the Pauli basis:

Rij=1dTr(PiE(Pj))

where {Pi} are the normalized Pauli operators (including identity). The PTM is a real-valued matrix for any Hermiticity-preserving channel.

Physical interpretation: Rij tells you how much of Pauli Pi appears in the output when Pauli Pj is the input. For a noiseless identity channel, R=I (the identity matrix).

pyqpanda3 class: PTM

Conversion Relationships

All five representations encode the same information and can be freely converted:

In pyqpanda3, conversion is done by constructing one class from another:

python
from pyqpanda3.quantum_info import Kraus, Choi, SuperOp, Chi, PTM

# Create a channel from Kraus operators
kraus = Kraus([...])

# Convert to other representations
choi = Choi(kraus)
superop = SuperOp(kraus)
chi = Chi(kraus)
ptm = PTM(kraus)

# All representations can evolve quantum states
from pyqpanda3.quantum_info import DensityMatrix, StateVector
dm = DensityMatrix(...)
evolved = choi.evolve(dm)   # Returns DensityMatrix
evolved = kraus.evolve(dm)  # Same result

Comparison of Representations

RepresentationSizeReal?Best For
Krausr×d×dNo (complex)Physical interpretation, noise models
SuperOpd2×d2No (complex)Composition of channels, matrix operations
Chid2×d2No (complex)Process tomography
Choid2×d2No (complex)Positive semidefiniteness check, channel distance
PTMd2×d2YesGate benchmarking, RB analysis

Channel Composition

Channels compose via their representations:

Kraus: The composition E2E1 has Kraus operators {Ki(2)Kj(1)}i,j

SuperOp: SE2E1=SE2SE1 (matrix multiplication)

PTM: RE2E1=RE2RE1 (matrix multiplication, real-valued)

Choi: JE2E1=(E2I)(JE1)

Channel Distance and Fidelity

Diamond norm distance between two channels:

|E1E2|=supρ|(E1Ik)(ρ)(E2Ik)(ρ)|1

where the supremum is over all input dimensions k. The diamond norm is the standard distance measure for quantum channels.

Process fidelity:

Fproc(E,I)=1d2Tr(JEJI)

This measures how close a channel E is to the identity I, and is related to randomized benchmarking error rates.


Summary


See Also

Released under the MIT License.