Chapter 12

Quantum Information and Quantum Computing

12.1Introduction

Earlier chapters asked what a quantum system's energy levels are. This one asks what can be computed with it.

No new postulates. States, operators, the Born rule and the tensor product are the same tools from Chapter 1. One simplification keeps the discussion clear: every Hilbert space here is finite-dimensional. A state is a complex column vector, an observable is a matrix, and each key claim can be verified by hand.

Chapter 1 deferred density operators and entanglement to “advanced courses on quantum information” (Sec. 1.7.4). This chapter is that missing bridge.

Skipped: Shor's algorithm (it needs the quantum Fourier transform), error correcting codes, and open-system theory beyond Sec. 12.13.

The chapter has four objectives: to distinguish a qubit from a classical random bit, to read simple quantum circuits, to establish why interference gives an algorithmic advantage, and to explain why decoherence is the main engineering bottleneck.

Remark 12.1.1A map of the field

Dominic Walliman's Map of Quantum Computing puts the whole field on one page. It serves as a useful companion to this chapter; see Sec. 12.17.

12.2Classical Information

Definition 12.2.1Bit

A bit is a system with two distinguishable states, 0 and 1 .

A light switch is the simplest example. It is either up or down, and its state can be determined by inspection. A set of n bits has 2 n possible configurations.

When the state is not known, as for a flipped coin covered by a hand, it is described by a probability vector:

𝐩 = ( p 0 p 1 ) , p 0 , p 1 ≥ 0 , p 0 + p 1 = 1 . (12.1)

This vector describes incomplete knowledge, not a physical superposition. The coin itself is still either heads or tails.

Operations on one bit, as matrices acting on 𝐩 :

I = ( 1 0 0 1 ) , NOT = ( 0 1 1 0 ) , M = ( 1 2 1 2 1 2 1 2 ) , (12.2)

M means “discard the old bit and replace it with a fair random one”.

Theorem 12.2.1Which matrices act on probability vectors

M maps every probability vector to a probability vector iff every entry is non-negative and every column sums to 1 — a stochastic matrix.

( ⇒ ) M 𝐞 j is the j -th column, and 𝐞 j is a probability vector. ( ⇐ ) M 𝐩 = ∑ j p j ( M 𝐞 j ) is a non-negative combination of probability vectors, totalling ∑ j p j = 1 .

Reversibility. NOT undoes itself. AND does not: given a ∧ b = 0 , the values of a and b cannot be recovered. AND therefore destroys information. By Landauer's principle, erasing one bit dissipates at least k B T ln ⁡ 2 ≈ 3 × 10 − 21 J at room temperature. In contrast, every ideal quantum gate in this chapter is reversible.

12.3Quantum Information

Definition 12.3.1Qubit

A qubit is a two-dimensional Hilbert space with a chosen orthonormal basis

{ | 0 ⟩ , | 1 ⟩ } , ⟨ 0 | 0 ⟩ = ⟨ 1 | 1 ⟩ = 1 , ⟨ 0 | 1 ⟩ = 0 , (12.3)

the computational basis.

Easiest example: a spin- 1 2 , | 0 ⟩ = | ↑ ⟩ , | 1 ⟩ = | ↓ ⟩ . Chapter 6's two-level atom does as well. Which system it is matters only in Sec. 12.8.

The chosen basis is part of the definition. A spin has no preferred axis until one is chosen; a qubit is a two-level system together with that computational choice.

| ψ ⟩ = α | 0 ⟩ + β | 1 ⟩ , α , β ∈ ℂ , | α | 2 + | β | 2 = 1 . (12.4)

Compare with Eq. (12.1). Both descriptions use two numbers, but the meaning is different: classical entries are non-negative probabilities, while quantum entries are complex amplitudes whose squared moduli sum to one. Most of the conceptual difference between classical and quantum information comes from this one change.

12.3.1Measurement

Definition 12.3.2Projective measurement

Orthogonal projectors { Π ˆ k } with

Π ˆ k † = Π ˆ k , Π ˆ j Π ˆ k = δ j k Π ˆ k , ∑ k Π ˆ k = I ˆ , (12.5)

giving outcome k with probability

p k = ⟨ ψ | Π ˆ k | ψ ⟩ = ‖ Π ˆ k | ψ ⟩ ‖ 2 , | ψ k ⟩ = Π ˆ k | ψ ⟩ p k . (12.6)

In the computational basis Π ˆ 0 = | 0 ⟩ ⟨ 0 | , Π ˆ 1 = | 1 ⟩ ⟨ 1 | , so p 0 = | α | 2 , p 1 = | β | 2 .

Two essential differences from classical readout now appear. Measurement changes the state, and one run returns only one classical bit even though the state was described by complex amplitudes.

To measure in another basis { | u k ⟩ } , rotate first — hardware typically measures in the computational basis only:

| ⟨ u k | ψ ⟩ | 2 = | ⟨ k | V ˆ | ψ ⟩ | 2 , V ˆ | u k ⟩ = | k ⟩ . (12.7)

12.3.2Global Phase

Theorem 12.3.1Global phase is invisible

| ψ ′ ⟩ = e i γ | ψ ⟩ gives identical probabilities, expectation values and evolution.

| ⟨ k | ψ ′ ⟩ | 2 = | e i γ | 2 | ⟨ k | ψ ⟩ | 2 = | ⟨ k | ψ ⟩ | 2 ; and ⟨ ψ ′ | A ˆ | ψ ′ ⟩ = e − i γ e i γ ⟨ ψ | A ˆ | ψ ⟩ . Linearity carries e i γ through any U ˆ , so both apply at all later times.

A relative phase is physical: | 0 ⟩ + | 1 ⟩ and | 0 ⟩ − | 1 ⟩ are orthogonal and therefore experimentally distinguishable. Keeping global and relative phase separate prevents many later mistakes.

12.4What Makes Quantum Information Useful

The central mechanism is interference. Probabilities are non-negative, so classical paths only add. Complex amplitudes can add or cancel, and that controlled cancellation is what quantum algorithms exploit.

Example 12.4.1Randomizing twice

Apply M of Eq. (12.2), and the Hadamard gate H ˆ = 1 2 ( 1 1 1 − 1 ) , twice each. After one application, both turn a definite input into fifty-fifty outcomes.

Solution.

Classically M 2 = M : randomizing a random bit leaves it random. Both routes from “ 0 ” to “ 1 ” contribute + 1 4 , and 1 4 + 1 4 cannot vanish.

Quantum mechanically H ˆ | 0 ⟩ = | + ⟩ , also fifty-fifty. But the second Hadamard recombines paths with phase:

H ˆ | + ⟩ = | + ⟩ + | − ⟩ 2 = 1 2 ( | 0 ⟩ + | 1 ⟩ + | 0 ⟩ − | 1 ⟩ ) = | 0 ⟩ .

The two routes to | 1 ⟩ carried + 1 2 and − 1 2 and canceled. As matrices, H ˆ 2 = I ˆ while M has no inverse.

