Quantum Computation & Cryptography · Lecture 3

Lecture 3
The Qubit: Born Rule and Bloch Sphere

Week 2  |  states, measurement, phase, and a ball to draw them on  |  reading: Watrous §1.2

Cartoon: a whole sphere of states goes in, one bit comes outA stick figure stands next to a sphere with an arrow pointing to a spot on its surface. An arrow leads from the sphere into a box labelled measure, and out of the box comes a single digit 0. A speech bubble says: a whole sphere of states, and I get one bit? a whole sphere of states...and I get one bit? measure0
infinitely many states in, one bit out: both halves of that sentence matter
In this lecture
  1. The qubit, officially
  2. Measuring in other bases
  3. Measurement is sampling
  4. Global phase and relative phase
  5. Two angles describe every qubit
  6. The Bloch sphere
  7. One bit out
  8. Try it in code
  9. Summary and exercises

Lecture 1 promised that a qubit is a unit vector of amplitudes, and Lecture 2 built the language for such vectors. This lecture turns the promise into rules. By the end you should be able to compute the probabilities of any measurement on any qubit state; say which differences between state vectors are physical and which are only bookkeeping; describe any qubit by two angles; and place it, and read its measurement statistics, on the Bloch sphere.

1 — The qubit, officially

definition 3.1 — qubit state

The state of a qubit is a unit vector in \(\mathbb C^2\):

$$|\psi\rangle=\alpha\,|0\rangle+\beta\,|1\rangle=\begin{pmatrix}\alpha\\[2pt] \beta\end{pmatrix},\qquad |\alpha|^2+|\beta|^2=1 .$$

The numbers \(\alpha\) and \(\beta\) are the amplitudes of \(|0\rangle\) and \(|1\rangle\).

For which positive real number \(c\) is \(\tfrac12|0\rangle+c\,|1\rangle\) a qubit state?

The only condition is normalisation: \(|\alpha|^2+|\beta|^2=1\). Here \(|\alpha|^2=\tfrac14\).
\(\tfrac14+c^2=1\) gives \(c=\tfrac{\sqrt3}{2}\approx0.866\).

A state on its own predicts nothing until we say what happens when we look at it. That is the job of a single rule, which we take as an axiom.

axiom 3.2 — the Born rule

Measuring \(|\psi\rangle\) in the standard basis gives outcome \(k\in\{0,1\}\) with probability

$$P(k)=|\langle k|\psi\rangle|^2,\qquad\text{so}\qquad P(0)=|\alpha|^2,\quad P(1)=|\beta|^2 .$$

Immediately after the measurement the qubit is in the state \(|k\rangle\) that was observed. More generally, measuring in any orthonormal basis \(\{|b_0\rangle,|b_1\rangle\}\) gives outcome \(b_k\) with probability \(|\langle b_k|\psi\rangle|^2\) and leaves the qubit in \(|b_k\rangle\).

Two things are packed into the axiom. The first is the probability rule, which you have been using since Lecture 1. The second is collapse: measurement is not a passive look. Whatever superposition the qubit was in is replaced by the basis state you saw, so measuring again in the same basis gives the same answer with certainty.

A qubit in the state \(\tfrac12|0\rangle+\tfrac{\sqrt3}{2}|1\rangle\) is measured in the standard basis, and the outcome is 1. It is measured again, immediately, in the same basis. The second measurement gives 1 with probability .

After the first outcome, collapse replaces the state by the basis state that was observed.
The first measurement left the qubit in \(|1\rangle\), so the second one returns 1 with certainty.
example 3.1 — the running example

Let \(|\psi\rangle=\tfrac35|0\rangle+\tfrac{4i}{5}|1\rangle\). Check that it is a valid state, find the outcome probabilities in the standard basis, and say what state the qubit is in after the outcome 1 is observed.

The squared sizes of the amplitudes are \(|3/5|^2=9/25\) and \(|4i/5|^2=16/25\). They add to 1, so this is a state, and

$$P(0)=\frac{9}{25}=0.36,\qquad P(1)=\frac{16}{25}=0.64 .$$

The factor \(i\) on the second amplitude has no effect on these numbers, since \(|i|=1\). After outcome 1 the qubit is in \(|1\rangle\): the original amplitudes, including that factor of \(i\), are gone.

history — a footnote that changed physics

