Goal

After this module you can write any quantum channel in Kraus, Stinespring, superoperator and Choi form, convert between the four by hand and in code, and test complete positivity and trace preservation in the form where each test is easiest.

Module 1 treated an unknown state as the object to learn. From here on we also want to learn unknown processes: the noise on a gate, the evolution of a qubit while it waits, a whole layer of a circuit. A process takes a state in and gives a state out, so it is a map on density operators. Such a map is called a channel.

The same channel can be written in several ways, and each way makes a different question easy. Kraus operators are the natural output of a physical noise model. A Stinespring isometry says that every channel is a unitary on a larger system followed by discarding part of it. The superoperator is an ordinary matrix, so composing channels is matrix multiplication. The Choi matrix is a quantum state, so testing whether a map is physical becomes testing whether a matrix is positive semidefinite, and learning a channel becomes learning a state (Module 6).

Converting between these forms is mechanical but easy to get wrong: sources disagree on the order of tensor factors, on row versus column stacking, and on normalization. This module fixes one convention and derives every conversion from it: vectorization stacks columns, Choi matrices put the input factor first and have trace , and the superoperator is . These are also Qiskit’s conventions. The fourth common representation, the Pauli transfer matrix, needs the Pauli basis and is the subject of Module 3.

What a channel is

Which maps on density operators can a physical process implement? Three requirements come from the rules of quantum mechanics.

  • Linearity. If we prepare with probability and otherwise, the output must be the same mixture of the outputs. So the map is linear on mixtures, and extends to a linear map on all operators.
  • Trace preservation. Output probabilities must still sum to one: .
  • Complete positivity. The output must be a valid state even when the input is part of a larger, possibly entangled, system that the process does not touch.

The third requirement is the subtle one, and the reason the theory of channels differs from the theory of stochastic matrices.

Definition 2.1 (Quantum channel).

Let and . A linear map is

  1. positive if implies ;
  2. completely positive (CP) if is positive for every ancilla dimension , where is the identity map on matrices;
  3. trace preserving (TP) if for all .

A quantum channel is a linear map that is CP and TP (CPTP).

Positivity alone is not enough. The standard counterexample is the transpose.

Example 2.2 (The transpose is positive but not completely positive).

Let on qubits. The transpose keeps the eigenvalues of , so is positive and trace preserving. Now apply to the (unnormalized) Bell projector with :

The swap operator has eigenvalue on the singlet . A state of the pair would be mapped to an operator with a negative eigenvalue, which no process can produce. So is not CP and not a channel.

How big is a channel? A linear map from matrices to matrices has complex entries. Mapping Hermitian operators to Hermitian operators makes it real parameters, and trace preservation removes of them, leaving . A state has . This gap of a factor already hints that learning a channel costs more than learning a state, which Module 6 makes precise.

Kraus operators and the Stinespring dilation

How do we write down a CP map concretely? The answer is a sum of “sandwiches”.

The operators are Kraus operators. Any map of this form is CP: for any ancilla and any , is a sum of positive operators. It is TP exactly when the completeness relation on the right holds, because for every .

The converse, that every CP map has this form, is the main theorem of this section; in finite dimensions it is due to Kraus (2) and Choi (3).

Theorem 2.3 (Kraus and Stinespring representations).

Let be linear.

  1. is CP if and only if it has a Kraus form , and operators always suffice. It is moreover TP if and only if .
  2. (Stinespring) is a channel if and only if there are an environment and an isometry , , with

The Stinespring form (1) is the physical picture behind the algebra: every noisy process is a unitary interaction with an environment that we then ignore. When , the isometry can be completed to a unitary on system and environment with . This is also how a channel is simulated on a quantum computer: add ancilla qubits, apply , discard the ancillas.

Kraus operators are not unique. Mixing them with a unitary gives the same channel, and that is the only freedom.

Proposition 2.4 (Unitary freedom of Kraus operators).

Let and be two lists of operators (pad the shorter list with zero operators). They define the same map if and only if there is an unitary with for all .

A small snippet makes this concrete. We write the amplitude-damping channel, which models energy loss from to with probability , and check completeness:

import numpy as np
 
gamma = 0.3
K0 = np.array([[1, 0], [0, np.sqrt(1 - gamma)]], dtype=complex)
K1 = np.array([[0, np.sqrt(gamma)], [0, 0]], dtype=complex)
kraus = [K0, K1]
 