Probabilistic bitQubit
State 𝐩 , entries ≥ 0 | ψ ⟩ , entries in ℂ
Constraint ∑ j p j = 1 ∑ j | α j | 2 = 1
Operationsstochasticunitary
Reversible?only permutationsalways
Cancellation?impossibleroutine
Reading itfree, repeatabledisturbs; one bit out
Copying itfreeimpossible (Thm. 12.12.1)
Remark 12.4.1 2 n amplitudes is not 2 n answers

An n -qubit state holds 2 n amplitudes, but measuring returns n bits, corresponding to one random branch. The amplitudes are not an answer sheet; they are a medium in which interference can be engineered. Designing that interference, not “reading all branches,” is the heart of quantum algorithm design.

12.5Qubits and Gates

12.5.1The Bloch Sphere

The Bloch sphere is the standard geometric picture for pure one-qubit states. Start from Eq. (12.4) and separate magnitude and phase:

Write α = r 0 e i γ 0 , β = r 1 e i γ 1 . Divide out e i γ 0 (Theorem 12.3.1); only φ = γ 1 − γ 0 survives. Then r 0 2 + r 1 2 = 1 is solved by r 0 = cos ⁡ ( θ / 2 ) , r 1 = sin ⁡ ( θ / 2 ) — which is where the half-angle comes from:

| ψ ⟩ = cos ⁡ θ 2 | 0 ⟩ + e i φ sin ⁡ θ 2 | 1 ⟩ , θ ∈ [ 0 , π ] , φ ∈ [ 0 , 2 π ) (12.8)
Definition 12.5.1Bloch vector
r → = ( ⟨ X ˆ ⟩ , ⟨ Y ˆ ⟩ , ⟨ Z ˆ ⟩ ) , (12.9)

with X ˆ , Y ˆ , Z ˆ the Pauli matrices of Eq. (3.26).

Using ⟨ Z ˆ ⟩ = | α | 2 − | β | 2 , ⟨ X ˆ ⟩ = 2 Re ( α ∗ β ) , ⟨ Y ˆ ⟩ = 2 Im ( α ∗ β ) ,

r → = ( sin ⁡ θ cos ⁡ φ , sin ⁡ θ sin ⁡ φ , cos ⁡ θ ) , (12.10)

the unit vector at ( θ , φ ) . Pure states lie on the surface; Sec. 12.13 treats mixed states inside the sphere.

The state (/2)0+e^i(/2)1 on the Bloch sphere. States orthogonal in Hilbert space are antipodal here, not perpendicular — the half-angle does that.
Figure 12.1. The state cos ⁡ ( θ / 2 ) | 0 ⟩ + e i φ sin ⁡ ( θ / 2 ) | 1 ⟩ on the Bloch sphere. States orthogonal in Hilbert space are antipodal here, not perpendicular — the half-angle does that.
NameState ( θ , φ ) r →
| 0 ⟩ | 0 ⟩ ( 0 , − ) + e → z
| 1 ⟩ | 1 ⟩ ( π , − ) − e → z
| + ⟩ 1 2 ( | 0 ⟩ + | 1 ⟩ ) ( π / 2 , 0 ) + e → x
| − ⟩ 1 2 ( | 0 ⟩ − | 1 ⟩ ) ( π / 2 , π ) − e → x
| + i ⟩ 1 2 ( | 0 ⟩ + i | 1 ⟩ ) ( π / 2 , π / 2 ) + e → y
| − i ⟩ 1 2 ( | 0 ⟩ − i | 1 ⟩ ) ( π / 2 , 3 π / 2 ) − e → y

12.5.2What a Gate Is

Definition 12.5.2Quantum gate

A gate on n qubits is a unitary operator on their 2 n -dimensional space.

Theorem 12.5.1Which matrices act on state vectors

U ˆ maps normalized states to normalized states — equivalently preserves inner products — iff U ˆ † U ˆ = I ˆ .

If U ˆ † U ˆ = I ˆ then ⟨ U ˆ ψ | U ˆ φ ⟩ = ⟨ ψ | φ ⟩ . Conversely ⟨ ψ | ( U ˆ † U ˆ − I ˆ ) | φ ⟩ = 0 for all | ψ ⟩ , | φ ⟩ forces U ˆ † U ˆ = I ˆ ; in finite dimensions this also gives U ˆ U ˆ † = I ˆ .

Theorems 12.2.1 and 12.5.1 are the comparison in two lines: stochastic matrices preserve probability, unitaries preserve amplitudes and inner products. Every gate is reversible; the only irreversible step in this chapter is measurement.

12.6Single-Qubit Gates

X ˆ = ( 0 1 1 0 ) , Y ˆ = ( 0 − i i 0 ) , Z ˆ = ( 1 0 0 − 1 ) , H ˆ = 1 2 ( 1 1 1 − 1 ) , (12.11)
P ˆ ( λ ) = ( 1 0 0 e i λ ) , S ˆ = P ˆ ( π / 2 ) , T ˆ = P ˆ ( π / 4 ) . (12.12)

X ˆ is NOT. Z ˆ flips the sign of | 1 ⟩ : invisible in the computational basis, decisive in the | ± ⟩ basis, where Z ˆ | + ⟩ = | − ⟩ . H ˆ converts between computational and | ± ⟩ bases and creates superpositions. T ˆ is the non-Clifford gate in this list; Sec. 12.10.1 explains why that single difference is crucial.

Four identities, each one matrix multiplication:

H ˆ X ˆ H ˆ = Z ˆ , H ˆ Z ˆ H ˆ = X ˆ , S ˆ 2 = Z ˆ , T ˆ 2 = S ˆ . (12.13)

The first two say bit flip and phase flip are one operation seen in two bases.

12.6.1Every Gate Is a Rotation

Definition 12.6.1Rotation operators
R ˆ n → ( θ ) = exp ( − i θ 2 n → ⋅ σ → ) , n → ⋅ σ → = n x X ˆ + n y Y ˆ + n z Z ˆ . (12.14)
Theorem 12.6.1Closed form
R ˆ n → ( θ ) = cos ⁡ θ 2 I ˆ − i sin ⁡ θ 2 n → ⋅ σ → (12.15)

and it rotates the Bloch vector by θ about n → .

Everything rests on ( n → ⋅ σ → ) 2 = I ˆ . From σ i σ j = δ i j I ˆ + i ε i j k σ k ,

( n → ⋅ σ → ) 2 = ∑ i , j n i n j δ i j I ˆ + i ∑ i , j , k ε i j k n i n j σ k = | n → | 2 I ˆ = I ˆ ,

the second sum vanishing because ε i j k is antisymmetric in i ↔ j and n i n j symmetric. With A ˆ = n → ⋅ σ → , so A ˆ 2 k = I ˆ and A ˆ 2 k + 1 = A ˆ , split the exponential series into even and odd powers to get cos ⁡ ( θ / 2 ) I ˆ − i sin ⁡ ( θ / 2 ) A ˆ . The geometric statement is Exercise E3.

Theorem 12.6.2Every single-qubit gate is a rotation

Every 2 × 2 unitary is U ˆ = e i γ R ˆ n → ( θ ) .