In 1926 Erwin Schrödinger wrote down his wave equation without being sure what the wave meant. That summer Max Born, studying collisions between particles, proposed that the wave gives the probability of finding a particle, and in a note added while the paper was in proof he corrected himself: the probability is proportional to the square of the amplitude. Born received the Nobel Prize for it in 1954. Nearly a century later the rule has never failed a test, and no one has derived it from anything simpler. We take it as given, as physicists do.

2 — Measuring in other bases

The standard basis is the one quantum hardware measures natively, but the Born rule works for any orthonormal basis. Lecture 2 introduced the three bases that matter most: Z \((|0\rangle,|1\rangle)\), X \((|+\rangle,|-\rangle)\) and Y \((|{+i}\rangle,|{-i}\rangle)\). Measuring the same state in different bases asks it different questions, and the answers can be very different.

The qubit is in \(|0\rangle\). It is measured in the X basis \(\{|+\rangle,|-\rangle\}\). What is the probability of the outcome \(+\)?

Use the general Born rule: \(P(+)=|\langle+|0\rangle|^2\), and \(\langle+|=\tfrac1{\sqrt2}(1\;\;1)\).
\(\langle+|0\rangle=\tfrac1{\sqrt2}\), so \(P(+)=\tfrac12\). A state that is certain in one basis can be a coin toss in another.
example 3.2 — three questions, one state

For \(|\psi\rangle=\tfrac35|0\rangle+\tfrac{4i}{5}|1\rangle\), find the outcome probabilities in the X basis and in the Y basis.

X basis. With \(\langle+|=\tfrac1{\sqrt2}(1\;\;1)\),

$$\langle+|\psi\rangle=\frac{1}{\sqrt2}\Big(\frac35+\frac{4i}{5}\Big),\qquad P(+)=\frac12\cdot\frac{|3+4i|^2}{25}=\frac12\cdot\frac{25}{25}=\frac12,$$

and so \(P(-)=\tfrac12\). The X basis sees a fair coin.

Y basis. Remember the conjugate: \(\langle{+i}|=\tfrac{1}{\sqrt2}(1\;\;-i)\). Then

$$\langle{+i}|\psi\rangle=\frac{1}{\sqrt2}\Big(\frac35+(-i)\frac{4i}{5}\Big)=\frac{1}{\sqrt2}\Big(\frac35+\frac45\Big)=\frac{7}{5\sqrt2},$$ $$P({+i})=\frac{49}{50}=0.98,$$

and so \(P({-i})=0.02\). In the Y basis the state is almost certain. The same qubit is 36/64 in Z, 50/50 in X and 98/2 in Y.

idea — a state is a list of answers to every possible question

No single measurement tells you what a qubit "is". The state \(|\psi\rangle\) is best thought of as a compact rule that predicts the answer statistics for every measurement you could make, in every basis at once. Example 3.2 shows how different those answers can be. Section 6 will show that three numbers, the Z, X and Y answers, are enough to pin the state down completely.

Measure a qubit

Choose a state and a basis, then take shots. The dashed lines are the Born-rule probabilities; the bars are what you actually see. Changing the basis starts a fresh experiment on fresh copies of the same state.

3 — Measurement is sampling

Collapse has an uncomfortable consequence. You cannot measure the same qubit twice to learn more about it, because after the first measurement the old state is gone. To learn \(P(0)\) you need many identically prepared copies, one measurement per copy. Each run of the circuit is called a shot, and what a quantum computer returns is a table of counts. In the language of probability and statistics, each shot is a Bernoulli trial with success probability \(p=P(0)\), and the proportion of zeros \(\hat p\) estimates \(p\) with the familiar standard error \(\sqrt{\hat p(1-\hat p)/n}\).

example 3.3 — which state was it?

A device is supposed to prepare either the running example \(|\psi\rangle\) (with \(P(0)=0.36\)) or the state \(|+\rangle\) (with \(P(0)=0.5\)). You measure 100 copies in the standard basis and see 38 zeros. Build a 95% confidence interval for \(P(0)\). Which state is consistent with the data?

\(\hat p=0.38\) and the half-width is \(1.96\sqrt{0.38\cdot0.62/100}\approx0.095\), so the interval is

$$(0.285,\;0.475).$$

It contains 0.36 and excludes 0.5, so the data point to \(|\psi\rangle\). With only 100 shots the interval is almost 0.2 wide: telling two states apart is a statistics problem, and its cost is paid in shots.

