Week 4 | what quantum information cannot do, and what entanglement lets it do anyway; Lab 2 launches | reading: Watrous §3.3 and Ch. 4
Lectures 5 to 7 built multi-qubit states, gates and circuits. This lecture uses them for the first genuinely quantum information-processing tasks. By the end you should be able to explain why an unknown quantum state cannot be copied, carry out teleportation and superdense coding step by step, write the teleportation circuit with mid-circuit measurement and classical feed-forward in Qiskit, and explain why the CHSH game can be won 85% of the time with entanglement but only 75% without it.
Copying is the most basic operation on classical data. A CNOT copies a classical bit into a fresh \(|0\rangle\): on basis states, cx(0, 1) sends \(|b\rangle_0|0\rangle_1\) to \(|b\rangle_0|b\rangle_1\). Does the same gate copy qubits?
Apply cx(0, 1) to \(|0\rangle_1\otimes|+\rangle_0\), qubit 0 carrying the "original" and qubit 1 the blank. Compare the result with the two copies \(|+\rangle|+\rangle\) we wanted.
By linearity the CNOT copies each basis term separately:
$$\mathrm{CX}_{0\to1}\,\frac{|00\rangle+|01\rangle}{\sqrt2}=\frac{|00\rangle+|11\rangle}{\sqrt2}=|\Phi^+\rangle ,$$whereas
$$|+\rangle|+\rangle=\tfrac12\big(|00\rangle+|01\rangle+|10\rangle+|11\rangle\big).$$These are different states. Measuring both qubits of \(|+\rangle|+\rangle\) gives all four outcomes with probability \(\tfrac14\); measuring \(|\Phi^+\rangle\) never gives \(01\) or \(10\). Their overlap is \(|\langle{+}{+}|\Phi^+\rangle|^2=\tfrac12\). The CNOT copied the basis label in each branch of the superposition, which entangled the two qubits instead of producing two independent copies.
Example 8.1 is not a failure of one particular gate. No gate at all can do better.
Let \(U\) be a unitary on two qubits and \(|e\rangle\) a fixed "blank" state. If \(U\big(|\psi\rangle|e\rangle\big)=|\psi\rangle|\psi\rangle\) and \(U\big(|\varphi\rangle|e\rangle\big)=|\varphi\rangle|\varphi\rangle\) for two states \(|\psi\rangle,|\varphi\rangle\), then \(\langle\psi|\varphi\rangle\) is 0 or 1: the two states are orthogonal or identical. In particular, no unitary copies every single-qubit state. The same holds if the copier is allowed extra work qubits in any fixed starting state.
Proof. HW4 asks you to prove this in two ways: once using linearity, and once using inner products.
What the theorem allows is just as important. A known orthonormal basis can be copied (CNOT does it), so classical information, which is information about which basis state you have, copies freely. What cannot be copied is an unknown superposition. The best possible universal copier makes two imperfect copies, each with fidelity \(\tfrac56\) to the original (Bužek and Hillery, 1996). A consequence: from a single copy of an unknown state you cannot learn its amplitudes, since otherwise you could prepare as many copies as you liked.
For which pairs of states could a single unitary (with a fixed blank state) copy both members of the pair? Tick every one.
In BB84 (Lecture 20) Alice sends single qubits in states chosen from \(\{|0\rangle,|1\rangle\}\) or \(\{|+\rangle,|-\rangle\}\). An eavesdropper would like to copy each qubit, forward the original, and measure the copy later once the bases are announced. Theorem 8.1 forbids exactly this: \(|0\rangle\) and \(|+\rangle\) are neither orthogonal nor identical (\(\langle0|+\rangle=\tfrac{1}{\sqrt2}\)), so no device copies both. Any attempt to learn which state was sent must disturb some of the forwarded qubits, and that disturbance is what Alice and Bob detect. Classical key distribution has no such guarantee, because classical signals can always be copied.
Alice holds a qubit in an unknown state \(|\psi\rangle=\alpha|0\rangle+\beta|1\rangle\) and wants Bob, far away, to have it. She cannot measure it and phone him the amplitudes (one measurement reveals one bit and destroys the rest), and she cannot copy it. If they share a Bell pair in advance, two classical bits are enough.
cx(0, 1) and then \(H\) to \(q_0\).Steps 2 and 3 together amount to measuring Alice's two qubits in the Bell basis, which is why the protocol is often described as "Alice makes a Bell measurement". The algebra below makes the whole protocol concrete. In this section we label each ket with its qubit and write the factors in the order \(q_0,q_1,q_2\) of the circuit diagram, which is easier to follow here than the right-to-left order.
Alice's outcomes are \(m_0=0\) and \(m_1=1\). By Definition 8.1, Bob applies to his qubit.
Teleport \(|\psi\rangle=\tfrac15\big(3|0\rangle+4i|1\rangle\big)\). Find each of Alice's four measurement outcomes, its probability, and the state Bob holds before and after his correction.
Start. Alice's qubit times the shared pair:
$$\frac{1}{5\sqrt2}\big(3|0\rangle_0+4i|1\rangle_0\big)\big(|0\rangle_1|0\rangle_2+|1\rangle_1|1\rangle_2\big).$$CNOT from \(q_0\) to \(q_1\). It flips \(q_1\) in the terms where \(q_0=1\):
$$\frac{1}{5\sqrt2}\Big(3|0\rangle_0\big(|00\rangle+|11\rangle\big)_{12}+4i|1\rangle_0\big(|10\rangle+|01\rangle\big)_{12}\Big).$$\(H\) on \(q_0\). Replace \(|0\rangle_0\) by \(\tfrac{1}{\sqrt2}(|0\rangle+|1\rangle)_0\) and \(|1\rangle_0\) by \(\tfrac{1}{\sqrt2}(|0\rangle-|1\rangle)_0\):
$$\frac{1}{10}\Big(3\big(|0\rangle+|1\rangle\big)_0\big(|00\rangle+|11\rangle\big)_{12}+4i\big(|0\rangle-|1\rangle\big)_0\big(|10\rangle+|01\rangle\big)_{12}\Big).$$Regroup by Alice's two qubits. Multiply out and collect the terms with each value of \(|m_0m_1\rangle_{01}\); Bob's qubit \(q_2\) is the last factor in each term:
$$\begin{aligned}\frac{1}{10}\Big(&|00\rangle_{01}\big(3|0\rangle+4i|1\rangle\big)_2+|01\rangle_{01}\big(4i|0\rangle+3|1\rangle\big)_2\\[2pt] +\;&|10\rangle_{01}\big(3|0\rangle-4i|1\rangle\big)_2+|11\rangle_{01}\big({-4i}|0\rangle+3|1\rangle\big)_2\Big).\end{aligned}$$Each bracket has length 5, so each term has squared length \((5/10)^2=\tfrac14\). By the partial-measurement rule (Rule 6.2), each outcome \(m_0m_1\) occurs with probability \(\tfrac14\), and leaves Bob with the normalised bracket:
| \(m_0\,m_1\) | Bob holds | which is | Bob applies |
|---|---|---|---|
| 0 0 | \(\tfrac15(3|0\rangle+4i|1\rangle)\) | \(|\psi\rangle\) | nothing |
| 0 1 | \(\tfrac15(4i|0\rangle+3|1\rangle)\) | \(X|\psi\rangle\) | \(X\) |
| 1 0 | \(\tfrac15(3|0\rangle-4i|1\rangle)\) | \(Z|\psi\rangle\) | \(Z\) |
| 1 1 | \(\tfrac15(-4i|0\rangle+3|1\rangle)\) | \(XZ|\psi\rangle\) | \(X\), then \(Z\) |
In every row the correction undoes the Pauli, since \(X^2=Z^2=I\) and \(Z\,X\,(XZ)=I\). Bob ends with \(|\psi\rangle\) exactly, global phase included.
Nothing in Example 8.2 used the particular numbers 3 and \(4i\): the same regrouping works for any \(\alpha,\beta\), which is HW4's teleportation problem.
For every \(|\psi\rangle\), Alice's outcomes \(m_0m_1\) are uniformly random, each with probability \(\tfrac14\), and before his correction Bob holds \(X^{m_1}Z^{m_0}|\psi\rangle\). After applying \(X^{m_1}\) and then \(Z^{m_0}\) he holds \(|\psi\rangle\).
Alice teleports \(|\psi\rangle=\tfrac1{\sqrt5}\big(|0\rangle+2|1\rangle\big)\) and gets \(m_0m_1=11\). Before receiving her bits, Bob measures his qubit in the standard basis. Given this branch, what is the probability that he sees 0?
Three remarks keep teleportation in proportion.
Immediately after a successful teleportation, which statement is true?
Can one qubit carry more than one classical bit? On its own, no: measuring a qubit yields one bit, and a theorem of Holevo (1973) shows that no cleverer decoding can extract more. With a shared Bell pair, one transmitted qubit carries two bits.
Start from \(|\Phi^+\rangle\) made by h(0), cx(0, 1), with Alice holding \(q_0\). Applying \(Z^{b_1}X^{b_0}\) to \(q_0\) produces
Write \(|\Phi^+\rangle=\tfrac{1}{\sqrt2}(|00\rangle+|11\rangle)\) with kets \(|q_1q_0\rangle\), so Alice's gates act on the right-hand digit. \(X\) on \(q_0\) flips that digit: \(\tfrac{1}{\sqrt2}(|01\rangle+|10\rangle)=|\Psi^+\rangle\). \(Z\) on \(q_0\) negates the terms where it is 1: from \(|\Phi^+\rangle\) it gives \(\tfrac{1}{\sqrt2}(|00\rangle-|11\rangle)=|\Phi^-\rangle\), and from \(|\Psi^+\rangle\) it gives \(\tfrac{1}{\sqrt2}(-|01\rangle+|10\rangle)=-|\Psi^-\rangle\).
The four Bell states form an orthonormal basis (Lecture 6), so a measurement in the Bell basis tells them apart with certainty, and Bob reads off both bits. HW4 asks you to give the decoding circuit. The two protocols are mirror images:
| protocol | uses | sends | delivers |
|---|---|---|---|
| teleportation | 1 Bell pair | 2 classical bits | 1 qubit |
| superdense coding | 1 Bell pair | 1 qubit | 2 classical bits |
In both, the shared entanglement is used up. Neither creates communication out of nothing: superdense coding still sends a physical qubit, and teleportation still needs the two bits.
Alice uses superdense coding to send Bob a 256-bit key. How many qubits does she physically send, and how many shared Bell pairs are used up?
Lecture 6 left a promise: Bell pairs do something no pre-arranged classical scheme can, but only when the two sides measure along different directions. The cleanest way to see it is as a game.
A referee picks two independent uniformly random bits \(x\) and \(y\), sends \(x\) to Alice and \(y\) to Bob, and they reply with bits \(a\) and \(b\). They may agree on a strategy beforehand but cannot communicate once the game starts. They win if
$$a\oplus b=x\wedge y ,$$that is, their answers must agree unless \(x=y=1\), in which case they must disagree.
The referee sends \(x=1\) to Alice and \(y=0\) to Bob, and Alice answers \(a=1\). To win, Bob must answer .
Every classical strategy, deterministic or randomised, wins with probability at most \(\tfrac34\), and \(\tfrac34\) is achieved by always answering \(a=b=0\).
Deterministic strategies. Alice's strategy is a pair of answers \(a_0,a_1\) (for \(x=0,1\)), and Bob's is \(b_0,b_1\). Winning all four questions would need
$$a_0\oplus b_0=0,\qquad a_0\oplus b_1=0,\qquad a_1\oplus b_0=0,\qquad a_1\oplus b_1=1 .$$Adding all four equations mod 2, each of \(a_0,a_1,b_0,b_1\) appears twice, so the left side is 0, while the right side is 1. So at most three of the four question pairs are won, and the win probability is at most \(\tfrac34\). Enumerating all 16 deterministic strategies confirms that 8 of them win exactly \(\tfrac34\) and the other 8 win \(\tfrac14\).
Randomised strategies. A randomised strategy is a random choice of a deterministic one (shared randomness included). Its win probability is an average of the win probabilities of deterministic strategies, each at most \(\tfrac34\), so it is at most \(\tfrac34\) too.
Alice always answers \(a=1\) and Bob always answers \(b=0\), whatever the questions. What is their win probability?
Now give Alice and Bob a Bell pair \(|\Phi^+\rangle\). Each measures along a direction in the x–z plane of the Bloch sphere, chosen by their input. Measuring along the direction at angle \(a\) from the \(z\)-axis means rotating by \(R_y(-a)\) and then measuring in the standard basis; Lecture 6 showed that for \(|\Phi^+\rangle\) the two outcomes then agree with probability \(\cos^2\!\big(\tfrac{a-b}{2}\big)\).
On the question \(x=y=1\), Alice measures at angle \(\pi/2\) and Bob at \(-\pi/6\) (sharing \(|\Phi^+\rangle\)). What is the probability that they win this round?
With the angles in the figure, the CHSH game is won with probability \(\cos^2(\pi/8)=\tfrac{2+\sqrt2}{4}\approx0.854\) for every question pair, hence overall.
For \((x,y)=(0,0),(0,1),(1,0)\) the angle differences are \(-\pi/4\), \(\pi/4\), \(\pi/4\), so the answers agree, which is what wins, with probability \(\cos^2(\pi/8)\). For \((1,1)\) the difference is \(\pi/2-(-\pi/4)=3\pi/4\); they must disagree, which happens with probability \(1-\cos^2(3\pi/8)=\sin^2(3\pi/8)=\cos^2(\pi/8)\). Finally, \(\cos^2(\pi/8)=\tfrac12(1+\cos\tfrac\pi4)=\tfrac{2+\sqrt2}{4}\).
Physicists usually state the same fact with correlators. Write the answers as \(\pm1\) instead of bits, and let \(E(x,y)=P(\text{agree})-P(\text{disagree})\) for questions \(x,y\). For the strategy above \(E=\cos(a-b)\). The CHSH quantity is
$$S=E(0,0)+E(0,1)+E(1,0)-E(1,1),$$and the win probability is exactly \(\tfrac12+\tfrac S8\). The classical bound \(\tfrac34\) becomes \(|S|\le2\); the quantum strategy reaches \(S=4\cos\tfrac\pi4=2\sqrt2\approx2.828\). Tsirelson proved in 1980 that no quantum strategy does better: \(2\sqrt2\) is the quantum maximum, just as 2 is the classical one. Lab 2 measures \(S\) on real hardware.
An experiment estimates \(S=2.4\). What CHSH win probability does that correspond to?
The game rules out every model in which the answers are fixed in advance, possibly at random, by information the two sides share ("local hidden variables"). It does not let Alice send Bob a message: each of their answers on its own is a fair coin whatever the other's question was. Experiments with the loopholes closed (2015, Delft, Vienna and Boulder) observed \(S>2\); the 2022 Nobel Prize in Physics recognised the experimental work that led to them. For cryptography the point is that a value of \(S\) near \(2\sqrt2\) certifies entanglement using only the observed statistics, which is the engine of the E91 protocol (Lecture 20).
import numpy as np from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister from qiskit_aer import AerSimulator theta = 2 * np.arccos(3 / 5) # R_y(theta)|0> = (3|0> + 4|1>)/5 q = QuantumRegister(3, "q") # q0 = |psi>, q1 = Alice's half, q2 = Bob's half m = ClassicalRegister(2, "m") # Alice's two bits check = ClassicalRegister(1, "check") # Bob's final test qc = QuantumCircuit(q, m, check) qc.ry(theta, 0); qc.s(0) # |psi> = (3|0> + 4i|1>)/5 on q0 qc.h(1); qc.cx(1, 2) # Bell pair on q1, q2 qc.barrier() qc.cx(0, 1); qc.h(0) # Alice's Bell-basis rotation qc.measure(0, m[0]); qc.measure(1, m[1]) # mid-circuit measurements with qc.if_test((m[1], 1)): # feed-forward: Bob corrects qc.x(2) with qc.if_test((m[0], 1)): qc.z(2) qc.barrier() qc.sdg(2); qc.ry(-theta, 2) # undo the preparation on Bob's qubit qc.measure(2, check[0]) # reads 0 every time iff Bob holds |psi> counts = AerSimulator(seed_simulator=3).run(qc, shots=4000).result().get_counts() print(dict(sorted(counts.items()))) # keys are "check m1m0"
{'0 00': 975, '0 01': 1000, '0 10': 1020, '0 11': 1005}
The check bit is 0 in all 4000 shots, so Bob held exactly \(|\psi\rangle\), while Alice's two bits are spread evenly over the four values, as Theorem 8.2 says. Measuring Bob's qubit directly would only test \(|\alpha|^2\) and would miss a forgotten \(Z\) correction; undoing the preparation first tests the phase too. if_test makes a dynamic circuit: later gates depend on earlier measurement results. The basic StatevectorSampler does not run these, so we use the Aer simulator (pip install qiskit-aer); IBM hardware runs them natively.
import numpy as np from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector, partial_trace, state_fidelity psi = Statevector([3 / 5, 4j / 5]) # the state to teleport, on q0 qc = QuantumCircuit(3) qc.h(1); qc.cx(1, 2) # Bell pair on q1, q2 qc.cx(0, 1); qc.h(0) # Alice's rotation qc.cx(1, 2); qc.cz(0, 2) # corrections controlled by qubits instead of bits start = Statevector.from_label("00").tensor(psi) # |q2 q1> = |00>, q0 = |psi> bob = partial_trace(start.evolve(qc), [0, 1]) # Bob's qubit on its own (Lecture 18) print("fidelity of Bob's qubit with |psi>:", round(state_fidelity(bob, psi), 10))
fidelity of Bob's qubit with |psi>: 1.0
A measurement followed by a classically controlled gate can always be replaced by the corresponding quantum-controlled gate, with the measurement moved to the end (the principle of deferred measurement). That turns the protocol into a plain unitary circuit that Statevector can simulate. partial_trace extracts Bob's qubit as a density matrix, a preview of Lecture 18.
from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector for bits in ["00", "01", "10", "11"]: # the two bits b1 b0 Alice wants to send qc = QuantumCircuit(2) # q0 = Alice's half, q1 = Bob's half qc.h(0); qc.cx(0, 1) # shared |Phi+> if bits[1] == "1": qc.x(0) # b0 -> X on Alice's qubit if bits[0] == "1": qc.z(0) # b1 -> Z on Alice's qubit print(bits, Statevector.from_instruction(qc).data.real.round(3) + 0.0)
00 [0.707 0. 0. 0.707] 01 [0. 0.707 0.707 0. ] 10 [ 0.707 0. 0. -0.707] 11 [ 0. -0.707 0.707 0. ]
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
def E(a, b):
"""correlator <A B> for |Phi+> measured along Bloch angles a (Alice, q1) and b (Bob, q0)"""
qc = QuantumCircuit(2)
qc.h(0); qc.cx(0, 1) # |Phi+>
qc.ry(-a, 1); qc.ry(-b, 0) # rotate each measurement axis onto z
p = Statevector.from_instruction(qc).probabilities_dict()
return p.get("00", 0) + p.get("11", 0) - p.get("01", 0) - p.get("10", 0)
a0, a1, b0, b1 = 0, np.pi / 2, np.pi / 4, -np.pi / 4
S = E(a0, b0) + E(a0, b1) + E(a1, b0) - E(a1, b1)
print("S =", round(S, 4), " 2*sqrt(2) =", round(2 * np.sqrt(2), 4), " win rate =", round(0.5 + S / 8, 4))
S = 2.8284 2*sqrt(2) = 2.8284 win rate = 0.8536
The four encoded states are \(|\Phi^+\rangle,|\Psi^+\rangle,|\Phi^-\rangle,-|\Psi^-\rangle\) (amplitudes in the order 00, 01, 10, 11), as in Proposition 8.3. The + 0.0 turns any printed -0. into 0..
Goal. Verify entanglement experimentally, and use mid-circuit measurement.
Hardware budget: at most 30 seconds of machine time. Batch the four CHSH circuits into one job, and debug on the simulator first.
Next time: Block II begins with the query model and the first algorithms that beat classical ones: Deutsch–Jozsa and Bernstein–Vazirani. HW4 is due at the start of Week 5; Lab 2 in ten days.
cx(0, 1) does it. \(|+\rangle,|-\rangle\): orthogonal, so allowed; apply \(H\) to qubit 0 (turning \(|\pm\rangle\) into \(|0\rangle,|1\rangle\)), then cx(0, 1), then \(H\) to both qubits, which turns \(|00\rangle,|11\rangle\) into \(|{+}{+}\rangle,|{-}{-}\rangle\). \(|0\rangle,|+\rangle\): \(\langle0|+\rangle=\tfrac{1}{\sqrt2}\) is neither 0 nor 1, so no unitary copies both.if_test) and Qiskit Aer.all numbers and figures in these notes are computed in python (verify_L08.py) and follow the page theme