Put e i γ = ( det ⁡ U ˆ ) 1 / 2 , so V ˆ = e − i γ U ˆ has det ⁡ V ˆ = 1 and hence the form ( u v − v ∗ u ∗ ) with | u | 2 + | v | 2 = 1 . Setting u = a 0 − i a 3 , v = − a 2 − i a 1 with real a i , expanding a 0 I ˆ − i ( a 1 X ˆ + a 2 Y ˆ + a 3 Z ˆ ) reproduces V ˆ , and ∑ i a i 2 = 1 . So a 0 = cos ⁡ ( θ / 2 ) and ( a 1 , a 2 , a 3 ) = sin ⁡ ( θ / 2 ) n → , which is Eq. (12.15).

Example 12.6.1Hadamard as a rotation

Find its axis and angle.

Solution.

H ˆ = 1 2 ( X ˆ + Z ˆ ) = n → ⋅ σ → with n → = 1 2 ( 1 , 0 , 1 ) . At θ = π , Eq. (12.15) gives R ˆ n → ( π ) = − i n → ⋅ σ → = − i H ˆ , so H ˆ = e i π / 2 R ˆ n → ( π ) : a half turn about the axis halfway between x and z . That exchanges the + z and + x poles, which is | 0 ⟩ ↔ | + ⟩ ; and H ˆ 2 = I ˆ because two half turns make a full one.

12.7Making a Gate: From Pulse to Rotation

This section connects abstract gates to laboratory control. The same driven two-level dynamics from Chapter 6 produces these gates directly, and the rotation angle is set by pulse area.

Take Chapter 6's rotating-wave equations, Eq. (6.15), with | 0 ⟩ the ground state ( c 1 ) and | 1 ⟩ the excited state ( c 2 ). Move to the frame rotating at the drive frequency,

c 1 = e − i Δ t / 2 b 1 , c 2 = e + i Δ t / 2 b 2 , (12.16)

so the first equation becomes

e − i Δ t / 2 ( i b ˙ 1 + Δ 2 b 1 ) = Ω 2 e − i Δ t e + i Δ t / 2 b 2 = Ω 2 e − i Δ t / 2 b 2 , (12.17)

and, with the second, after cancelling exponentials

i b ˙ 1 = − Δ 2 b 1 + Ω 2 b 2 , i b ˙ 2 = Ω 2 b 1 + Δ 2 b 2 . (12.18)

The explicit time dependence is gone. Reading off the matrix,

H ˆ rot = ℏ 2 ( − Δ Ω Ω Δ ) = ℏ 2 ( Ω X ˆ − Δ Z ˆ ) (12.19)

A drive phase ϕ replaces Ω X ˆ by Ω ( cos ⁡ ϕ X ˆ + sin ⁡ ϕ Y ˆ ) .

Theorem 12.7.1A driven two-level system executes a rotation

Driving for time t at Rabi frequency Ω , detuning Δ and phase ϕ applies

U ˆ ( t ) = R ˆ n → ( θ ) , θ = Ω R t , n → = ( Ω cos ⁡ ϕ , Ω sin ⁡ ϕ , − Δ ) Ω R , (12.20)

with Ω R = Ω 2 + Δ 2 . For a shaped pulse the angle is the pulse area θ = ∫ Ω d t .

H ˆ rot = ℏ 2 Ω R n → ⋅ σ → , so e − i H ˆ rot t / ℏ is Eq. (12.14) with θ = Ω R t .

Three consequences are used constantly in hardware control.

Resonant driving rotates in the equatorial plane. Δ = 0 puts n → in the x y plane and ϕ chooses where. A resonant π pulse with ϕ = 0 gives R ˆ e → x ( π ) = − i X ˆ — Chapter 6's population inversion, relabelled.

Detuning alone gives a Z ˆ rotation. Ω = 0 gives R ˆ − e → z ( Δ t ) . No pulse needed, which is why machines implement Z ˆ by shifting the phase of later pulses: essentially zero duration and usually very low error.

Hadamard is two pulses. With ϕ = π / 2 and θ = π / 2 ,

R ˆ e → y ( π / 2 ) = 1 2 ( 1 − 1 1 1 ) , X ˆ R ˆ e → y ( π / 2 ) = H ˆ . (12.21)
Excited-state population against pulse area, Eq. (6.16). On resonance the area alone fixes the gate. Off resonance the oscillation never reaches 1, so a detuned pulse cannot be made into an X gate by adjusting its duration.
Figure 12.2. Excited-state population against pulse area, Eq. (6.16). On resonance the area alone fixes the gate. Off resonance the oscillation never reaches 1 , so a detuned pulse cannot be made into an X ˆ gate by adjusting its duration.
Remark 12.7.1Consistency check

From Eq. (12.15), ⟨ 1 | R ˆ n → ( θ ) | 0 ⟩ = − i ( Ω / Ω R ) sin ⁡ ( Ω R t / 2 ) , whose modulus squared is Eq. (6.16) exactly. The gate picture and the Rabi picture are one calculation.

Example 12.7.1Calibrating a gate

A superconducting qubit is driven at Ω / 2 π = 25 MHz on resonance. (a) How long is an X ˆ gate? (b) The amplitude drifts high by 1 % ; what is the error?

Solution.

(a) θ = Ω t = π gives

t π = π Ω = 1 5.0 × 10 7   s − 1 = 20   ns .

(b) Area π ( 1 + δ ) instead of π , so

ϵ = 1 − sin 2 ( π ( 1 + δ ) 2 ) = sin 2 ( π δ 2 ) ≈ ( π δ 2 ) 2 = 2.5 × 10 − 4

for δ = 0.01 . The error is quadratic in the miscalibration: 1 % buys 10 − 4 , and reaching 10 − 4 needs only δ < 0.64 % .

12.8Coherence and Hardware

Real qubits are never perfectly isolated, so two different noise mechanisms must be tracked separately.

Definition 12.8.1Relaxation and coherence times

T 1 , the relaxation time: an excited qubit decays, P 1 ( t ) = P 1 ( 0 ) e − t / T 1 . Energy leaves.

T 2 , the coherence or dephasing time: a superposition loses its relative phase. No energy leaves; the phase becomes unknown.

On the Bloch sphere: T 1 pulls r → toward the pole, T 2 shrinks its equatorial component. So | + ⟩ is fragile to dephasing, while | 0 ⟩ and | 1 ⟩ are unaffected by pure phase noise.

Example 12.8.1Dephasing is not decay

Let the relative phase of | + ⟩ drift by an unknown ϕ .

Solution.

The state is 1 2 ( | 0 ⟩ + e i ϕ | 1 ⟩ ) . In the computational basis the answer is 1 2 , 1 2 for any ϕ : nothing decayed, populations untouched.

In the | ± ⟩ basis, ϕ = 0 gives | + ⟩ with certainty; averaged over unknown ϕ it is fifty-fifty. What is gone is the interference of Example 12.4.1, on which the whole subject depends, while the populations remain unchanged. This is why T 2 , not T 1 , limits computation. Section 12.13 writes it down properly.

T 2 ≤ 2 T 1 , N gates ∼ T 2 t gate . (12.22)

The first because energy decay also destroys phase. The second is the only figure of merit that matters: not lifetime, not speed, but how many operations fit inside the coherence.