idea — you never see the amplitudes

Amplitudes are never observed directly, not even their sizes. What you observe are frequencies, which converge to \(|\alpha|^2\) at the slow rate \(1/\sqrt n\). Every quantum algorithm in this course ends the same way: run the circuit many times and read off the most common answer. A good algorithm is one where the right answer is common enough to stand out after a modest number of shots.

4 — Global phase and relative phase

Two different vectors can describe the same physical state. The simplest case is multiplying the whole vector by a number of size 1.

proposition 3.1 — global phase is invisible

For any real \(\gamma\), the states \(|\psi\rangle\) and \(e^{i\gamma}|\psi\rangle\) give identical probabilities for every measurement in every basis. They are the same physical state.

For any basis vector \(|b\rangle\), linearity and \(|e^{i\gamma}|=1\) give

$$\big|\langle b|\,e^{i\gamma}\psi\rangle\big|^2=|e^{i\gamma}|^2\,|\langle b|\psi\rangle|^2=|\langle b|\psi\rangle|^2 .$$

No measurement can tell the two vectors apart. The same holds after any gate \(U\), because \(U(e^{i\gamma}|\psi\rangle)=e^{i\gamma}U|\psi\rangle\): the factor just rides along to the end.

So \(|0\rangle\) and \(-|0\rangle\) are the same state, and so are \(|{+i}\rangle\) and \(i|{+i}\rangle\). A factor multiplying the whole vector is called a global phase, and we are free to drop it.

A phase between the two amplitudes is a different matter. Compare \(|+\rangle=\tfrac{1}{\sqrt2}(|0\rangle+|1\rangle)\) and \(|-\rangle=\tfrac{1}{\sqrt2}(|0\rangle-|1\rangle)\). In the standard basis both give 50/50, but in the X basis \(|+\rangle\) gives \(+\) with certainty and \(|-\rangle\) gives \(-\) with certainty. They are as different as two states can be. The minus sign here is a relative phase: it multiplies only one amplitude, so it cannot be factored out of the whole vector.

Tick every pair that describes the same physical state.

Ask of each pair: is the second vector the first multiplied, as a whole, by one number of size 1?
Three pairs differ by a global phase (\(-1\), \(i\), \(i\)); the other two differ by a relative phase, which is physical.
example 3.4 — dialing the relative phase

For each real \(\varphi\), let \(|\psi_\varphi\rangle=\tfrac{1}{\sqrt2}\big(|0\rangle+e^{i\varphi}|1\rangle\big)\). Find \(P(0)\) in the standard basis and \(P(+)\) in the X basis as functions of \(\varphi\).

Standard basis: \(P(0)=|1/\sqrt2|^2=\tfrac12\) for every \(\varphi\). The Z measurement is blind to \(\varphi\). X basis:

$$\langle+|\psi_\varphi\rangle=\frac12\big(1+e^{i\varphi}\big),$$ $$P(+)=\frac14\,\big|1+e^{i\varphi}\big|^2=\frac14\big(2+2\cos\varphi\big)=\frac{1+\cos\varphi}{2}.$$

Here we used \(|1+e^{i\varphi}|^2=(1+e^{i\varphi})(1+e^{-i\varphi})=2+2\cos\varphi\). As \(\varphi\) runs around the circle, \(P(+)\) swings from 1 at \(|+\rangle\), through \(\tfrac12\) at \(|{+i}\rangle\), to 0 at \(|-\rangle\), and back.

Relative phase is invisible in the Z basis but not in the X basisFor the states (|0> + e^(i phi)|1>)/sqrt(2), as phi runs from 0 to 2 pi, the probability of reading 0 in the standard basis stays flat at 1/2, while the probability of the outcome + in the X basis traces the fringe (1 + cos phi)/2: 1 at phi = 0 (the state |+>), 1/2 at pi/2 (|+i>), 0 at pi (|->), 1/2 at 3 pi/2 (|-i>), and back to 1.00.250.50.7510pi/2pi3pi/22pirelative phase phi|+>|+i>|->|-i>|+>P(0), standard basisP(+), X basis
The relative phase \(\varphi\) is invisible to the standard basis (flat line at \(\tfrac12\)) but controls the X-basis outcome completely. The curve \((1+\cos\varphi)/2\) is an interference fringe, the same arithmetic as the cancelling paths of Lecture 1, now inside a single qubit.
idea — physical versus bookkeeping