def apply_kraus(kraus, rho):
    return sum(K @ rho @ K.conj().T for K in kraus)
 
completeness = sum(K.conj().T @ K for K in kraus)
assert np.allclose(completeness, np.eye(2))          # trace preserving
 
plus = np.full((2, 2), 0.5, dtype=complex)            # |+><+|
out = apply_kraus(kraus, plus)
print(np.round(out.real, 4))   # [[0.65 0.4183] [0.4183 0.35]]

The population of drops from to , while the coherence drops from to : coherences decay at half the rate of populations. We will see this again as two eigenvalues of the superoperator.

Vectorization and the superoperator

Kraus operators describe a channel but do not make it a matrix. How do we compose two channels, or apply one a hundred times, without growing lists of Kraus operators? We turn operators into vectors.

For a matrix , let stack the columns of on top of each other. In bra-ket form, , and we also write . The Hilbert–Schmidt inner product becomes the ordinary one: .

Lemma 2.5 (Vectorizing a product).

For matrices of compatible sizes,

Applying to one Kraus term, with and so that (the entrywise complex conjugate), gives . Summing over :

Definition 2.6 (Superoperator).

The superoperator (or Liouville representation) of is the matrix with for all . For a channel with Kraus operators ,

Unlike the Kraus list, is unique: it is the matrix of the linear map in the basis . Its value is that the rules of linear algebra now apply directly.

Proposition 2.7 (What the superoperator makes easy).

Let be linear maps with matching dimensions.

  1. Composition is multiplication: (first apply , so stands on the right). In particular .
  2. Trace preservation is a left eigenvector: is TP if and only if .
  3. Unitality () is a right eigenvector: .
  4. Fixed points are eigenvectors with eigenvalue : if and only if .

Part 2 shows that every channel has as an eigenvalue of , with left eigenvector . A right eigenvector for this eigenvalue is a fixed operator, and there is always a fixed state: the averages are states, and any limit point of them satisfies . For amplitude damping the fixed state is ; for the identity channel every state is fixed, so fixed states need not be unique.

Complete positivity is invisible in the superoperator

is in general neither Hermitian nor positive, and its eigenvalues say nothing direct about CP. For example the transpose map of Example 2.2 has , a perfectly nice unitary matrix. To test CP we need to rearrange the same entries into a different matrix: the Choi matrix.

def vec(X):
    return X.reshape(-1, order="F")          # stack columns
 
def superop(kraus):
    return sum(np.kron(K.conj(), K) for K in kraus)
 
S = superop(kraus)
assert np.allclose(S @ vec(plus), vec(out))   # same output as the Kraus form
eye = vec(np.eye(2))
assert np.allclose(eye @ S, eye)              # trace preserving
print(np.allclose(S @ eye, eye))              # False: not unital
print(np.round(np.linalg.eigvals(S).real, 4)) # [1. 0.8367 0.8367 0.7]

The eigenvalues are the decay factors per application: the fixed point, the two coherences, and the population difference (whose eigenvector is ).

The Choi–Jamiołkowski isomorphism

Can we turn a channel into a state? Yes: feed it one half of a maximally entangled pair. The output is a state of the pair that remembers the whole channel.

Definition 2.8 (Choi matrix).

Let (unnormalized). The Choi matrix of a linear map is the operator on

The input factor comes first. For a channel with Kraus operators , .

The Kraus formula follows from , where the last step is column stacking ().

Reading as a block matrix: block of is , the image of the matrix unit. Since a linear map is fixed by what it does to a basis, is a linear bijection between linear maps and operators on (5). Every property of is therefore a property of , and the two most important ones become very simple. The first is due to Choi (3).

