Quantum Computation
Fourteen modules, from a single qubit to quantum key distribution, each taught in the format that fits it best. Click gates onto a Bloch sphere, build circuits, run Bell tests and Grover search, watch noise shrink a state, then check yourself with concept questions and practice problems.
Follows the chapter order of M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th Anniversary Edition (Cambridge University Press, 2010), and covers all twelve chapters; Chapters 1 and 2 get two modules each. Chapter numbers refer to that book; the questions and examples here are written for this page. Exercises from the book appear at the end of each module, with their numbers from the book and their statements restated in our own words.
Qubits and the Bloch sphere
A qubit's state is a pair of complex numbers. Throw away the overall phase, which no experiment can see, and what is left is a point on a sphere. Every single-qubit gate is then a rotation of that sphere, and you can watch each one turn the state.
The idea
Explore
Worked example
Find the rotation performed by the gate
Where does
send the three Bloch axes , , ? is a half turn about . A half turn swaps the two axes symmetric about its axis and reverses the one perpendicular to it: , , . Check: and .And
?A quarter turn counterclockwise about
: , , . Indeed .Compose them. What does
do to the axes, and what rotation is that? , , . So cycles . A rotation that permutes the axes cyclically fixes the diagonal and turns by a third of a full turn. The cycle is about that axis, so ours, the reverse cycle, isTry it in the explorer: start at
and press H, S three times over. Then compute exactly.The state goes
on the sphere, as the cycle predicts. Three thirds of a turn is the identity rotation, so is a multiple of . Multiplying the matrices givesThe phase
is global, so it is invisible, but the amplitudes shown in the explorer do carry it.
Check your understanding
Which pair of states can be told apart by some measurement (given many copies)?
and (normalised)These differ by the global factor . Every probability is unchanged by a global phase. and (normalised) and multiplies the whole state, so it is a global phase.
What is
- Exactly
: eight eighth-turns make a full turn, and is indeed , but is times the phase , and that phase also gets raised to the 8th power. and , so is . Keep going.
The Bloch vectors of two pure states make an angle of
Orthogonal states are antipodal ( apart), not perpendicular. That's , before squaring.
Practice
Locate a stateFrom amplitudes to the Bloch vector
Find the Bloch vector of
Hint
For
Solution
A square root of NOTRotations by half the angle
Find a unitary
Hint
Solution
On the sphere
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 4.1Where the Pauli eigenvectors sit
Find the normalized eigenvectors of
Hint
The
Solution
In every case the
Exercise 4.4The Hadamard gate from rotations
Write
Hint
On the sphere
Solution
Check by multiplying:
Geometrically: the first quarter turn about
Exercise 4.6Why deserves the name rotation
Let a qubit have Bloch vector
Hint
Split
Solution
Write
If
If
Since
By linearity,
Bell states and teleportation
With one shared entangled pair and two classical bits, Alice can hand Bob an unknown qubit without ever learning what it is. The animation follows the state through the circuit and shows, at each moment, what Bob would hold for each result Alice could get.
The idea
Alice measures, gets
Watch
- Alice holds an unknown qubit
. Two more qubits start in . No branch shows on Bob's side yet. and CNOT make the Bell pair . Alice keeps one half, Bob takes the other.- Alice applies CNOT from
to her half of the pair. Bob's branches are now or : only the amplitudes' sizes have moved, not the phase. - Alice applies
to her first qubit. Every branch is now equally likely and holds up to a Pauli: . - Alice measures and gets
. The other branches vanish; Bob holds but doesn't yet know which. - The two bits reach Bob. He applies
, then , and now holds exactly . Alice's copy is gone.
Worked example
Suppose Alice and Bob share
Write
as a one-qubit operation on Bob's half of . , and then gives . So .Why can we pretend Bob applied
at the very start?Alice's CNOT,
and measurement act only on her two qubits, and acts only on Bob's. Operators on different qubits commute, so the extra can be moved past all of Alice's steps.So what does Bob hold after Alice reports
?Up to a sign,
. He must undo this with (read right to left: apply first).Simplify the four corrections.
Using
and :Check
: Bob holds up to sign. Any shared Bell state works, as long as Alice and Bob agree in advance which one it is.
Check your understanding
Alice has measured, but her two bits haven't reached Bob. What state should Bob use to predict his own measurements?
Then Alice could signal instantly, by choosing and letting Bob measure. That's correct only for someone who knows . Bob doesn't.- The maximally mixed state
, whatever is
Is
- Yes: all four basis states appear.The number of terms depends on the basis. Try to factor it.
- No: it is
. - Yes: it's one of the Bell states.Each Bell state has only two terms in this basis.
Why does Alice apply
- Without it, Bob's branch states are just
or , and the phase of would be lost in the measurement. - It is part of making the Bell pair.The Bell pair's
acts on Alice's other qubit, earlier in the circuit. - It only changes a global phase, so it could be skipped.Scrub the animation to just before the
: Bob's branches are or , not copies of .
Practice
Back from the Bell basisChange of basis
Express
Hint
Add and subtract Bell states that contain the same two basis vectors.
Solution
Teleporting entanglementEntanglement swapping
Charlie and Alice share
Hint
Teleportation is linear: it works term by term on
Solution
The protocol maps
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 1.2Distinguishing is as strong as cloning
Suppose a device, given one of two non-orthogonal states
Hint
Once you know which state you hold, you can prepare as many copies as you like. In the other direction, copies make the states closer to orthogonal:
Solution
Distinguisher β cloner. Feed the input to the device, read off the label
Cloner β distinguisher. Apply the cloner repeatedly to get
Exercise 2.69The Bell basis is orthonormal
Check that the four Bell states
Hint
Two of them use only
Solution
Each has norm
Exercise 4.33Measuring in the Bell basis
The circuit applies a CNOT (first qubit control) and then
Hint
Run each Bell state through CNOT and then
Solution
Write
where
Measuring
Measurement and density operators
Quantum mechanics predicts probabilities, and probabilities only show up as frequencies over many runs. Measure a prepared state again and again, watch the frequency settle, and find out which preparations no experiment can tell apart.
The idea
Explore
Worked example
A qubit is prepared in
What are the probabilities in the
basis? and , so .What is
for an measurement? , soFind the Bloch vector and confirm
. gives , and . So , and . The -component is , as it should be.Write
and compute .In the explorer, run 1000 shots in
: the frequency should land within about of 0.933.
Check your understanding
Preparation A:
- Yes: measure
. B always gives a definite outcome.Each member of B has a definite value, but you don't know which member was sent. Try both in the explorer. - Only a measurement on many copies at once.Even joint measurements on many copies see
, which is the same for A and B. - No: both have
.
A qubit has Bloch vector
That's the probability of the outcome . The mean is . Squaring belongs to amplitudes, not to Bloch components.
You measure
- The source is not producing
.How big a fluctuation is normal for 100 shots? - Nothing alarming: the count has standard deviation 5, so 58 is 1.6 standard deviations from 50.
- Earlier measurements disturbed the later copies.Each shot uses a fresh copy, so earlier outcomes have no effect.
Practice
Purity on the Bloch ballPure states live on the surface
Show that
Hint
Solution
An ensemble on two axesFrom an ensemble to
A source emits
Solution
Bloch vectors average:
with purity
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 2.59Measuring on
A qubit is in
Hint
Solution
Exercise 2.61Measuring a spin along
For a unit vector
Hint
The projector for
Solution
The post-measurement state is
the
Exercise 2.71Purity test
Show that every density operator satisfies
Hint
Diagonalise:
Solution
Exercise 2.72The Bloch ball
(1) Show that every single-qubit density matrix can be written
Hint
Solution
(1) A Hermitian
(2)
(3)
(4) For
Entanglement and Bell's inequality
If every measurement result were fixed in advance by shared local information, one combination of correlations, the CHSH quantity
The idea
where
Explore
Worked example
The explorer uses
Compute
, and in the singlet. multiplies both and by : mean . swaps , turning the singlet into minus itself: mean . maps it to , which is orthogonal to it: mean 0. Likewise .Expand
.The singlet is perfectly anticorrelated along every common axis.
Evaluate
at the settings that give for .Every correlation changes sign, so
. The inequality really bounds : local models satisfy , because . Relabelling Bob's outcomes ( ) turns the singlet's into .Where exactly does the local argument fail for quantum systems?
It assumes all four values
exist in every run. In the quantum experiment only one setting per side is measured, and and don't commute, so there is no joint value of and to plug into the identity.
Check your understanding
Alice and Bob share
- Yes: her measurement collapses his qubit.It collapses to a state that depends on her random outcome. Average over that outcome.
- No: Bob's reduced state is
whatever she does. - Only if she measures
too.Then the outcomes are correlated, but Bob's own frequencies are still 50/50.
Point all four directions along
- 0Every correlation is
here, not 0; only the signs in can cancel them. - 2
- 4One of the four terms enters with a minus sign.
That needs the directions spread out by steps.
An experiment measures
- Quantum mechanics.Quantum mechanics predicts values up to
. - Every model in which outcomes are fixed by shared local variables and neither side's setting affects the other's result.
- Entanglement between the two qubits.The other way around: unentangled (separable) states always satisfy
, so a violation certifies entanglement.
Practice
Four terms, two in disguiseA Schmidt decomposition
Find the Schmidt decomposition and
Hint
Group the terms by the first qubit.
Solution
Product states obey CHSHNo entanglement, no violation
Show that
Hint
For a product state,
Solution
With
Mixtures of product states inherit the bound, since
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 2.75Reduced states of the Bell states
For each of the four Bell states, find the reduced density operator of each qubit.
Hint
Write each Bell state as
Solution
For
The other three are obtained from
Exercise 2.78Product states, Schmidt number 1, pure marginals
Prove that a state
Hint
Write the Schmidt decomposition
Solution
If
From the Schmidt form,
Exercise 2.79Three Schmidt decompositions
Find Schmidt decompositions of
Hint
Write the state as a
Solution
(1) Already in Schmidt form: coefficients
(2) It factors:
(3)
where the sign is absorbed into the second Schmidt vector because
Reversible computation and complexity
A quantum computer evolves by unitaries, so whatever it computes it must compute reversibly. Classical logic can be made reversible at modest cost, which is why a quantum computer can run any classical algorithm, and the scratch work has to be cleaned up afterwards.
The idea
Worked example
Build a reversible circuit that computes
One Toffoli computes the AND of two bits. How?
Toffoli
with gives .Now get
into the target (initially 0).Toffoli
gives . The scratch bit still holds : this is garbage.Why is the garbage harmful on a quantum computer?
On a superposition of inputs the circuit produces
instead of . The garbage register is entangled with the input. Tracing it out leaves the rest in a mixed state, and the interference that a quantum algorithm relies on is lost.Clean up
.Apply Toffoli
once more: . Nothing it depends on ( ) has changed, so the uncomputation is exact. The circuit is three Toffolis, and its output is .Generalise to the AND of
bits. How many Toffolis and scratch bits?Chain the partial ANDs
into scratch bits, with the last Toffoli writing into the target: gates. Uncompute the scratch bits in reverse order: more. Total Toffolis and clean scratch bits; for , three Toffolis and one scratch bit, as above.What does Landauer's principle say about the ordinary irreversible AND gate on uniformly random inputs?
The input carries 2 bits of entropy. The output is 1 with probability
, so it carries bits. The gate erases about bits, so it must dissipate at least per use. The reversible version keeps , erases nothing, and has no such floor.
Check your understanding
A Toffoli gate gets inputs
The target starts at 1, so it becomes . , the NAND Toffoli multiplies the controls; XOR would need two CNOTs.
Why must every gate in a quantum circuit be reversible?
- Closed quantum evolution is unitary, and unitaries are invertible.
- To avoid Landauer heat, which would destroy the qubits.Heat is a practical concern; the requirement is more basic than that.
- Because of the no-cloning theorem.No-cloning forbids copying unknown states; reversibility comes from unitarity itself.
Which of these is known to be true?
- NP
BQPOpen, and widely doubted: search gives only a square-root speed-up for unstructured problems. - Factoring is NP-completeFactoring (as a decision problem) lies in NP β© co-NP, which makes NP-completeness unlikely.
Practice
A reversible ORDe Morgan with a Toffoli
Using one Toffoli and some NOT gates, compute
Hint
Solution
NOT
The Fredkin gateControlled swap
The Fredkin gate swaps its second and third bits when the first is 1. Show it never changes the number of 1s, and use it with constant inputs to compute AND and NOT.
Solution
It either does nothing or swaps two bits, so the count of 1s is unchanged. Input
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 3.29The Fredkin gate undoes itself
Show that applying two Fredkin (controlled-swap) gates in a row returns the original inputs.
Hint
Split into the cases control
Solution
The control bit
Exercise 3.31A reversible half-adder
Build a reversible circuit taking bits
Hint
A Toffoli computes an AND into a fresh 0; a CNOT computes an XOR into a fresh 0.
Solution
Start from
Exercise 3.32Fredkin vs Toffoli
What is the smallest number of Fredkin gates needed to simulate a Toffoli gate, and the smallest number of Toffoli gates needed to simulate a Fredkin gate? (Constant inputs and garbage outputs are allowed.)
Hint
Work over
Solution
Three Toffolis make a Fredkin. CNOT
Three Fredkins make a Toffoli.
So the answer is three in each direction.
Quantum circuits
Single-qubit gates and CNOT are enough to build any unitary. Put gates on three wires and watch all eight amplitudes change, column by column. Entanglement shows up as a qubit whose own state is no longer pure.
The idea
Explore
Worked example
Load "DeutschβJozsa" in the simulator. It tests whether
After
on wire 3 and on all three wires, what is the state? .What does the oracle do to
? : phase kickback. So the state becomesApply
to wires 1 and 2. What is measured? , so the result is : wires 1 and 2 read with certainty. The simulator shows probability on each of and because wire 3 is .What would a constant
give, and why does this decide the question?For constant
the kickback is a global sign, the first two wires stay , and the final s return . For any balanced , the amplitude of after the final s is . So "00" means constant and anything else means balanced. Remove one CNOT from the oracle (it becomes or , still balanced) and check that 00 still never appears.
Check your understanding
In a CZ gate, which qubit is the control?
- The top one, by convention.Write out its matrix and swap the qubits.
- Either: CZ is symmetric.
- The one in state
.Control is a role in the circuit, not a property of the state.
- The same Bell state.Look at what the CNOT does when its control is
. - The product state
. - A different Bell state.No entangling step acts on a superposition, so no entanglement can appear.
Control in
, unchanged.The target is unchanged. The control is not.- An entangled state.The target is an eigenvector of
, so the output stays a product.
Practice
Three-qubit GHZ stateEntangled, but each pair is not
Give a circuit that makes
Solution
Kickback from controlled-SReading off an eigenvalue
A controlled-
Hint
Solution
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 4.13Conjugating Paulis by
Prove
Hint
Solution
With
Exercise 4.17CNOT from a controlled-Z
Build a CNOT from one controlled-
Hint
Solution
Put
If the control is
Exercise 4.20Control and target swap in the basis
Show that
Hint
Write
Solution
using
Translating:
Fourier transform and period finding
Shor's algorithm turns factoring into finding the period of
The idea
It is unitary and needs only
Explore
Worked example
Factor
What is the order of 2 modulo 21? (The quantum computer finds this; we check it by hand.)
. So .Where are the peaks of
?Near
: . Since 6 doesn't divide 512, the peaks spill onto neighbouring .Suppose the measurement gives
. Expand as a continued fraction and list the convergents. , so , with convergentsThe last convergent with denominator below
is , so the candidate is . Check: .Turn
into factors. is even and . Then and , and .What if the measurement had given
? , convergents . The candidate is , but . Here shares the factor 2 with , and reduced to . Trying the multiple works.
Check your understanding
- Any
, with peaks near multiples of 64.When divides the cancellation away from the peaks is exact. - Only
, each with probability . - Only
, which gives directly. is uniformly random in , so all four peaks are equally likely.
You measure
- Nothing:
, the candidate order is 1, and you run again. - That
.The order is at most , far below . - That
is a bad choice. (that is, ) has probability about for every .
Why take
- The QFT only works when
is a perfect square.The QFT works for every . - Then
, which guarantees is a convergent of . - To make the peaks wider and easier to hit.Larger
makes the peaks narrower relative to their spacing.
Practice
The four-point transformQFT by hand
Write the matrix of the QFT for
Solution
With
Exact peaksWhy gives a clean comb
Let
Hint
The amplitude of
Solution
The amplitude of
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 5.10Order of 5 mod 21
Show that the order of
Hint
Compute powers, reducing each time.
Solution
Exercise 5.18Factoring 91 by order-finding
Factor
Hint
Is
Solution
Powers:
Exercise 5.19Why 15 is the first interesting case
Show that
Hint
List the odd composites below
Solution
The odd composites less than
Grover search as a rotation
Each Grover iteration is two reflections, and two reflections make a rotation. In the plane spanned by "marked" and "unmarked", the state turns by a fixed angle each step, so about
The idea
Explore
Worked example
Search
What is
, and what does the formula predict for ? , so . The success probabilities are . Best is , close to .Do the first iteration with amplitudes. All 16 start at
.Oracle: the marked amplitude becomes
. The mean is . Inversion about the mean: unmarked ; marked . Probability , as predicted.Do the second and third iterations.
Second: mean
; unmarked , marked , probability . Third: mean ; unmarked , marked , probability .The unmarked amplitudes just went negative. What does that tell you?
The state has rotated past
: its -component is now negative. A fourth iteration moves it further from , and the probability drops to . A classical search with 3 queries succeeds with probability only , or if you guess one of the unchecked items at the end.
Check your understanding
- About 20That's
. Search is quadratically faster than classical, not exponentially. - About 800
- About 500,000That's the average for a classical search.
You run twice the optimal number of iterations. The success probability is then
- close to 1, since extra iterations can't hurt.The iteration is a rotation, and it keeps turning past
. - close to 0.
- about 1/2.After twice the optimum the angle is close to
, not .
What does the oracle step alone do to the measurement probabilities?
- It raises the probability of the marked items.It only flips the sign of their amplitudes.
- Nothing: it changes signs, and probabilities are squared magnitudes.
- It sets the marked amplitudes to zero.A unitary can't destroy amplitude; it reflects it.
Practice
Eight itemsChoosing the number of iterations
For
Solution
A quarter markedCertainty in one step
Show that if exactly a quarter of the items are marked, one Grover iteration finds a marked item with certainty.
Solution
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 6.2Inversion about the mean
Let
Hint
Compute
Solution
Exercise 6.3Grover's iterate is a rotation
With
Hint
Solution
In the basis
Multiplying,
Driving a qubit: Rabi oscillations
In NMR, ion traps and cavity QED, a gate is a pulse of radiation of a chosen length. On resonance the qubit swings all the way from
The idea
On resonance a pulse of area
Explore
Worked example
Design a pulse that takes
A drive with phase
rotates about . Can it reach from ?No. A rotation about
moves the north pole around the circle in the β plane, through and , never reaching .Which axis and angle work, and what is the matrix?
A quarter turn about
(drive phase ) sends to :How long is the pulse?
We need
, so .With
, how far off is a pulse? (Set Ξ/Ξ© = 0.10 in the explorer.)The axis tilts by
, and the largest possible is . The nominal pulse is also slightly too short for the faster rotation: , giving . So the error is about 1%, second order in .
Check your understanding
On resonance, a
- exactly the original state.The Bloch vector comes back, but
is not the identity matrix. . .That (up to phase) is what a pulse does: half a turn about .
The detuning equals the Rabi frequency,
- 1, with a long enough pulseOff resonance the oscillation has reduced amplitude, however long you wait.
- 1/2
- 1/4The amplitude is
; don't square it again.
A qubit has coherence time
- About 10Divide the two times.
- About 100
- About 10,000Check the units: 1 ms is 1000 ΞΌs.
Practice
How far down?The precession cone
With detuning
Hint
Rotating
Solution
A half turn sends
Pulse lengths for an ionUnits
An ion qubit is driven with
Solution
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 7.18Rabi oscillations by exponentiating
In the one-excitation subspace with basis
Hint
The
Solution
On
On the
This matches (7.77) up to the sign convention on the off-diagonal phase. The off-diagonal entry has modulus
Exercise 7.31Hadamard from and
Construct a Hadamard gate from
Hint
A quarter turn about
Solution
(apply
Noise on the Bloch ball
A qubit that interacts with its surroundings no longer evolves by a unitary. Its evolution is a quantum operation, and for one qubit every such operation squashes and shifts the Bloch ball into an ellipsoid inside it. Pick a channel and watch the ball deform.
The idea
The
- Bit flip (
with probability ): . - Phase flip (
with probability ): . - Depolarising,
: . - Amplitude damping (energy loss,
with probability ), , : . - Phase damping (loss of coherence without energy loss):
.
Explore
Worked example
Alice and Bob share
Find the shared state.
The channel replaces Bob's qubit by
with probability . Since Alice's reduced state is ,What are the CHSH correlations now?
The
part has for every pair of settings, so and the best value is . This exceeds 2 only when .Is the state entangled for larger
? Use the partial transpose: a separable state stays positive under it.The partial transpose of
is , with eigenvalues . So the partial transpose of has smallest eigenvalue , negative exactly when . For two qubits this test is also sufficient, so is entangled iff .Put the two thresholds together.
For
the pair is entangled but the CHSH test can't show it. Bell violation is a stronger property than entanglement. Its fidelity with , , crosses exactly at .
Check your understanding
Apply the channel many times. Which channel drives every input to the same pure state?
- DepolarisingIt drives everything to the centre,
, which is mixed. - Phase flipIt drives each state to the point on the
-axis below or above it, so different inputs end in different places. - Amplitude damping
A pure state goes through the depolarising channel with parameter
That's the length of the output Bloch vector. Purity is . That's the largest eigenvalue, .
The transpose map
- Yes: it maps the Bloch ball onto itself.That shows it is positive. Quantum operations must be completely positive.
- No: applied to one half of
it produces an operator with a negative eigenvalue. - Yes: it is unitary conjugation by
. flips both and ; the transpose flips only . A reflection is not a rotation.
Practice
Two flips make a depolariser?Composing channels
Apply a bit flip with probability
Solution
The scalings multiply:
Kraus operators for depolarising noiseUsing the Paulis
Find Kraus operators for
Hint
For every qubit
Solution
Substituting,
and
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 8.22Amplitude damping on a general state
For
Hint
Compute
Solution
Exercise 8.27Phase damping is a phase flip channel
Phase damping has operation elements
Hint
Everything is diagonal, so match the two diagonal entries of each
Solution
The
a real orthogonal (hence unitary) matrix.
Exercise 8.30
Hint
Iterate the result of Exercise 8.22 with
Solution
After repeated amplitude damping, the excited population scales as
Phase damping leaves populations alone and multiplies coherences by a further factor
Trace distance and fidelity
How different are two quantum states? Trace distance answers operationally: it is the best advantage you can get in telling them apart with one measurement. Fidelity is a generalised overlap. On the Bloch ball both have pictures, and noise can only bring states closer.
The idea
with the upper bound an equality for pure states.
Explore
Worked example
Compare
Find the trace distance.
, , , so .Find the fidelity, and check both bounds.
. Then , and : the upper bound is attained, as it must be for pure states.What measurement tells them apart best, and how often does it succeed?
Measure along
, halfway between and ; guess on outcome . Success probability . Measuring instead gives only .After depolarising noise with
, recompute and .Both Bloch vectors halve:
. With and ,Distance went down and fidelity up, as contractivity says.
Check your understanding
What is
- 2The Bloch vectors are 2 apart, but
has a factor . - 1
- 0.5Orthogonal states are perfectly distinguishable, the maximum.
Two states have
- 0.1Guessing blindly already gives 0.5.
- 0.55
- 0.9That would need the states to be nearly orthogonal.
Can some quantum operation make two states more distinguishable?
- Yes, a suitable unitary.Unitaries preserve
exactly: they move the two Bloch points rigidly. - Yes, a measurement that sharpens them.A measurement whose result is kept is also a trace-preserving operation, and it obeys the same bound.
- No, not if it is trace-preserving.
Practice
Pure versus maximally mixedBoth formulas
Compute
Solution
Commuting statesBack to classical distances
Suppose
Solution
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 9.6Two trace distances
Find the trace distance between
Hint
Solution
First pair: both diagonal, so
Second pair: Bloch vectors
Exercise 9.12The depolarizing channel is strictly contractive
For
Hint
What does
Solution
whenever
Exercise 9.13The bit flip channel: contractive, not strictly
Show the bit flip channel
Hint
In Bloch terms,
Solution
The channel maps
Fixed points (for
The three-qubit bit-flip code
You can't copy an unknown qubit, and you can't look at it without disturbing it. Even so,
The idea
which is smaller than
Explore
Worked example
Encode
Write the encoded state, and the state after an
error on qubit 2. , and after : .What syndrome is measured, and what is the state afterwards?
On both terms, qubits 1 and 2 differ and qubits 2 and 3 differ, so
with certainty. Since the outcome was certain, the state is undisturbed: and are untouched, and nobody learned them.Correct and decode.
points to qubit 2. Applying restores , and reversing the encoder gives .Now suppose qubits 1 and 2 both flip. What happens?
The state is
, the syndrome is , which points to qubit 3. "Correcting" qubit 3 gives : a logical . The decoded state is , whose overlap with the original is . The code has silently made an error; the fidelity happens to be high only because this particular state is close to its own image under .
Check your understanding
An
That pattern means qubit 1 disagrees with qubit 2.- It depends on
and .Both terms, and , have the same parities.
Why doesn't measuring
and have the same value but opposite values.- Because two-qubit measurements never disturb states.A Bell measurement disturbs plenty. It's about which eigenspace the state lies in.
- It does collapse it, but the correction step undoes that.The correction is a fixed
, which can't restore lost amplitudes.
Can this code correct a phase flip
- Yes, it corrects any single-qubit error.That's Shor's 9-qubit code, not this one.
- No:
turns the codeword into another codeword, so the syndrome is trivial. - Yes, by applying
to all three qubits.The syndrome gives no sign that anything happened, so the decoder wouldn't know to.
Practice
Is it worth it?Numbers
At
Solution
A small rotation, not a flipErrors are discretised
Instead of a flip, qubit 1 suffers the small rotation
Solution
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 10.3Two parity checks equal the syndrome measurement
For the three-qubit bit flip code, show that measuring
Hint
Solution
The outcome pair
: β this is . : β . : β . : β .
Since the sequential measurement has measurement operators
Exercise 10.4A syndrome measurement that is too nosy
For the three-qubit bit flip code, suppose the syndrome is found by measuring in the full computational basis (eight projectors
Hint
The result tells you more than which bit flipped: it also tells you the logical bit, which destroys superpositions.
Solution
(1) The projectors are
(2) The measurement collapses
(3) The output is
Entropy and entanglement
Shannon entropy measures the uncertainty of a random variable; von Neumann entropy does the same for a quantum state. For a pure state of two qubits, the entropy of either half measures how entangled they are. Set the four amplitudes and watch it.
The idea
Explore
Worked example
Find the entropy of entanglement of
Arrange the amplitudes in a matrix
(rows: , columns: ) and compute .Find the eigenvalues of
.Trace 1, determinant
. The eigenvalues solve : and . (Also .) The Schmidt coefficients are and .Compute
. bits.What is the Shannon entropy of a
measurement on alone? , so bits, more than 0.722. The basis isn't 's eigenbasis (the off-diagonal entry is nonzero), so measuring in it adds uncertainty.
Check your understanding
A pure two-qubit state has
- 2Subadditivity gives an upper bound,
, not the value. - 1The joint state is pure.
- 0
Which is more entangled:
- The first.
- The second: it has four terms.It factors as
. - They are equally entangled.The second is a product state, with entropy 0.
- exactly
bits.That equality holds only in the eigenbasis. - less than 0.47 bits.The eigenbasis is the basis that minimises the outcome entropy.
- more than 0.47 bits.
Practice
Entropy of an ensembleQuantum entropy can be smaller
A source emits
Solution
Averaging Bloch vectors,
Equal entropiesFrom the Schmidt decomposition
Show that
Solution
Write
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 11.11Three entropies
Compute
Hint
Find the eigenvalues;
Solution
The first two are pure (eigenvalues
The third has trace
Exercise 11.12Quantum entropy below the classical one
Let
Hint
Find the eigenvalues from trace and determinant.
Solution
Since
Exercise 11.14Entangled iff
For a pure state
Hint
For a pure joint state,
Solution
Quantum key distribution
Learning anything about a non-orthogonal state disturbs it. The BB84 protocol turns that into security: an eavesdropper who gains information about the key leaves errors that Alice and Bob can measure. Send qubits with and without Eve on the line.
The idea
Explore
Worked example
Eve intercepts every qubit (
Consider a sifted round (Alice and Bob used the same basis). What happens if Eve guessed that basis too?
She gets Alice's bit exactly and resends the same state. No error, and Eve knows the bit.
And if Eve used the other basis?
Her result is random and she resends, say,
when Alice sent . Bob measures in Alice's basis and gets a random bit: an error with probability .Combine the cases: error rate and Eve's chance of knowing a sifted bit.
Error rate
. Eve's guess at a sifted bit is right with probability . If she intercepts only a fraction of the qubits, the error rate is .Alice and Bob compare 20 sifted bits. How likely is it that they see no error at all?
. Comparing a few dozen bits catches a full interceptβresend attack almost surely. Partial attacks are subtler, which is why the protocol estimates the rate and then distils the key.
Check your understanding
Why does Alice use two bases rather than just
- Orthogonal states can be measured and resent perfectly, so Eve would leave no trace.
- To double the key rate.Sifting throws half the rounds away, so two bases lower the raw rate.
- Because a single basis would violate the Holevo bound.One bit per qubit in one basis is exactly at the Holevo bound, not beyond it.
Eve intercepts every qubit with a randomly chosen basis. What error rate do Alice and Bob see in the sifted key?
- 50%She only chooses the wrong basis half the time.
- 25%
- 12.5%That would be the rate if she intercepted half the qubits.
Alice sends one qubit, prepared in any of infinitely many states. How much classical information can Bob extract, at most?
- Unlimited: the amplitudes are continuous.Bob can't read amplitudes, only sample outcomes.
- 1 bit
- 2 bitsThat's superdense coding, which needs a pre-shared entangled pair.
Practice
A lazy eavesdropperAlways the same basis
Eve intercepts every qubit but always measures in the
Solution
In sifted rounds where Alice used
How much key survives?The ShorβPreskill rate
Alice and Bob measure an error rate of 5% in their sifted key. Using the rate
Solution
From Nielsen and Chuang, Quantum Computation and Quantum Information (10th anniversary ed., Cambridge, 2010)
Numbers match the book. Each question is restated in our own words; the hints and solutions are written for this page.
Exercise 12.27How random sampling bounds the errors
In BB84,
Hint
The check set is a uniformly random half, so the number of errors in it is hypergeometric. The dominating configuration has
Solution
(1) Total errors
(2) The entropy estimate turns the exponent into
(3) Each
(4) The same order follows from a Hoeffding/Chernoff bound for sampling without replacement (Hoeffding's inequality also holds for the hypergeometric distribution): the check-set error fraction concentrates within
Exercise 12.29The six-state protocol
Design a key distribution protocol using all six eigenstates of
Hint
Run BB84 with three bases instead of two. Ask how much error an interceptβresend attack causes, and what fraction of bits survive sifting.
Solution
Protocol. Alice picks a random basis from
Security. As in BB84, the states are drawn from mutually unbiased bases, so any measurement by Eve that gains information disturbs some of them, and the error estimate on the check bits bounds her information. The same entanglement-purification argument applies: the six states are the BB84 states plus the
Comparison. An interceptβresend attack in a random one of three bases causes a