The rule is simple: a phase is physical exactly when it is relative. A global phase is like choosing where to start measuring angles: change it and nothing observable changes. A relative phase is an angle between two amplitudes, and angles between things are always measurable, provided you ask in a basis that mixes the two amplitudes, as the X and Y bases do. Much of the design of quantum algorithms is the design of relative phases.

5 — Two angles describe every qubit

A qubit state has two complex amplitudes, which is four real numbers. Normalisation removes one and the invisible global phase removes another, which leaves two. Here they are.

proposition 3.2 — the standard form of a qubit

Every qubit state can be written, up to a global phase, as

$$|\psi\rangle=\cos\frac{\theta}{2}\,|0\rangle+e^{i\varphi}\sin\frac{\theta}{2}\,|1\rangle,\qquad 0\le\theta\le\pi,\quad 0\le\varphi<2\pi .$$

The angles are unique, except that \(\varphi\) is irrelevant when \(\theta=0\) or \(\theta=\pi\).

Write the amplitudes in polar form, \(\alpha=|\alpha|e^{ia}\) and \(\beta=|\beta|e^{ib}\), and pull out the global phase \(e^{ia}\):

$$|\psi\rangle=e^{ia}\Big(|\alpha|\,|0\rangle+e^{i(b-a)}|\beta|\,|1\rangle\Big).$$

Since \(|\alpha|^2+|\beta|^2=1\) with both sizes nonnegative, there is a unique \(\theta\in[0,\pi]\) with \(|\alpha|=\cos(\theta/2)\) and \(|\beta|=\sin(\theta/2)\). Set \(\varphi=b-a\), reduced to \([0,2\pi)\). If \(\beta=0\) or \(\alpha=0\) the relative phase multiplies zero, so any \(\varphi\) works.

A state in standard form has \(\theta=\pi/3\) and \(\varphi=\pi/2\). What is the probability of outcome 1 in the standard basis?

\(P(1)=\big|e^{i\varphi}\sin\tfrac\theta2\big|^2=\sin^2\tfrac\theta2\). The phase \(\varphi\) does not matter here. Remember the half angle.
\(\sin^2(\pi/6)=\tfrac14\). In the standard basis only \(\theta\) matters; \(\varphi\) shows up only in other bases.
example 3.5 — strip the global phase

Find \(\theta\) and \(\varphi\) for \(|\chi\rangle=\tfrac{1+i}{2}|0\rangle+\tfrac{1}{\sqrt2}|1\rangle\).

\(\big|\tfrac{1+i}{2}\big|=\tfrac{\sqrt2}{2}=\tfrac1{\sqrt2}\), so \(\cos(\theta/2)=\tfrac1{\sqrt2}\) and \(\theta=\pi/2\). The first amplitude has phase \(\pi/4\) and the second has phase 0. Pulling out \(e^{i\pi/4}\):

$$|\chi\rangle=e^{i\pi/4}\Big(\frac{1}{\sqrt2}|0\rangle+e^{-i\pi/4}\frac{1}{\sqrt2}|1\rangle\Big),$$

so \(\varphi=-\pi/4\), which is \(7\pi/4\) in \([0,2\pi)\). The state lies on the equator of the sphere of the next section, halfway between \(|+\rangle\) and \(|{-i}\rangle\).

example 3.6 — aiming for a probability

Find a real state with \(P(0)=\tfrac34\), and give its \(\theta\).

We need \(\cos^2(\theta/2)=\tfrac34\), so \(\cos(\theta/2)=\tfrac{\sqrt3}{2}\) and \(\theta/2=\pi/6\). The state is \(\cos\tfrac\pi6|0\rangle+\sin\tfrac\pi6|1\rangle=\tfrac{\sqrt3}{2}|0\rangle+\tfrac12|1\rangle\), with \(\theta=\pi/3\). In general \(P(0)=\cos^2(\theta/2)\) depends on \(\theta\) alone: \(\theta\) controls the Z statistics and \(\varphi\) controls the rest.

Why \(\theta/2\)?

The half angle looks like an odd choice, but it is forced on us. Orthogonal states, such as \(|0\rangle\) and \(|1\rangle\), are 90° apart as vectors. We want them at opposite ends of our picture, 180° apart, because they are perfectly distinguishable. So every angle between state vectors is doubled when we draw it. The formula uses \(\theta/2\) so that \(\theta\) itself is the angle in the picture.