Theorem 2.9 (Choi's theorem).

A linear map is completely positive if and only if . In that case, if is any decomposition into rank-one terms (for example from an eigendecomposition), then are Kraus operators for . The smallest possible number of Kraus operators, the Kraus rank, equals .

Trace preservation and the action of the channel are read off with partial traces.

Proposition 2.10 (Trace preservation and the inverse map).

For a linear map with Choi matrix :

  1. is TP if and only if . Then , and is a density operator when is a channel.
  2. is unital if and only if .
  3. The channel is recovered from its Choi matrix by
Remark 2.11 (Other conventions in the literature).

Three conventions vary between sources, and conversions break silently when they are mixed. (i) Order of factors: some authors put the output first, . (ii) Stacking: some vectorize by rows, , which turns into and the superoperator into . Watrous (6) uses both output-first Choi matrices and row stacking, so converting from that book changes (i) and (ii) together. (iii) Normalization: some call the Choi matrix, with unit trace. These notes use input-first, column stacking, and trace , as Qiskit does and as Wood, Biamonte and Cory (7) tabulate.

def choi(kraus):
    return sum(np.outer(vec(K), vec(K).conj()) for K in kraus)
 
J = choi(kraus)
print(np.round(np.linalg.eigvalsh(J), 4))         # [0. 0. 0.3 1.7]: CP, rank 2
blocks = J.reshape(2, 2, 2, 2)                     # indices (i, a, j, b)
assert np.allclose(np.einsum("iaja->ij", blocks), np.eye(2))   # tr_out J = I: TP
 
def apply_choi(J, rho):
    d = rho.shape[0]
    W = (J @ np.kron(rho.T, np.eye(d))).reshape(d, d, d, d)
    return np.einsum("iaib->ab", W)               # tr_in
 
assert np.allclose(apply_choi(J, plus), out)

Moving between representations

We now have four descriptions of one channel. Figure 2.1 collects the conversion recipes. All of them were derived above except one: the arrow between the Choi matrix and the superoperator.

environment Stinespring V noise model Kraus {K_k} CP test, fitting Choi J compose, iterate superop S K_k = (1 x <k|) V V = sum K_k x |k> sum |K_k>><<K_k| eigenvectors sum conj(K_k) x K_k reshuffle
Figure 2.1. The four representations of this module and the recipes that convert between them. The Pauli transfer matrix of Module 3 is one more basis change away from the superoperator.

Reshuffling. and contain the same numbers , arranged differently. Write a composite index for the basis vector . From , the entry of in row and column is . From the definition of and , the same number sits in row and column of . Hence

This is a permutation of the four tensor indices, not a matrix transpose, and it is why one matrix can be positive while the other is not. In NumPy it is a reshape to a four-index tensor, a transpose of the axes, and a reshape back.

def superop_to_choi(S):
    d = int(np.sqrt(S.shape[0]))
    T = S.reshape(d, d, d, d)                 # axes (b, a, j, i)
    return T.transpose(3, 1, 2, 0).reshape(d * d, d * d)   # (i, a, j, b)
 
assert np.allclose(superop_to_choi(S), J)
 
def choi_to_kraus(J, tol=1e-12):
    d = int(np.sqrt(J.shape[0]))
    lam, V = np.linalg.eigh(J)
    return [np.sqrt(l) * V[:, k].reshape(d, d, order="F")
            for k, l in enumerate(lam) if l > tol]
 
kraus2 = choi_to_kraus(J)
assert np.allclose(superop(kraus2), S)        # a different Kraus list, same channel

The round trip Kraus Choi Kraus returns two operators, as the Kraus rank predicts, but not necessarily and themselves: by Proposition 2.4 they can differ by a unitary mixing.

Which representation should you use? The table summarizes the trade-offs.

RepresentationMakes easyTypical useCaution
Kraus CP is automatic; TP is noise models, simulationnot unique; composition multiplies list lengths
Stinespring physical interpretationcircuit implementation, purificationsenvironment dimension grows under composition
Superoperator composition, powers, fixed pointsrepeated channels, dynamicsCP is invisible
Choi CP is ; TP is tomography, SDP fitting, Kraus rankordering and normalization vary by source

Worked example: amplitude damping in every form

We collect the amplitude-damping computations of this module in one place. Every number below is checked in code/tests/test_worked_examples.py.

Example 2.12 (Amplitude damping with decay probability 0.3).

Kraus. , . Completeness: .

Superoperator. With column stacking the basis order is , and gives

The row vector is a left eigenvector (TP), but (not unital). The eigenvalue-one right eigenvector is : the ground state is the fixed point.

Choi. and , so

The two vectors are orthogonal, so the nonzero eigenvalues are their squared norms, and . Hence (CP) with Kraus rank , and . The blocks have traces , , , so (TP). The reshuffle moves the entry at position of to position of , and from the diagonal of to the corner of .

Repeated application. Starting from , uses of the channel give

read off from : it is upper triangular with diagonal , and the remaining corner entry is fixed by trace preservation. For the excited population is , the coherence is , and the trace distance to the fixed point is .

Figure 2.2 plots these three quantities against . On a log scale the population and the coherence are straight lines with slopes and , the logarithms of two superoperator eigenvalues. The trace distance, , approaches the coherence line for large .

Amplitude damping with decay probability 0.3, applied m times to the plus state: excited population, coherence and trace distance to the ground state, on a log scale. Population and coherence decay exponentially, the coherence at half the logarithmic rate, as the superoperator eigenvalues predict; the trace distance approaches the coherence line.
Figure 2.2. Amplitude damping with decay probability 0.3, applied m times to the plus state: excited population, coherence and trace distance to the ground state, on a log scale. Population and coherence decay exponentially, the coherence at half the logarithmic rate, as the superoperator eigenvalues predict; the trace distance approaches the coherence line.

Finally, Figure 2.3 returns to the gap between positivity and complete positivity. The family mixes the completely depolarizing channel with the transpose. Every with is positive and TP, but its Choi matrix has smallest eigenvalue , so is a channel only for . Proving this is Problem 2.2.

The mixture of complete depolarizing (weight 1 - t) and the transpose (weight t). Green: smallest output eigenvalue over pure inputs, the test for positivity. Brown: smallest Choi eigenvalue, the test for complete positivity. For t between 1/3 and 1 the map is positive but not a channel.
Figure 2.3. The mixture of complete depolarizing (weight 1 - t) and the transpose (weight t). Green: smallest output eigenvalue over pure inputs, the test for positivity. Brown: smallest Choi eigenvalue, the test for complete positivity. For t between 1/3 and 1 the map is positive but not a channel.

What breaks

  • Mixed conventions. Combining a Choi matrix built output-first with a reshuffle written for input-first, or a row-stacked superoperator with column-stacked vectors, gives matrices that look reasonable and are wrong. Always test a conversion by applying both sides to a random input, as the snippets do.
  • Noisy estimates are not physical. A Choi matrix estimated from finite data is usually not positive semidefinite and does not satisfy exactly. Taking its eigenvectors as Kraus operators then fails. The estimate has to be projected onto the CPTP set first (Module 6).
  • Exponential size. For qubits every representation here has entries, so none of them can be stored beyond a handful of qubits. Learning large systems needs structure, such as Pauli channels (Module 3, Module 12) or tensor networks (Module 14).
  • Non-Markovian noise. A channel describes one use of a process with a fresh environment each time. If the environment keeps memory between uses, no longer describes uses and the composition rule fails.

Why it matters

Every later module uses these representations. The Choi matrix turns process tomography into state tomography (Module 6). The superoperator, written in the Pauli basis, becomes the Pauli transfer matrix of Module 3, where noise is diagonalized by twirling. The measurement channel of classical shadows (Module 7) is inverted as a superoperator. And error mitigation (Module 13, Module 14) applies the inverse of an invertible, non-unitary noise channel, a map that is TP and Hermiticity preserving but never CP, which is exactly why it cannot be implemented directly and has to be simulated with signed weights.

Further reading

  • Nielsen and Chuang (4), Chapter 8: operator-sum representation, environment models and examples of noise channels.
  • Watrous (6), Chapter 2: a rigorous treatment of the Choi representation and complete positivity (with output-first conventions).
  • Wood, Biamonte and Cory (7): a conversion dictionary between all representations, with the column-stacking convention used here.
  • Anshu and Arunachalam (8), Section 2: channels and measurements in the language of learning theory.

Homework

The problems for this module are in Homework 2.

1.
Stinespring WF. Positive functions on C*-algebras. Proceedings of the American Mathematical Society. 1955;6(2):211–6.
2.
Kraus K. States, Effects, and Operations: Fundamental Notions of Quantum Theory. Springer; 1983. (Lecture Notes in Physics; vol. 190).
3.
Choi M-D. Completely positive linear maps on complex matrices. Linear Algebra and its Applications. 1975;10(3):285–90.
4.
Nielsen MA, Chuang IL. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press; 2010.
5.
Jamiołkowski A. Linear transformations which preserve trace and positive semidefiniteness of operators. Reports on Mathematical Physics. 1972;3(4):275–8.
6.
Watrous J. The Theory of Quantum Information. Cambridge University Press; 2018.
7.
Wood CJ, Biamonte JD, Cory DG. Tensor networks and graphical calculus for open quantum systems. Quant Inf Comp 15, 0759-0811 (2015). 2015;
8.
Anshu A, Arunachalam S. A survey on the complexity of learning quantum states. arXiv preprint arXiv:230520069. 2023;