Exercises: Chapter 2 — The Qubit: Superposition, the Bloch Sphere, and Why a Quantum Bit Is Fundamentally Different from a Classical Bit
Exercise 2.1: Normalization
Verify that the following states are properly normalized. If not, normalize them. (a) $|\psi\rangle = \frac{1}{2}|0\rangle + \frac{\sqrt{3}}{2}|1\rangle$ (b) $|\psi\rangle = \frac{1+i}{2}|0\rangle + \frac{1-i}{2}|1\rangle$ (c) $|\psi\rangle = \frac{1}{\sqrt{3}}|0\rangle + \sqrt{\frac{2}{3}}|1\rangle$ (d) $|\psi\rangle = \frac{3}{5}|0\rangle + \frac{4}{5}|1\rangle$ — is this normalized? If not, normalize it. (e) $|\psi\rangle = (1+i)|0\rangle + (1-i)|1\rangle$ — normalize this state.
Exercise 2.2: Bloch Sphere Coordinates
For each state below, find the Bloch sphere parameters $\theta$ and $\phi$: (a) $|0\rangle$ (b) $|1\rangle$ (c) $|+\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}}$ (d) $|+i\rangle = \frac{|0\rangle + i|1\rangle}{\sqrt{2}}$ (e) $|\psi\rangle = \frac{\sqrt{3}}{2}|0\rangle + \frac{1}{2}|1\rangle$ (f) $|\psi\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{i}{\sqrt{2}}|1\rangle$
Exercise 2.3: Measurement Probabilities
A qubit is prepared in the state $|\psi\rangle = \frac{1}{\sqrt{3}}|0\rangle + \sqrt{\frac{2}{3}}e^{i\pi/4}|1\rangle$. (a) What is the probability of measuring $|0\rangle$? (b) What is the probability of measuring $|1\rangle$? (c) If we measure and obtain $|1\rangle$, what is the post-measurement state? (d) What is the probability of measuring $|+\rangle$? (Hint: compute $|\langle+|\psi\rangle|^2$) (e) What is the probability of measuring $|+i\rangle$?
Exercise 2.4: Qiskit Practice
Write a Qiskit program that: (a) Creates a qubit in state $|0\rangle$. (b) Applies a Hadamard gate, then an $S$ gate. (c) Measures in the computational basis with 2048 shots. (d) What state should this produce? What measurement probabilities do you expect? Do your results match? (e) Now modify the circuit: apply H, then T, then H. What state does this produce? Verify with simulation.
Exercise 2.5: Density Matrix Distinction
Compute the density matrices for: (a) The equal superposition state $|+\rangle$. (b) A classical 50-50 mixture of $|0\rangle$ and $|1\rangle$. (c) Show that $\text{Tr}(\rho^2) = 1$ for the pure state and $\text{Tr}(\rho^2) < 1$ for the mixture. This quantity is called the purity. (d) Compute the density matrix for $|\psi\rangle = \frac{3}{5}|0\rangle + \frac{4}{5}|1\rangle$ and verify it has purity 1.
Exercise 2.6: Interference Calculation
Starting from state $|0\rangle$, apply the following gate sequence: $H \to T \to H$, where $T$ is the $\pi/8$ gate with matrix $T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}$. Compute the final state vector step by step. What are the measurement probabilities?
Exercise 2.7: Global vs. Relative Phase
(a) Show that the states $|\psi\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ and $|\phi\rangle = \frac{1}{\sqrt{2}}(-|0\rangle - |1\rangle)$ produce the same measurement statistics in every basis. (Hint: compute $|\langle\chi|\psi\rangle|^2$ and $|\langle\chi|\phi\rangle|^2$ for an arbitrary state $|\chi\rangle$.) (b) Show that the states $|+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ and $|-\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)$ can be distinguished by a measurement. Compute $|\langle+|-\rangle|^2$.
Exercise 2.8: Bloch Vector Computation
For each of the following states, compute the Bloch vector $(r_x, r_y, r_z)$: (a) $|\psi\rangle = \frac{1}{\sqrt{2}}(|0\rangle + i|1\rangle)$ (b) $|\psi\rangle = \frac{1}{\sqrt{2}}(|0\rangle + e^{i\pi/3}|1\rangle)$ (c) $|\psi\rangle = \cos(\pi/8)|0\rangle + \sin(\pi/8)|1\rangle$ Verify that each Bloch vector has magnitude 1 (pure state).
Exercise 2.9: Measurement in the Y-Basis
Define the Y-basis states $|+i\rangle = \frac{1}{\sqrt{2}}(|0\rangle + i|1\rangle)$ and $|-i\rangle = \frac{1}{\sqrt{2}}(|0\rangle - i|1\rangle)$. (a) Verify that these form an orthonormal basis: $\langle+i|+i\rangle = 1$, $\langle-i|-i\rangle = 1$, $\langle+i|-i\rangle = 0$. (b) If a qubit is in state $|0\rangle$, what are the probabilities of measuring $|+i\rangle$ and $|-i\rangle$? (c) If a qubit is in state $|+\rangle$, what are the probabilities of measuring $|+i\rangle$ and $|-i\rangle$?
Exercise 2.10: Qiskit Exploration
Write a Qiskit program that prepares each of the six cardinal Bloch sphere states ($|0\rangle$, $|1\rangle$, $|+\rangle$, $|-\rangle$, $|+i\rangle$, $|-i\rangle$), measures each in the computational basis with 4096 shots, and reports the statistics. Verify that the measurement results match the theoretical predictions. Then measure each state in the Hadamard basis and compare.