Why theta/2: angles double on the Bloch sphereLeft: real amplitude vectors (cos(theta/2), sin(theta/2)) in the plane. |0> points right, |+> at 45 degrees, |1> straight up: |0> and |1> are 90 degrees apart and orthogonal. Right: the same states on the xz great circle of the Bloch sphere, where every angle is doubled: |+> is 90 degrees from |0>, and |1> is 180 degrees away, at the opposite pole. Orthogonal states are antipodal.amplitude plane: angle theta/2|0>|+>|1>45 deg|0> and |1>: 90 deg apart, orthogonalBloch sphere (xz circle): angle theta|0>|+>|1>90 deg|0> and |1>: 180 deg apart, antipodal
Left: real state vectors \((\cos\tfrac\theta2,\sin\tfrac\theta2)\) in the amplitude plane, where \(|0\rangle\) and \(|1\rangle\) are 90° apart. Right: the same states on the Bloch sphere, where every angle doubles, so \(|+\rangle\) sits 90° from \(|0\rangle\) and \(|1\rangle\) sits at the opposite pole.

6 — The Bloch sphere

definition 3.3 — Bloch vector

The Bloch vector of \(\cos\tfrac\theta2|0\rangle+e^{i\varphi}\sin\tfrac\theta2|1\rangle\) is the point of the unit sphere with polar angle \(\theta\) (measured from the north pole) and azimuth \(\varphi\):

$$\vec r=(x,\;y,\;z)=\big(\sin\theta\cos\varphi,\;\;\sin\theta\sin\varphi,\;\;\cos\theta\big).$$

Every qubit state corresponds to exactly one point of the sphere, and every point to exactly one state (up to global phase).

The Bloch sphere with the six cardinal states and the example stateA sphere drawn in perspective with the z axis up. The state |0> sits at the north pole and |1> at the south pole. On the equator, |+> is on the positive x axis pointing toward the viewer, |-> is opposite it, |+i> is on the positive y axis to the right, and |-i> is opposite it. The example state (3|0> + 4i|1>)/5 is drawn as an arrow to the point (0, 0.96, -0.28): almost at |+i>, tipped slightly below the equator.|0>|1>|+>|->|+i>|-i>zxypsi = (3|0> + 4i|1>)/5(x,y,z) = (0, 0.96, -0.28)
The Bloch sphere. The Z basis sits at the poles, the X basis on the \(x\) axis (pointing toward you) and the Y basis on the \(y\) axis. Hollow markers are on the far side. The running example \((3|0\rangle+4i|1\rangle)/5\) sits at \((0,\,0.96,\,-0.28)\), very close to \(|{+i}\rangle\).
state\(\theta\)\(\varphi\)\((x,y,z)\)where
\(|0\rangle\)\(0\)any\((0,0,1)\)north pole
\(|1\rangle\)\(\pi\)any\((0,0,-1)\)south pole
\(|+\rangle\)\(\pi/2\)\(0\)\((1,0,0)\)equator, \(+x\)
\(|-\rangle\)\(\pi/2\)\(\pi\)\((-1,0,0)\)equator, \(-x\)
\(|{+i}\rangle\)\(\pi/2\)\(\pi/2\)\((0,1,0)\)equator, \(+y\)
\(|{-i}\rangle\)\(\pi/2\)\(3\pi/2\)\((0,-1,0)\)equator, \(-y\)

Find the Bloch vector of \(\tfrac12|0\rangle+\tfrac{\sqrt3}{2}e^{i\pi/4}|1\rangle\).

Read off \(\theta\) and \(\varphi\) first: \(\cos\tfrac\theta2=\tfrac12\) gives \(\theta=2\pi/3\), and \(\varphi=\pi/4\). Then use \((\sin\theta\cos\varphi,\ \sin\theta\sin\varphi,\ \cos\theta)\).
\(\sin\theta=\tfrac{\sqrt3}{2}\) and \(\cos\theta=-\tfrac12\), so \(x=y=\tfrac{\sqrt3}{2}\cdot\tfrac{\sqrt2}{2}=\tfrac{\sqrt6}{4}\approx0.612\) and \(z=-\tfrac12\): below the equator, halfway in longitude between the \(+x\) and \(+y\) directions.
example 3.7 — placing the running example

Find the Bloch vector of \(|\psi\rangle=\tfrac35|0\rangle+\tfrac{4i}{5}|1\rangle\).