The two decays. T1 empties the excited state; T2 destroys the coherence that makes interference possible, at least twice as fast. The dotted line is one gate time for a superconducting qubit.
Figure 12.3. The two decays. T 1 empties the excited state; T 2 destroys the coherence that makes interference possible, at least twice as fast. The dotted line is one gate time for a superconducting qubit.

12.8.1What Qubits Are Made Of

Every platform below is a two-level system driven near resonance — that is, every one is Chapter 6, and Theorem 12.7.1 applies unchanged to all of them.

PlatformThe two levelsControlCoherence
Superconductinglowest two of anmicrowave 10 2 – 10 3   μ s
(transmon)anharmonic circuitpulsesgates ∼ 20 ns
[3pt] Trapped iontwo atomic levelslasers,seconds
of an ionmicrowavesgates ∼ 10   μ s
[3pt] Neutral atomatomic levels;lasersseconds
Rydberg for coupling
[3pt] Photonicpolarization or pathinterferometersloss, not decay
[3pt] Spinelectron or nuclearmicrowaves,ms (NV center)
(dot, donor, NV)spin- 1 2 magnetic fields
[3pt] Topologicalnon-abelian anyonsbraidingin principle immune

Superconducting qubits emphasize fast gates and integration but have shorter coherence. Trapped ions offer much longer coherence but slower gates. When compared through N gates ∼ T 2 / t gate , their effective computational windows are closer than raw coherence times alone suggest. Topological qubits remain the most speculative platform.

12.9Two Qubits

Two qubits already introduce genuinely new behavior because the joint space is 2 × 2 = 4 dimensional:

| 00 ⟩ ,   | 01 ⟩ ,   | 10 ⟩ ,   | 11 ⟩ , | a b ⟩ ≡ | a ⟩ ⊗ | b ⟩ . (12.23)

As columns and matrices, the tensor product is the Kronecker product:

( α 0 α 1 ) ⊗ ( β 0 β 1 ) = ( α 0 β 0 α 0 β 1 α 1 β 0 α 1 β 1 ) , ( A ˆ ⊗ B ˆ ) ( | ψ ⟩ ⊗ | φ ⟩ ) = A ˆ | ψ ⟩ ⊗ B ˆ | φ ⟩ . (12.24)
Remark 12.9.1Qubit ordering

Here the left symbol is the first tensor factor. Qiskit puts qubit 0 on the right, which swaps the middle two rows and columns of controlled-gate matrices. This is only a convention, but mixing conventions is a common source of errors.

12.9.1Entanglement

Definition 12.9.1Product and entangled

| Ψ ⟩ is a product state if | Ψ ⟩ = | ψ ⟩ ⊗ | φ ⟩ , and entangled otherwise.

Theorem 12.9.1The Bell state is entangled

| Φ + ⟩ = 1 2 ( | 00 ⟩ + | 11 ⟩ ) does not factorize.

If ( a | 0 ⟩ + b | 1 ⟩ ) ⊗ ( c | 0 ⟩ + d | 1 ⟩ ) , matching coefficients needs a c = b d = 1 2 and a d = b c = 0 . From a c ≠ 0 , a ≠ 0 , so a d = 0 forces d = 0 — contradicting b d ≠ 0 .

Definition 12.9.2Bell basis
| Φ ± ⟩ = | 00 ⟩ ± | 11 ⟩ 2 , | Ψ ± ⟩ = | 01 ⟩ ± | 10 ⟩ 2 . (12.25)

An intuitive picture is two perfectly correlated coins. Example 12.9.2 shows that this agreement survives a change of measurement basis.

Remark 12.9.2An entangled state met earlier

Chapter 5's spin singlet is | Ψ − ⟩ . Entanglement is what antisymmetrization has been doing since then. One caution: for identical particles some of it is bookkeeping, required by statistics; for distinguishable qubits it is entirely physical.

12.9.2Controlled Gates

Definition 12.9.3Controlled- U ˆ
C ˆ U = | 0 ⟩ ⟨ 0 | ⊗ I ˆ + | 1 ⟩ ⟨ 1 | ⊗ U ˆ (12.26)

Operationally: if the control is | 0 ⟩ , do nothing; if it is | 1 ⟩ , apply U ˆ to the target. If the control is in superposition, linearity applies both branches at once; this is the circuit-level route to entanglement.

With U ˆ = X ˆ :

CNOT = ( 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 ) , CNOT | a , b ⟩ = | a , a ⊕ b ⟩ . (12.27)

With U ˆ = Z ˆ , CZ = diag ( 1 , 1 , 1 , − 1 ) , which is symmetric, so that there is no way to tell which qubit was the control.

Example 12.9.1The simplest entangling circuit

Apply H ˆ to the first qubit, then CNOT .

Solution.

( H ˆ ⊗ I ˆ ) | 00 ⟩ = | 00 ⟩ + | 10 ⟩ 2 → CNOT | 00 ⟩ + | 11 ⟩ 2 = | Φ + ⟩ .

The other inputs give | 01 ⟩ ↦ | Ψ + ⟩ , | 10 ⟩ ↦ | Φ − ⟩ , | 11 ⟩ ↦ | Ψ − ⟩ . Since an orthonormal basis maps to an orthonormal basis it is unitary. Run backward, it converts the Bell basis to the computational basis, i.e. a Bell measurement, which is the key primitive used throughout Sec. 12.12.

The circuit of Example 12.9.1. Read right to left, the circuit performs a Bell measurement.
Figure 12.4. The circuit of Example 12.9.1. Read right to left, the circuit performs a Bell measurement.
Example 12.9.2The correlation survives a change of basis

Both parties measure their half of | Φ + ⟩ , first in the computational basis, then in the | ± ⟩ basis.

Solution.

Computational: no | 01 ⟩ or | 10 ⟩ component, so those outcomes have probability zero and the results always agree.

Substituting | 0 ⟩ = 1 2 ( | + ⟩ + | − ⟩ ) and | 1 ⟩ = 1 2 ( | + ⟩ − | − ⟩ ) , the mixed terms cancel:

| Φ + ⟩ = | + + ⟩ + | − − ⟩ 2 .

Same form, so they agree again. Yet each qubit alone is a fair coin in both bases (Eq. (12.49)). No assignment of definite values reproduces this and the intermediate angles too; Sec. 12.12.4 makes that quantitative.

12.10Many Qubits

For n qubits, basis states | x ⟩ are labeled by n -bit strings:

| Ψ ⟩ = ∑ x ∈ { 0 , 1 } n c x | x ⟩ , ∑ x | c x | 2 = 1 . (12.28)

2 n amplitudes are required; storing 50 qubits exactly already needs about 16 petabytes.

Two identities drive the algorithm section that follows:

H ˆ ⊗ n | 00 ⋯ 0 ⟩ = 1 2 n ∑ x | x ⟩ , (12.29)

an equal superposition of all 2 n strings from n gates, and

H ˆ ⊗ n | x ⟩ = 1 2 n ∑ z ( − 1 ) x ⋅ z | z ⟩ , x ⋅ z = ∑ i x i z i mod 2 , (12.30)

which follows from H ˆ | x i ⟩ = 1 2 ( | 0 ⟩ + ( − 1 ) x i | 1 ⟩ ) on each qubit.