The amplitudes are already in standard form: \(\cos(\theta/2)=\tfrac35\), \(\sin(\theta/2)=\tfrac45\), and \(e^{i\varphi}=i\), so \(\varphi=\pi/2\). The double-angle formulas give the Bloch coordinates without finding \(\theta\) itself:

$$z=\cos\theta=\cos^2\frac\theta2-\sin^2\frac\theta2=\frac{9}{25}-\frac{16}{25}=-0.28,$$ $$\sin\theta=2\sin\frac\theta2\cos\frac\theta2=\frac{24}{25}=0.96 .$$

With \(\varphi=\pi/2\), \(x=0.96\cos\tfrac\pi2=0\) and \(y=0.96\sin\tfrac\pi2=0.96\). So \(\vec r=(0,\;0.96,\;-0.28)\). Check: \(0^2+0.96^2+0.28^2=0.9216+0.0784=1\).

Now compare those coordinates with Example 3.2: \(P(0)-P(1)=0.36-0.64=-0.28\), \(P(+)-P(-)=0.5-0.5=0\), and \(P({+i})-P({-i})=0.98-0.02=0.96\). That is not a coincidence.

proposition 3.3 — the coordinates are measurable

For any qubit state with Bloch vector \((x,y,z)\),

$$z=P(0)-P(1),\qquad x=P(+)-P(-),\qquad y=P({+i})-P({-i}),$$

where each difference comes from measuring in the Z, X or Y basis respectively. Equivalently, \(P(0)=\tfrac{1+z}{2}\), \(P(+)=\tfrac{1+x}{2}\) and \(P({+i})=\tfrac{1+y}{2}\).

Write \(c=\cos(\theta/2)\) and \(s=\sin(\theta/2)\), so the state is \((c,\;e^{i\varphi}s)\).

Z. \(P(0)-P(1)=c^2-s^2=\cos\theta=z\).

X. \(\langle\pm|\psi\rangle=\tfrac{1}{\sqrt2}(c\pm e^{i\varphi}s)\), so

$$P(\pm)=\frac12\big|c\pm e^{i\varphi}s\big|^2=\frac12\big(c^2+s^2\pm2cs\cos\varphi\big)=\frac12\big(1\pm\sin\theta\cos\varphi\big),$$

and \(P(+)-P(-)=\sin\theta\cos\varphi=x\).

Y. The same computation with \(\langle{\pm i}|=\tfrac{1}{\sqrt2}(1\;\;\mp i)\) is exercise 4.

A state has Bloch vector \((0.48,\ 0.64,\ 0.6)\). What are the outcome probabilities in the standard basis?

Only \(z\) matters for the Z basis: \(P(0)=\tfrac{1+z}{2}\).
\(P(0)=\tfrac{1.6}{2}=0.8\) and \(P(1)=0.2\). The \(x\) and \(y\) coordinates would show up in the X and Y bases.

This proposition changes what the sphere means. The Bloch vector is not only a drawing of the amplitudes; it is a summary of three experiments. Measure many copies in each of the three bases, compute three differences of frequencies, and you have estimated the state. This is state tomography, and you will do it in Lab 2. More generally, for any two states the overlap is

$$|\langle\chi|\psi\rangle|^2=\frac{1+\vec r_\chi\cdot\vec r_\psi}{2},$$

which contains Proposition 3.3 as the special cases \(|\chi\rangle=|0\rangle,|+\rangle,|{+i}\rangle\). We will prove it in Lecture 18.

idea — orthogonal means opposite

The overlap formula explains the most common confusion about the sphere. Two states are orthogonal, and therefore perfectly distinguishable, exactly when \(\vec r_\chi\cdot\vec r_\psi=-1\), which means their Bloch vectors point in opposite directions. Orthogonal states are antipodal, not at right angles. Two states at right angles on the sphere, such as \(|0\rangle\) and \(|+\rangle\), have overlap \(\tfrac12\): measuring one in the other's basis is a coin toss.

Which state is orthogonal to \(|{+i}\rangle\)?