Definition 12.10.1Quantum circuit

A quantum circuit is a sequence of gates on specified qubits (one line per qubit, read left to right). Algebraically, the whole circuit is one unitary:

U ˆ circuit = U ˆ L ⋯ U ˆ 2 U ˆ 1 , (12.31)

where the order is reversed because state vectors are multiplied from the right.

Example 12.10.1Control is not absolute

Conjugating CNOT by Hadamards on both qubits swaps control and target.

Solution.

Push the Hadamards inside Eq. (12.26), using H ˆ | 0 ⟩ = | + ⟩ , H ˆ | 1 ⟩ = | − ⟩ and H ˆ X ˆ H ˆ = Z ˆ :

| + ⟩ ⟨ + | ⊗ I ˆ + | − ⟩ ⟨ − | ⊗ Z ˆ = 1 2 ( I ˆ ⊗ I ˆ + I ˆ ⊗ Z ˆ + X ˆ ⊗ I ˆ − X ˆ ⊗ Z ˆ ) ,

using | ± ⟩ ⟨ ± | = 1 2 ( I ˆ ± X ˆ ) . Expanding a CNOT controlled by the second qubit gives the same operator. Which qubit is “the control” is a statement about the basis, not the physics.

12.10.1Universality

Theorem 12.10.1Universality, without proof

{ H ˆ , T ˆ , CNOT } approximates any n -qubit unitary to any ε ; Solovay–Kitaev needs only O ( ln c ⁡ ( 1 / ε ) ) gates per single-qubit gate.

Two caveats and one payoff. First, universality does not imply efficiency: a generic n -qubit unitary still needs about 4 n elementary gates. Second, H ˆ together with CNOT is still not universal; this is the Clifford set, which remains efficiently classically simulable (Gottesman–Knill). The non-Clifford gate T ˆ is what breaks that simulability. The payoff is practical: scalable quantum computing reduces to implementing a small gate set with very high fidelity.

12.11Three Quantum Algorithms

All three algorithms share one structure: prepare superposition, encode information about f into phase, interfere, then measure. The complexity question is the same each time: how many oracle calls are required?

12.11.1The Oracle and Phase Kickback

The map | x ⟩ ↦ | f ( x ) ⟩ is generally irreversible. To make a unitary oracle, add one target qubit:

U ˆ f | x ⟩ | y ⟩ = | x ⟩ | y ⊕ f ( x ) ⟩ , (12.32)

reversible because y ⊕ f ⊕ f = y .

Theorem 12.11.1Phase kickback
U ˆ f | x ⟩ | − ⟩ = ( − 1 ) f ( x ) | x ⟩ | − ⟩ (12.33)

U ˆ f | x ⟩ 1 2 ( | 0 ⟩ − | 1 ⟩ ) = | x ⟩ 1 2 ( | f ( x ) ⟩ − | 1 ⊕ f ( x ) ⟩ ) . For f ( x ) = 0 the bracket is | 0 ⟩ − | 1 ⟩ ; for f ( x ) = 1 it is | 1 ⟩ − | 0 ⟩ . Both equal ( − 1 ) f ( x ) 2 | − ⟩ .

The value of f ( x ) is now stored in a phase factor, where interference can act on it. The auxiliary qubit returns to | − ⟩ and can be ignored in later analysis.

12.11.2Deutsch: One Query Instead of Two

Problem. f : { 0 , 1 } → { 0 , 1 } is constant ( f ( 0 ) = f ( 1 ) ) or balanced. Which? Classically needs two evaluations.

Circuit. Prepare | 0 ⟩ | 1 ⟩ ; H ˆ on both; U ˆ f ; H ˆ on the first; measure the first.

Theorem 12.11.2Deutsch

The measurement gives 0 for constant and 1 for balanced, with certainty, after one call.

After the Hadamards, | + ⟩ | − ⟩ . Kickback on each term gives

( − 1 ) f ( 0 ) | 0 ⟩ + ( − 1 ) f ( 1 ) | 1 ⟩ 2 | − ⟩ .

Drop the overall ( − 1 ) f ( 0 ) (Theorem 12.3.1); the first register is | + ⟩ if f ( 0 ) = f ( 1 ) and | − ⟩ otherwise. The final H ˆ sends these to | 0 ⟩ and | 1 ⟩ .

Remark 12.11.1What was gained

The algorithm never learns f ( 0 ) or f ( 1 ) — it learns f ( 0 ) ⊕ f ( 1 ) , a global property, without learning either value. This is the general form of the speed-ups considered here: not many answers at once, but a single question about all of them.

12.11.3Bernstein–Vazirani: n Bits in One Query

Problem. f ( x ) = a ⋅ x mod 2 for a hidden n -bit string a . Find a . Classically n queries, one bit at a time.

Circuit. | 0 ⟩ ⊗ n | 1 ⟩ ; H ˆ everywhere; U ˆ f ; H ˆ ⊗ n on the first register; measure.

Theorem 12.11.3Bernstein–Vazirani

The measurement returns a with certainty, after one call.

Kickback turns Eq. (12.29) into 2 − n / 2 ∑ x ( − 1 ) a ⋅ x | x ⟩ . Applying Eq. (12.30),

1 2 n ∑ z [ ∑ x ( − 1 ) x ⋅ ( a ⊕ z ) ] | z ⟩ .

The inner sum is 2 n for z = a and zero otherwise, since for a ⊕ z ≠ 0 the terms cancel in pairs. The state is | a ⟩ .

Example 12.11.1 n = 2 , a = 11

Solution.

a ⋅ x = x 1 ⊕ x 2 , so the kickback signs are + , − , − , + :

1 2 ( | 00 ⟩ − | 01 ⟩ − | 10 ⟩ + | 11 ⟩ ) = | − ⟩ | − ⟩ .

It factorizes, and H ˆ | − ⟩ = | 1 ⟩ on each qubit gives | 11 ⟩ = | a ⟩ .

12.11.4Grover: Searching in N

Problem. f ( x ) = 1 for exactly one marked string w among N = 2 n . Find w . Classically N / 2 calls on average.

Idea. Start from the equal superposition and repeat two steps:

  1. Mark. U ˆ w = I ˆ − 2 | w ⟩ ⟨ w | flips the sign of the marked amplitude.

  2. Reflect about the average. U ˆ s = 2 | s ⟩ ⟨ s | − I ˆ sends c x ↦ 2 c ¯ − c x .

Step 1 puts the marked amplitude furthest below the average; step 2 lifts it furthest.

Theorem 12.11.4Grover

After k rounds the marked amplitude is sin ⁡ ( ( 2 k + 1 ) ϑ ) with sin ⁡ ϑ = 1 / N , so the best choice is

k ≈ π 4 ϑ − 1 2 ≈ π 4 N . (12.34)

The dynamics stays in the two-dimensional plane spanned by | w ⟩ and the equal superposition of unmarked states. In that plane, each Grover round is a rotation by 2 ϑ toward | w ⟩ .

Example 12.11.2Four items, one query, certainty

N = 4 , two qubits, marked item w = 10 .

Solution.

sin ⁡ ϑ = 1 2 so ϑ = 30 ∘ , and Theorem 12.11.4 gives sin ⁡ ( 3 × 30 ∘ ) = 1 after one round. Directly: all amplitudes start at 1 2 ; the oracle flips | 10 ⟩ , making the mean c ¯ = 1 4 ( 1 2 + 1 2 − 1 2 + 1 2 ) = 1 4 ; reflecting, c ↦ 2 c ¯ − c , sends

1 2 ↦ 0 , − 1 2 ↦ 1 .

The state is exactly | 10 ⟩ . Classically one would expect to open two or three of the four boxes.

Grover amplification: ^2((2k+1)) rises to near certainty after about 4N rounds, then falls again. Running too long is as bad as stopping too early.
Figure 12.5. Grover amplification: sin 2 ⁡ ( ( 2 k + 1 ) ϑ ) rises to near certainty after about π 4 N rounds, then falls again. Running too long is as bad as stopping too early.
Remark 12.11.2A square root is not an exponential

Grover is quadratic and provably optimal for unstructured search: 10 12 entries need 10 6 queries, not 10 12 . Shor's algorithm is the exponential one, and can be because factoring has structure that search lacks.

12.12What Entanglement Is Good For

This section shows what entanglement enables operationally: communication tasks and nonclassical correlations.

12.12.1Three Impossibilities

Theorem 12.12.1No cloning

No unitary U ˆ and fixed | s ⟩ satisfy U ˆ ( | ψ ⟩ ⊗ | s ⟩ ) = | ψ ⟩ ⊗ | ψ ⟩ for all | ψ ⟩ .

Unitaries preserve inner products, so for two states

⟨ ψ | φ ⟩ = ⟨ ψ | φ ⟩ ⟨ s | s ⟩ = ⟨ ψ | φ ⟩ 2 ,

giving z = z 2 : the states are orthogonal or identical.

Equivalently, by linearity: if U ˆ | 0 , s ⟩ = | 00 ⟩ and U ˆ | 1 , s ⟩ = | 11 ⟩ then

U ˆ | + , s ⟩ = | Φ + ⟩ ≠ | + ⟩ ⊗ | + ⟩ = | 00 ⟩ + | 01 ⟩ + | 10 ⟩ + | 11 ⟩ 2 . (12.35)

Not forbidden: copying a known state, or states from a known orthogonal set — which is what classical copying is.

Theorem 12.12.2Non-orthogonal states cannot be told apart with certainty

If ⟨ ψ | φ ⟩ ≠ 0 and | ψ ⟩ ≠ | φ ⟩ , no measurement identifies which was prepared with probability 1 .

If ⟨ ψ | Π ˆ 0 | ψ ⟩ = 1 then Π ˆ 0 | ψ ⟩ = | ψ ⟩ , and likewise Π ˆ 1 | φ ⟩ = | φ ⟩ . Since Π ˆ 0 Π ˆ 1 = 0 , ⟨ ψ | φ ⟩ = ⟨ ψ | Π ˆ 0 Π ˆ 1 | φ ⟩ = 0 — a contradiction.

Theorem 12.12.3No signalling

Nothing Alice does to her half changes the statistics of any measurement Bob makes on his.

The proof is deferred to Sec. 12.13.1, after reduced states are introduced. This theorem prevents Bell correlations from becoming a faster-than-light signalling channel.

No-cloning is why error correction cannot copy and vote, and why quantum key distribution is secure: an eavesdropper cannot copy states in transit and, by Theorem 12.12.2, cannot measure them undetected.

12.12.2Superdense Coding

Two classical bits, one qubit sent — possible only with a shared pair.

Alice and Bob share | Φ + ⟩ . To send ( b 1 , b 0 ) Alice applies Z ˆ b 1 X ˆ b 0 and mails her qubit; Bob applies CNOT then H ˆ , and measures. Her four operations map | Φ + ⟩ onto the four orthogonal Bell states:

00 :   I ˆ → | Φ + ⟩ , 01 :   X ˆ → | Ψ + ⟩ , 10 :   Z ˆ → | Φ − ⟩ , 11 :   Z ˆ X ˆ → | Ψ − ⟩ . (12.36)

Bob's circuit is Example 12.9.1 run backwards, so his two clicks are her two bits.

No resource is created from nothing: in total, two qubits were distributed. The gain is communication timing, not violation of information accounting.

12.12.3Teleportation

Alice holds an unknown | ψ ⟩ = α | 0 ⟩ + β | 1 ⟩ and may send only classical bits. She cannot measure it (Theorem 12.12.2) or copy it (Theorem 12.12.1).

Qubit 1 is hers; 2 and 3 are a shared | Φ + ⟩ . Rewriting qubits 1 , 2 in the Bell basis using

| 00 ⟩ = | Φ + ⟩ + | Φ − ⟩ 2 , | 11 ⟩ = | Φ + ⟩ − | Φ − ⟩ 2 , | 01 ⟩ = | Ψ + ⟩ + | Ψ − ⟩ 2 , | 10 ⟩ = | Ψ + ⟩ − | Ψ − ⟩ 2 (12.37)

gives

| Ψ ⟩ 123 = 1 2 [ | Φ + ⟩ 12 ( α | 0 ⟩ + β | 1 ⟩ ) 3 + | Φ − ⟩ 12 ( α | 0 ⟩ − β | 1 ⟩ ) 3 + | Ψ + ⟩ 12 ( α | 1 ⟩ + β | 0 ⟩ ) 3 + | Ψ − ⟩ 12 ( α | 1 ⟩ − β | 0 ⟩ ) 3 ] (12.38)

No physical operation has yet been applied to Bob's qubit; the state is only rewritten in a different basis. In each branch, Bob already has the correct amplitudes α , β , up to a known Pauli correction.

Alice does a Bell measurement, gets ( m 1 , m 2 ) , sends them; Bob applies Z ˆ m 1 X ˆ m 2 .

( m 1 , m 2 ) Alice's stateBob's state beforeBob applies
( 0 , 0 ) | Φ + ⟩ α | 0 ⟩ + β | 1 ⟩ I ˆ
( 0 , 1 ) | Ψ + ⟩ α | 1 ⟩ + β | 0 ⟩ X ˆ
( 1 , 0 ) | Φ − ⟩ α | 0 ⟩ − β | 1 ⟩ Z ˆ
( 1 , 1 ) | Ψ − ⟩ α | 1 ⟩ − β | 0 ⟩ Z ˆ X ˆ
Teleportation. The double lines carry the two classical bits; without them Bob's qubit is 12I, by Theorem 12.12.3.
Figure 12.6. Teleportation. The double lines carry the two classical bits; without them Bob's qubit is 1 2 I ˆ , by Theorem 12.12.3.