Orthogonal means opposite on the sphere: look for the antipode of \((0,1,0)\).
\(|{-i}\rangle\) sits at \((0,-1,0)\), the antipode, so \(\vec r\cdot\vec r'=-1\) and the overlap is 0.

Bloch sphere explorer

Set \(\theta\) and \(\varphi\), or jump to a named state. Drag across the sphere (or use the view slider) to turn it. The readout gives the amplitudes, the Bloch vector, and the probabilities of the "plus" outcome in each basis. Check that each probability equals \((1+\text{coordinate})/2\).

7 — One bit out

The sphere invites a tempting mistake. A qubit's state is a point on a continuous sphere, described by two real numbers with unlimited decimal places. Can we store a whole library in \(\theta\) and \(\varphi\) and read it back?

No. Every measurement of a qubit returns one bit, 0 or 1, and destroys the state it measured. From one copy you learn one bit about \(\theta\) and \(\varphi\), and no clever choice of basis changes that. Estimating the angles precisely requires many copies, and the precision grows only like the square root of the number of copies, exactly as in Section 3. (A theorem of Alexander Holevo from 1973 makes this airtight: \(n\) qubits can deliver at most \(n\) bits of classical information.) The continuum inside a qubit is real, and quantum algorithms exploit it through interference, but it cannot simply be read out.

crypto connection — the disturbance that makes quantum cryptography work

Take the four states \(|0\rangle,|1\rangle\) (poles) and \(|+\rangle,|-\rangle\) (equator). Someone who does not know which pair was used must guess a basis. Guessing wrong gives a 50/50 random answer, because poles and equator are at right angles on the sphere, and the measurement collapses the state onto the wrong axis, which leaves detectable damage. This is the whole idea of the BB84 key-distribution protocol (Lecture 20): an eavesdropper cannot read the key without disturbing it, and the disturbance is visible in the statistics.

8 — Try it in code

tool — the Born rule in three bases (numpy)
import numpy as np

psi = np.array([3/5, 4j/5])
r = 1/np.sqrt(2)
bases = {"Z": ([1, 0], [0, 1]),
         "X": ([r, r], [r, -r]),
         "Y": ([r, 1j*r], [r, -1j*r])}
for name, (b0, b1) in bases.items():
    p0 = abs(np.vdot(b0, psi))**2           # Born rule: |<b|psi>|^2
    p1 = abs(np.vdot(b1, psi))**2
    print(name, round(p0, 4), round(p1, 4), " difference:", round(p0 - p1, 4))
Z 0.36 0.64  difference: -0.28
X 0.5 0.5  difference: 0.0
Y 0.98 0.02  difference: 0.96

The three differences are the Bloch vector \((x,y,z)=(0,\,0.96,\,-0.28)\), read off in the order z, x, y (Proposition 3.3).

tool — states, shots and phases in qiskit (tested with qiskit 2.5)
import numpy as np
from qiskit.quantum_info import Statevector, Pauli

psi = Statevector([3/5, 4j/5])
print(psi.probabilities())                  # Born rule, standard basis

psi.seed(7)                                 # fix the random sampler
counts = psi.sample_counts(shots=1000)      # what an experiment actually returns
print({str(k): int(v) for k, v in counts.items()})

bloch = [psi.expectation_value(Pauli(p)).real for p in "XYZ"]
print(np.round(bloch, 4))                   # Bloch vector (x, y, z)

shifted = Statevector(np.exp(0.7j) * psi.data)   # multiply by a global phase
print(psi.equiv(shifted))                   # same physical state?
[0.36 0.64]
{'0': 366, '1': 634}
[ 0.    0.96 -0.28]
True

expectation_value(Pauli("Z")) is exactly \(P(0)-P(1)\), and likewise for X and Y, which is Proposition 3.3 in one line. equiv compares states up to global phase.

9 — Summary and exercises

summary

Next time: gates as rotations of the Bloch sphere, measuring in other bases on real hardware, and the launch of Lab 1. HW2 is posted.

exercises 3
  1. Let \(|\psi\rangle=\tfrac{1}{\sqrt3}|0\rangle+\sqrt{\tfrac23}\,e^{i\pi/4}|1\rangle\). Find \(P(0)\) and \(P(1)\), the angles \(\theta\) and \(\varphi\), and the Bloch vector.
  2. (a) Are \(\tfrac{1}{\sqrt2}(i|0\rangle-|1\rangle)\) and \(\tfrac{1}{\sqrt2}(|0\rangle+i|1\rangle)\) the same physical state? (b) Are \(\tfrac{1}{\sqrt2}(|0\rangle+i|1\rangle)\) and \(\tfrac{1}{\sqrt2}(|0\rangle-i|1\rangle)\)?
  3. Find the state antipodal to \(\cos\tfrac\theta2|0\rangle+e^{i\varphi}\sin\tfrac\theta2|1\rangle\) on the Bloch sphere, and check directly that the two states are orthogonal.
  4. Finish the proof of Proposition 3.3: show that \(P({+i})-P({-i})=\sin\theta\sin\varphi\).
  5. The running example has \(P(0)=0.36\). (a) In 400 shots, between what counts of zeros will the result fall about 95% of the time? (b) How many shots guarantee a 95% interval of half-width at most 0.07, whatever the state? Why is 0.07 a natural target for telling the running example from \(|+\rangle\)?
  6. For \(|\psi_\varphi\rangle=\tfrac1{\sqrt2}(|0\rangle+e^{i\varphi}|1\rangle)\), find every \(\varphi\in[0,2\pi)\) with \(P(+)=\tfrac34\). Where are these states on the sphere?
  1. \(P(0)=\tfrac13\) and \(P(1)=\tfrac23\). \(\cos(\theta/2)=\tfrac1{\sqrt3}\), so \(\cos\theta=2\cdot\tfrac13-1=-\tfrac13\), and \(\varphi=\pi/4\). Also \(\sin\theta=2\cdot\tfrac1{\sqrt3}\cdot\sqrt{\tfrac23}=\tfrac{2\sqrt2}{3}\), so $$\vec r=\Big(\tfrac{2\sqrt2}{3}\cos\tfrac\pi4,\;\tfrac{2\sqrt2}{3}\sin\tfrac\pi4,\;-\tfrac13\Big)=\Big(\tfrac23,\;\tfrac23,\;-\tfrac13\Big),$$ and \(\tfrac49+\tfrac49+\tfrac19=1\).
  2. (a) Yes: \(i|0\rangle-|1\rangle=i\,(|0\rangle+i|1\rangle)\), a global phase \(i\). (b) No: these are \(|{+i}\rangle\) and \(|{-i}\rangle\), which differ by a relative phase. They are orthogonal (Lecture 2, Example 2.5), antipodal on the sphere, and perfectly distinguished by a Y-basis measurement.
  3. Antipodal means \(\theta\to\pi-\theta\) and \(\varphi\to\varphi+\pi\), giving \(\sin\tfrac\theta2|0\rangle-e^{i\varphi}\cos\tfrac\theta2|1\rangle\). Orthogonality: \(\sin\tfrac\theta2\cos\tfrac\theta2+\big(-e^{-i\varphi}\cos\tfrac\theta2\big)\big(e^{i\varphi}\sin\tfrac\theta2\big)=0\).
  4. \(\langle{\pm i}|\psi\rangle=\tfrac1{\sqrt2}\big(c\mp i\,e^{i\varphi}s\big)\), and \(\mp i\,e^{i\varphi}=e^{i(\varphi\mp\pi/2)}\). As in the X case, \(P(\pm i)=\tfrac12\big(1+2cs\cos(\varphi\mp\tfrac\pi2)\big)=\tfrac12(1\pm\sin\theta\sin\varphi)\), since \(\cos(\varphi\mp\tfrac\pi2)=\pm\sin\varphi\). So the difference is \(\sin\theta\sin\varphi=y\).
  5. (a) The count is binomial with mean \(400(0.36)=144\) and standard deviation \(\sqrt{400(0.36)(0.64)}=9.6\), so about 95% of experiments give between \(144-1.96(9.6)\approx125\) and \(144+1.96(9.6)\approx163\) zeros. (b) The worst case \(p=\tfrac12\) needs \(1.96\sqrt{0.25/n}\le0.07\), i.e. \(n\ge196\). The two candidates, 0.36 and 0.5, are 0.14 apart, with midpoint 0.43. A half-width of 0.07 is half that gap, so an interval centred at either true value stays on its own side of the midpoint.
  6. \((1+\cos\varphi)/2=\tfrac34\) gives \(\cos\varphi=\tfrac12\), so \(\varphi=\pi/3\) or \(5\pi/3\). Both states are on the equator (\(\theta=\pi/2\)), \(60^\circ\) either side of \(|+\rangle\), with \(x=\tfrac12\) in agreement with \(P(+)=\tfrac{1+x}{2}\).

Reading and sources

all numbers and figures in these notes are computed in python (verify_L03.py) and follow the page theme