Teleportation does not clone (Alice's state is consumed by measurement), does not signal superluminally (Bob has 1 2 I ˆ until classical bits arrive), and does not transport matter.

Remark 12.12.1The two protocols are one trick

Superdense coding: one pair + one qubit → two bits. Teleportation: one pair + two bits → one qubit. The correction Z ˆ m 1 X ˆ m 2 is the encoding read backwards.

12.12.4The CHSH Game

The game. A referee sends random bits x to Alice and y to Bob, who cannot communicate. They answer a and b , and win if

a ⊕ b = x ∧ y . (12.39)
Theorem 12.12.4Classical bound

Any strategy fixed in advance, shared randomness included, wins at most 3 times in 4 .

Shared randomness averages deterministic strategies, so it suffices to rule those out. Winning all four needs

f ( 0 ) ⊕ g ( 0 ) = 0 , f ( 0 ) ⊕ g ( 1 ) = 0 , f ( 1 ) ⊕ g ( 0 ) = 0 , f ( 1 ) ⊕ g ( 1 ) = 1 .

Adding all four modulo 2 : each of f ( 0 ) , f ( 1 ) , g ( 0 ) , g ( 1 ) appears twice so the left is 0 , while the right is 1 . Three of four is achievable by always answering 0 .

The quantum strategy. Share | Φ + ⟩ and measure

A ˆ ( ϑ ) = cos ⁡ ϑ Z ˆ + sin ⁡ ϑ X ˆ , (12.40)

Alice at 0 or π / 2 , Bob at ± π / 4 . On | Φ + ⟩ , ⟨ Z ˆ ⊗ Z ˆ ⟩ = ⟨ X ˆ ⊗ X ˆ ⟩ = + 1 and the cross terms vanish, so

⟨ Φ + | A ˆ ( ϑ ) ⊗ A ˆ ( ϑ ′ ) | Φ + ⟩ = cos ⁡ ( ϑ − ϑ ′ ) , Pr ⁡ [ agree ] = cos 2 ⁡ ϑ − ϑ ′ 2 . (12.41)

The three pairs needing agreement have differences ∓ π / 4 , π / 4 ; the ( 1 , 1 ) pair needs disagreement at 3 π / 4 , and 1 − cos 2 ⁡ ( 3 π / 8 ) = cos 2 ⁡ ( π / 8 ) . All four give

p win = cos 2 ⁡ π 8 = 2 + 2 4 ≈ 0.8536 (12.42)
Winning probability against Bob's angle, Alice's settings fixed at 0 and /2. Nothing fixed in advance rises above the dashed line, and the quantum strategy does so over a wide range — so the experiment tolerates imperfect alignment.
Figure 12.7. Winning probability against Bob's angle, Alice's settings fixed at 0 and π / 2 . Nothing fixed in advance rises above the dashed line, and the quantum strategy does so over a wide range — so the experiment tolerates imperfect alignment.

As an inequality, with

S = ⟨ A ˆ 0 B ˆ 0 ⟩ + ⟨ A ˆ 0 B ˆ 1 ⟩ + ⟨ A ˆ 1 B ˆ 0 ⟩ − ⟨ A ˆ 1 B ˆ 1 ⟩ , p win = 1 2 + S 8 , (12.43)
| S | ≤ 2   (local hidden variables) , | S | ≤ 2 2   (Tsirelson) . (12.44)
Remark 12.12.2What the experiment settles

The failed assumption is the one used in Theorem 12.12.4: that a depends only on x and information carried beforehand, and b only on y and the same. Any such local hidden-variable theory obeys | S | ≤ 2 . Aspect measured S > 2 in the early 1980s; by 2015 three groups had closed the locality and detection loopholes together; the 2022 Nobel Prize followed. Note what survives: Theorem 12.12.3 is exact. What dies is that outcomes were determined before measurement.

12.13The Density Operator

A state vector cannot represent either classical uncertainty (“ | 0 ⟩ or | 1 ⟩ , unknown to us”) or a subsystem of an entangled pair. The density operator handles both situations in one framework.

Definition 12.13.1Density operator

A system prepared in | ψ i ⟩ with probability p i is

ρ ˆ = ∑ i p i | ψ i ⟩ ⟨ ψ i | , p i ≥ 0 , ∑ i p i = 1 , (12.45)

pure if some p i = 1 and mixed otherwise.

Every ρ ˆ is Hermitian, positive semidefinite, with Tr ρ ˆ = 1 ; and every such operator is a state. The rules become

p k = Tr ( Π ˆ k ρ ˆ ) , ⟨ A ˆ ⟩ = Tr ( A ˆ ρ ˆ ) , ρ ˆ ⟼ U ˆ ρ ˆ U ˆ † . (12.46)
Example 12.13.1The two ways of being fifty-fifty

Compare | + ⟩ with the mixture “ | 0 ⟩ or | 1 ⟩ , each 1 2 ”.

Solution.

ρ ˆ + = 1 2 ( 1 1 1 1 ) , ρ ˆ mix = 1 2 ( 1 0 0 1 ) .

Identical diagonals: no computational-basis measurement tells them apart. The difference is entirely the off-diagonal coherences.

In the | ± ⟩ basis they separate: Tr ( | + ⟩ ⟨ + | ρ ˆ + ) = 1 against 1 2 for the mixture. The superposition is definite but looks random in one basis; the mixture is ignorance and looks random in every basis.

That is decoherence in advance: dephasing is the coherences decaying to zero, turning the first matrix into the second. No energy lost, no population moved — only the interference.

The Bloch ball. Any qubit state is

ρ ˆ = I ˆ + r → ⋅ σ → 2 , | r → | ≤ 1 , Tr ( ρ ˆ 2 ) = 1 + | r → | 2 2 . (12.47)

Pure states are the surface, mixed states the interior, 1 2 I ˆ the center. Now T 1 and T 2 are exact: T 1 moves r z , T 2 shrinks r x and r y . Dephasing is the Bloch vector collapsing onto the z axis.

Reduced states. Tracing out the subsystem that is not observed,

Tr B ( | a b ⟩ ⟨ a ′ b ′ | ) = ⟨ b ′ | b ⟩ | a ⟩ ⟨ a ′ | , (12.48)

and applying it to | Φ + ⟩ the cross terms die because ⟨ 1 | 0 ⟩ = 0 :

ρ ˆ A = Tr B | Φ + ⟩ ⟨ Φ + | = 1 2 I ˆ (12.49)

Alice's half is maximally mixed — a fair coin in every basis — while the joint state is pure. All the information is in the correlation and none in either part. That is why entanglement is a resource, and it completes Example 12.9.2.

12.13.1No Signalling, Proved

For a unitary on Alice's side, by cyclicity of the partial trace,

Tr A [ ( U ˆ A ⊗ I ˆ ) ρ ˆ ( U ˆ A † ⊗ I ˆ ) ] = Tr A [ ( U ˆ A † U ˆ A ⊗ I ˆ ) ρ ˆ ] = ρ ˆ B .

For an unreported measurement the state is ∑ k ( Π ˆ k ⊗ I ˆ ) ρ ˆ ( Π ˆ k ⊗ I ˆ ) , and the same step with ∑ k Π ˆ k = I ˆ again gives ρ ˆ B .

12.14Obstacles

Decoherence. The qubit entangles with uncontrolled environmental degrees of freedom. Tracing out the environment drives ρ ˆ + → ρ ˆ mix by suppressing coherences.

Gate errors compound. With error ϵ per gate a circuit of N gates is about ( 1 − ϵ ) N likely to be right, so 10 − 3 allows a few hundred gates.

Error correction. No-cloning forbids copy-and-vote. Instead one logical qubit is spread over many physical ones and only parity relations are measured — revealing that an error occurred without revealing the state. Current estimates: 10 2 to 10 3 physical qubits per logical one.

Scale. Shor's algorithm on a cryptographic number is usually estimated at millions of physical qubits; present machines have hundreds to low thousands, each needing control and readout wiring at 10 mK.

The core physics is established; the main challenge is engineering scale and fault tolerance. The algorithms are mathematically sound and the foundational effects are experimentally verified. What remains is building systems large and coherent enough for practical workloads.

12.15Summary

12.16Exercises

  1. Classical first. (a) Write the four functions from one bit to one bit as matrices; which are stochastic? (b) Show M A M = M for every stochastic A . (c) Which property of Z ˆ has no stochastic counterpart, and why does that make Example 12.4.1 possible?

  2. Points on the sphere. For | ψ 1 ⟩ = 1 2 ( | 0 ⟩ − i | 1 ⟩ ) , | ψ 2 ⟩ = 1 2 | 0 ⟩ + 3 2 | 1 ⟩ and | ψ 3 ⟩ = i 2 ( | 0 ⟩ + | 1 ⟩ ) , find ( θ , φ ) and r → . Two appear in the table of Sec. 12.5.1 — one as written, one only after a global phase is stripped. Which, and by which theorem?

  3. Gate algebra. (a) Verify Eq. (12.13). (b) Show X ˆ , Y ˆ , Z ˆ pairwise anticommute and X ˆ Y ˆ = i Z ˆ . (c) Compute R ˆ e → z † ( θ ) X ˆ R ˆ e → z ( θ ) and show it is cos ⁡ θ X ˆ − sin ⁡ θ Y ˆ .

  4. Calibration. A qubit is driven at Ω / 2 π = 32 MHz. (a) Find t π and the π / 2 pulse time. (b) The amplitude is 2 % low; find the error and compare with 1 % — by what factor, and why? (c) Instead detune by 1 MHz at correct amplitude. Use Eq. (6.16) to find the maximum transfer, and show no pulse duration repairs a detuning error.

  5. Coherence budgets. A transmon has T 2 = 150   μ s with 25 ns gates; an ion has T 2 = 10 s with 50   μ s gates. (a) How many gates fit in each? (b) Which finishes a 1000 -gate circuit sooner in wall-clock time? (c) Why do the two measures disagree, and which decides whether an algorithm runs at all?

  6. Product or entangled? Classify 1 2 ( | 00 ⟩ + | 01 ⟩ + | 10 ⟩ + | 11 ⟩ ) , 1 2 ( | 00 ⟩ + | 01 ⟩ ) , 1 2 ( | 00 ⟩ − | 11 ⟩ ) , 1 3 ( | 00 ⟩ + | 01 ⟩ + | 10 ⟩ ) , exhibiting the factorization or the contradiction.

  7. Circuit identities. (a) Verify Example 12.10.1 by 4 × 4 multiplication. (b) Show three alternating CNOTs make SWAP. (c) Show CNOT = ( I ˆ ⊗ H ˆ ) CZ ( I ˆ ⊗ H ˆ ) .

  8. The algorithms by hand. (a) Run Deutsch for f ( x ) = x and for f ( x ) = 1 . (b) Run Bernstein–Vazirani for n = 3 , a = 101 . (c) For Grover with N = 8 , compute the success probability after 1 , 2 and 3 rounds and say which k you would choose.

  9. Mixtures and superpositions. (a) Write ρ ˆ for | + i ⟩ and for the mixture “ | + ⟩ or | − ⟩ , each 1 2 ”. Which is pure? (b) Compute Tr ( ρ ˆ 2 ) for both and check Eq. (12.47). (c) Give a basis that tells them apart and one that does not.

  10. How entangled? For | Ψ ( λ ) ⟩ = cos ⁡ λ | 00 ⟩ + sin ⁡ λ | 11 ⟩ , compute ρ ˆ A and its Bloch vector; evaluate at λ = 0 and π / 4 ; compute Tr ( ρ ˆ A 2 ) and explain why it measures entanglement.

  11. Teleportation in full. (a) Derive Eq. (12.38). (b) If Bob measures immediately, show his statistics are 50 / 50 regardless of α , β . (c) If he applies X ˆ instead of I ˆ , what is | ⟨ ψ | ψ ′ ⟩ | 2 ?

  12. CHSH both ways. (a) List the 16 deterministic strategies and confirm the maximum is 3 . (b) Compute S for the angles of Sec. 12.12.4. (c) Bob mis-aligns by 10 ∘ ; recompute p win and say whether 3 / 4 is still beaten.

12.17Project: Two Qubits, From Scratch

The problem. Write a two-qubit simulator in about fifty lines of numpy and use it to reproduce every quantitative claim in this chapter.

No quantum library needed: a state is a length-four complex array, a gate a 4 × 4 matrix, and numpy.kron builds both. Writing it yourself is the point — the conventions of Remark 12.9.1 only become real when you must choose one.

  1. On paper. Work out by hand the matrices of H ˆ ⊗ I ˆ , I ˆ ⊗ H ˆ and CNOT in the ordering of Eq. (12.23). A simulator debugged against its own output is not debugged.

  2. On the computer. Build it: single-qubit gates, a function lifting one to a chosen wire, CNOT from Eq. (12.26) as a sum of Kronecker products (not typed in by hand), and a measurement routine. Check every gate is unitary to machine precision.

  3. On the computer. Prepare all four Bell states; compute ρ ˆ A by partial trace and confirm Eq. (12.49). Then teleport a random | ψ ⟩ branch by branch and confirm fidelity 1 on all four.

  4. On the computer. Implement Grover for N = 4 and confirm Example 12.11.2 — probability 1 after one round. Then do N = 8 and plot success against rounds, reproducing Fig. 12.5. Note where it peaks and falls.

  5. On the computer. Play CHSH: implement Eq. (12.40) as a measurement in the rotated basis, sample 10 5 rounds, and report the winning fraction with its statistical error. It should sit at 0.8536 .

  6. On the computer. Add dephasing: apply Z ˆ to one qubit with probability p , averaging the two cases — which is Example 12.13.1, so use density operators. Plot p win against p and find where the advantage disappears.

  7. What has to move. One animation: a Bloch sphere tracing a resonant π pulse, beside the same pulse detuned by Ω / 2 so the vector precesses about a tilted axis and misses the south pole. Caption it with the fact that driving longer cannot fix the miss.

The check. Part (c) is the real test: teleportation must succeed on all four branches. One branch failing means a sign error in the correction table, two means inconsistent qubit ordering, four means the partial trace is wrong.

Be ready to answer. Part (e) beat the classical bound, yet your simulator is a deterministic classical program. Explain why that is not a contradiction, and name the assumption of Theorem 12.12.4 your program violates.

For the Interested Reader

Videos

Video

The Map of Quantum Computing - Quantum Computing Explained

Video thumbnail for The Map of Quantum Computing - Quantum Computing ExplainedWatch on YouTube

Open video on YouTube

The companion to Remark 12.1.1: the whole field on one page, walked through in half an hour. The hardware of Sec. 12.8.1 and the obstacles of Sec. 12.14 are all on it.

Websites