In short

This is the practice chapter for Part 4. You have met the single-qubit gates — X, Y, Z, H, S, T, and the continuous rotations R_x(\theta), R_y(\theta), R_z(\theta) — and you have the Bloch sphere as the geometric picture. Below are eight worked problems that move a qubit from a given state to a target state using the gates you know. Each problem is a different kind of move: a single-gate transformation, a composition of two gates, a basis-changing conjugation, a precise rotation by a non-standard angle. Solve with matrix multiplication; verify with the Bloch sphere; if you have Qiskit installed, run the one-liner at the end of each problem to cross-check. By the end, the rhythm of "pick a gate, pick an axis, watch the arrow move" should be muscle memory.

Note: Interactive version coming soon

A drag-a-gate Bloch-sphere widget — the kind where you click an H button and watch the arrow swing 180° in real time — is in the pipeline as a future enhancement for padho-wiki. Until that ships, this article is the pencil-and-paper (or Qiskit) equivalent. Every problem below gives you the target state, the hint, the worked solution, and a Bloch-sphere before/after picture so you can see the gate acting even without a live widget.

You have spent several chapters building the single-qubit toolkit. X, Y, Z flip along the three axes. H swaps the computational basis with the plus-minus basis. S and T add phase. R_x(\theta), R_y(\theta), R_z(\theta) rotate by arbitrary continuous angles. On top of that, the Bloch sphere gives you a geometric picture — every state is a point on a unit ball, every gate is a rotation.

Now you practise. The problems below are designed to be solvable — each one clean, each one reinforcing a specific concept — not tricky for the sake of tricky. Work through them with paper and pen. Draw the Bloch sphere. Multiply out the matrices. Check the result against the geometry. If something doesn't match, that is when you learn — a mismatch between algebra and picture usually means you lost a phase or transposed a sign, and fixing it is where the lesson lives.

Two rules for gate-sequence notation you will see throughout this article. The circuit convention is left-to-right in time — a circuit drawn as |\psi\rangle - H - T - means first apply H, then apply T. The algebraic convention multiplies right-to-left — the state after is T H |\psi\rangle, with the gate that fires first sitting closest to the ket. These two conventions disagree on the visual order, and that disagreement is the source of a real fraction of student bugs. Whenever you translate a circuit to an algebra, write the leftmost gate in the circuit on the right in the product.

The eight problems

The problems are arranged in increasing order of composition depth — Problem 1 uses one gate; the later problems chain two, three, or more. By Problem 8, you are building a composite rotation axis from scratch.

Problem 1: Reach |+⟩ from |0⟩

Given: the state |0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, sitting at the north pole of the Bloch sphere.

Target: the state |+\rangle = \tfrac{1}{\sqrt 2}(|0\rangle + |1\rangle), sitting at the +x point on the equator.

Hint: which gate famously swaps the computational basis with the plus-minus basis?

Step 1. Identify the gate. H is the Hadamard, and its defining action is H|0\rangle = |+\rangle, H|1\rangle = |-\rangle. So one Hadamard does the job.

Why H and not (say) S or T: S and T are pure z-rotations — they leave |0\rangle fixed (only the amplitude of |1\rangle picks up a phase, which is invisible when the |1\rangle amplitude is zero). To move |0\rangle off the north pole, you need a gate with an x or y component to its rotation axis. H has both (its axis is the diagonal between +x and +z), and one Hadamard takes |0\rangle straight to |+\rangle.

Step 2. Verify by matrix multiplication.

H|0\rangle = \frac{1}{\sqrt 2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{\sqrt 2}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \tfrac{1}{\sqrt 2}(|0\rangle + |1\rangle) = |+\rangle.

Why this worked: matrix times column-vector is "each row dotted with the column." Row 1 of H is (1, 1)/\sqrt 2; dot with (1, 0) gives 1/\sqrt 2. Row 2 is (1, -1)/\sqrt 2; dot with (1, 0) gives 1/\sqrt 2. So the output column is (1, 1)/\sqrt 2, which is |+\rangle.

Result. The one-gate solution is H. Circuit: |0\rangle - H - |+\rangle.

Bloch sphere before and after H on |0⟩Two Bloch spheres side by side. Left shows |0⟩ at the north pole. Right shows |+⟩ at the +x equator point, with a curved arrow between them illustrating the Hadamard rotation.|0⟩|1⟩|+⟩beforeH →|0⟩|1⟩|+⟩after
One Hadamard takes $|0\rangle$ from the north pole to $|+\rangle$ on the $+x$ equator. The rotation axis is the diagonal between $+x$ and $+z$; a $180°$ turn about that axis swaps the two points that lie in the plane perpendicular to it.

Qiskit one-liner: QuantumCircuit(1).h(0) — prepare an H applied to a single qubit; measurement in the computational basis then gives 50-50 outcomes, confirming you are on the equator.

Problem 2: Reach |1⟩ from |0⟩

Given: |0\rangle.

Target: |1\rangle — the south pole.

Hint: which gate does the Bloch-sphere equivalent of a "bit flip"?

Step 1. Identify the gate. X is the Pauli bit-flip: X|0\rangle = |1\rangle, X|1\rangle = |0\rangle. Geometrically, X is a 180° rotation of the Bloch sphere about the +x axis — swapping the poles.

Step 2. Verify by matrix multiplication.

X|0\rangle = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} = |1\rangle.

Why the off-diagonal shape of X produces a swap: row 1 of X is (0, 1), so dotting with |0\rangle = (1, 0) gives 0; row 2 is (1, 0), so the dot is 1. The output is (0, 1) = |1\rangle. An off-diagonal matrix with ones swaps the two amplitudes — which is exactly the classical bit-flip, generalised to quantum states.

Result. One gate: X.

X on |0⟩ gives |1⟩Two Bloch spheres side by side. Left shows |0⟩ at north pole. Right shows |1⟩ at south pole.|0⟩|1⟩beforeX →|0⟩|1⟩after
$X$ swaps the poles of the Bloch sphere. $|0\rangle$ and $|1\rangle$ are antipodal on the z-axis; a $180°$ rotation about the $+x$ axis takes each to the other.

Qiskit one-liner: QuantumCircuit(1).x(0) — an X gate on qubit 0. Measuring in the Z-basis after this gives outcome 1 with probability 1.

Problem 3: Reach |+i⟩ from |0⟩ (two gates)

Given: |0\rangle.

Target: |+i\rangle = \tfrac{1}{\sqrt 2}(|0\rangle + i|1\rangle) — the +y equator point on the Bloch sphere.

Hint: first get onto the equator; then rotate along it.

Step 1. First gate — use H to move from the pole to the equator.

H|0\rangle = |+\rangle = \tfrac{1}{\sqrt 2}(|0\rangle + |1\rangle).

This puts the state at +x. Good, but not done — you need +y.

Step 2. Second gate — use S to rotate along the equator by 90° about z.

S|+\rangle = \frac{1}{\sqrt 2}(S|0\rangle + S|1\rangle) = \frac{1}{\sqrt 2}(|0\rangle + i|1\rangle) = |+i\rangle.

Why S maps |+\rangle \to |+i\rangle: S is the 90° z-rotation. Starting from a point on the equator at azimuthal angle \varphi = 0 (which is |+\rangle), a 90° counter-clockwise rotation about z lands you at \varphi = \pi/2, which is |+i\rangle. Algebraically, S multiplies the amplitude of |1\rangle by i, converting |+\rangle = \tfrac{1}{\sqrt 2}(|0\rangle + |1\rangle) into \tfrac{1}{\sqrt 2}(|0\rangle + i|1\rangle) = |+i\rangle.

Step 3. Assemble the sequence. In circuit order (left to right, time-forward):

|0\rangle \;-\; H \;-\; S \;-\; |+i\rangle.

In algebra (right to left):

|+i\rangle = S \cdot H \cdot |0\rangle.

Step 4. Double-check with one matrix multiplication.

SH = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix} \cdot \frac{1}{\sqrt 2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = \frac{1}{\sqrt 2}\begin{pmatrix} 1 & 1 \\ i & -i \end{pmatrix}.

Apply to |0\rangle = (1, 0)^T: output is (1/\sqrt 2, i/\sqrt 2)^T = |+i\rangle. Matches.

Result. Two gates: H then S (circuit order), equivalently S H (algebra).

|0⟩ to |+⟩ to |+i⟩Three Bloch spheres in a row. Left shows |0⟩ at north pole. Middle shows |+⟩ on the equator at +x. Right shows |+i⟩ on the equator at +y.|0⟩startH →|0⟩|+⟩after HS →|0⟩|+⟩|+i⟩after S
Two-gate sequence $H$ then $S$. First $H$ takes $|0\rangle$ to $|+\rangle$ (equator, $+x$); then $S$ rotates the equator by $90°$ about $z$, landing at $|+i\rangle$ (equator, $+y$).

Qiskit one-liner: QuantumCircuit(1).h(0); .s(0) — apply H then S to qubit 0. Measuring in the Y-basis gives +i with probability 1.

Problem 4: Reach (|0⟩ + e^(iπ/4) |1⟩)/√2 from |0⟩ (two gates)

Given: |0\rangle.

Target: \tfrac{1}{\sqrt 2}(|0\rangle + e^{i\pi/4}|1\rangle) — a state on the equator at azimuthal angle \varphi = \pi/4. That is, halfway between |+\rangle (at \varphi = 0) and |+i\rangle (at \varphi = \pi/2).

Hint: same idea as Problem 3, but this time use a 45° z-rotation instead of a 90° one.

Step 1. H to reach the equator. H|0\rangle = |+\rangle.

Step 2. T to rotate along the equator by 45°. T is a \pi/4 z-rotation, multiplying the |1\rangle amplitude by e^{i\pi/4}.

T|+\rangle = \frac{1}{\sqrt 2}(T|0\rangle + T|1\rangle) = \frac{1}{\sqrt 2}(|0\rangle + e^{i\pi/4}|1\rangle).

Why T produces the e^{i\pi/4} phase and not some other phase: the T matrix is \text{diag}(1, e^{i\pi/4}), so it leaves the |0\rangle amplitude alone and multiplies the |1\rangle amplitude by e^{i\pi/4}. That is literally the target phase the problem asks for.

Step 3. Assemble.

|0\rangle \;-\; H \;-\; T \;-\; \tfrac{1}{\sqrt 2}(|0\rangle + e^{i\pi/4}|1\rangle).

Result. Two gates, H then T. Algebraically, T H |0\rangle.

H then T on |0⟩Two Bloch spheres. Left shows |0⟩ at the north pole. Right shows the state on the equator at 45 degrees between +x and +y.|0⟩beforeH, T →|+⟩|+i⟩targetafter H, T
$T$ is half an $S$. Where $S$ rotated the equator by $90°$ in Problem 3, $T$ rotates by $45°$ — landing at the equator point halfway between $|+\rangle$ and $|+i\rangle$.

Qiskit one-liner: QuantumCircuit(1).h(0); .t(0).

Problem 5: Reach |−⟩ from |+⟩ using one gate

Given: |+\rangle, at the +x equator point.

Target: |-\rangle, at the -x equator point.

Hint: on the Bloch sphere, these two are antipodal along the x-axis. Which gate's rotation axis passes through them fixing neither?

Step 1. Identify the gate. Z is a 180° rotation about the z-axis. In Bloch-sphere terms, z-rotations fix the poles |0\rangle and |1\rangle but sweep every other state around the z-axis. The +x and -x points on the equator sit at azimuthal angles \varphi = 0 and \varphi = \pi; a 180° rotation takes the first to the second.

Step 2. Verify by matrix multiplication.

Z|+\rangle = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \cdot \frac{1}{\sqrt 2}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \frac{1}{\sqrt 2}\begin{pmatrix} 1 \\ -1 \end{pmatrix} = |-\rangle.

Why Z rather than X: X also swaps something antipodal, but it swaps the poles |0\rangle and |1\rangle, not the equator states |\pm\rangle. In fact X|+\rangle = |+\rangle (since X fixes the equator at \pm x where its rotation axis lies). Z, by contrast, swaps |+\rangle and |-\rangle while fixing the poles. The rule: a Pauli gate fixes the two points where its own axis pierces the sphere, and swaps any pair of antipodal points that are not on its axis.

Result. One gate: Z.

Z on |+⟩ gives |−⟩Two Bloch spheres. Left shows |+⟩ at +x equator point. Right shows |−⟩ at -x equator point.|0⟩|1⟩|+⟩beforeZ →|0⟩|1⟩|−⟩after
$Z$ swaps the antipodal equator points $|+\rangle$ and $|-\rangle$. It fixes the poles (its rotation axis) and inverts every state perpendicular to that axis.

Qiskit one-liner: QuantumCircuit(1).x(0); .h(0); .z(0); .h(0); .x(0) (prepare |+\rangle from |0\rangle first, then Z; the first two gates set the input, the third is the answer. Equivalent: qc.h(0); qc.z(0) produces |-\rangle directly.)

Problem 6: Partial tomography — three gates to reach a Z-axis eigenstate from an unknown state

Given: an unknown single-qubit state |\psi\rangle, whose Bloch-sphere coordinates are (\theta, \varphi) (unknown polar and azimuthal angles).

Target: any eigenstate of Z — i.e. |0\rangle or |1\rangle. You don't need to know in advance which of the two you will end up with, because the gates will be parameterised on (\theta, \varphi).

Hint: if you could rotate the Bloch sphere so that (\theta, \varphi) lands on the z-axis, you would have an eigenstate of Z. Use two rotations — one about z, one about y — to align.

Step 1. The Bloch vector for |\psi\rangle has azimuthal angle \varphi away from the +x axis and polar angle \theta away from the +z axis. To bring it onto the +z axis, you would:

  • First rotate by -\varphi about z to kill the azimuthal component — bringing the Bloch vector into the xz-plane.
  • Then rotate by -\theta about y to bring it onto the +z axis.

Step 2. Apply R_z(-\varphi) first, then R_y(-\theta).

R_y(-\theta) \cdot R_z(-\varphi) \cdot |\psi\rangle \;=\; |0\rangle.

Why the order matters and the signs are negative: rotating "by -\varphi about z" means rotating backwards by \varphi — cancelling the azimuthal angle the state started with. Similarly the polar angle \theta is cancelled by R_y(-\theta). Applying R_z first lines up the state with the +x axis (inside the xz-plane); then R_y rotates it up to the north pole.

Step 3. But \theta and \varphi are unknown by the problem statement. In practice you don't have a formula you can compute; you must estimate \theta and \varphi by running the state on a simulator, measuring in different bases to extract the angles, and then feeding those angles into the rotation parameters.

Step 4. This is exactly what quantum state tomography does on a single qubit: measure in the X, Y, and Z bases to estimate the three Bloch coordinates (r_x, r_y, r_z), convert to angles (\theta, \varphi), and then apply the rotations R_y(-\theta) R_z(-\varphi) to "reverse" the state back to the north pole. This is a full tomography protocol compressed into three lines.

Result. Three gates: R_z(-\varphi), then R_y(-\theta). (The "three" because typically a third rotation R_z is added for a full Euler-angle decomposition — see ZYZ in single-qubit-decomposition.) Unknown parameters are estimated by tomography before the rotation is applied.

Undoing an arbitrary rotation to reach z-axisA Bloch sphere with a generic state vector at angles theta and phi; the vector is shown being rotated back to the north pole via two successive rotations.|ψ⟩ at (θ, φ)|0⟩R_y(-θ)·R_z(-φ)Undo the rotation, and the state returns to the z-axis.
To reach a $Z$-eigenstate from an unknown state, apply the rotations that *reverse* the angles. Pre-computed parameters (from tomography or known preparation) make this deterministic.

Qiskit one-liner: qc.rz(-phi, 0); qc.ry(-theta, 0) — parameterised rotation gates. For a known input state, plug in the exact angles; for tomography, run the circuit multiple times with different measurement bases first to estimate (\theta, \varphi).

Problem 7: Prove HXH = Z (a conjugation exercise)

Given: the matrices for H, X, Z (which you know by heart).

Target: verify the identity HXH = Z by direct matrix multiplication.

Hint: multiply from the inside out — compute XH first, then H \cdot (XH).

Step 1. Write down the matrices.

H = \frac{1}{\sqrt 2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \quad X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}.

Step 2. Compute XH.

XH = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \cdot \frac{1}{\sqrt 2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = \frac{1}{\sqrt 2}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}.

Why: X swaps the two rows of whatever matrix it multiplies from the left. Applied to H, it swaps row 1 (1, 1) with row 2 (1, -1).

Step 3. Compute H \cdot XH.

H \cdot XH = \frac{1}{\sqrt 2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \cdot \frac{1}{\sqrt 2}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix} = \frac{1}{2}\begin{pmatrix} 1+1 & -1+1 \\ 1-1 & -1-1 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} = Z.

Why the middle entries are zero: top-right of the product is 1 \cdot (-1) + 1 \cdot 1 = 0; bottom-left is 1 \cdot 1 + (-1) \cdot 1 = 0. The factor \tfrac{1}{2} comes from \tfrac{1}{\sqrt 2} \cdot \tfrac{1}{\sqrt 2}.

Step 4. Interpret geometrically. X is the 180° rotation about the +x axis of the Bloch sphere. H is the 180° rotation about the diagonal (x + z)/\sqrt 2 axis. Sandwiching X between two H's "rotates the X rotation" — specifically, it conjugates the +x axis by H, which sends the +x axis to the +z axis. So HXH is a 180° rotation about +z, which is exactly Z.

Result. HXH = Z. Because H^2 = I, this can also be rewritten as X = HZH, which is exactly the identity used in Ch.30 to build X from H and Z = T^4.

HXH as a conjugation of rotation axesA schematic showing three Bloch-sphere rotation axes: the X axis at +x, the H axis diagonal between +x and +z, and the Z axis at +z. Arrows show that conjugating X by H rotates the X axis to become the Z axis.X axis (+x)H axisH conj →Z axis (+z)
Conjugating the $X$ axis by $H$ rotates it onto the $Z$ axis. That is the geometric content of $HXH = Z$.

Qiskit one-liner: Operator(qc).data for a circuit that applies H, X, H in sequence equals the matrix of Z up to floating-point noise.

Problem 8: Reach a state 30° off the north pole in the xz-plane

Given: |0\rangle.

Target: the state whose Bloch vector sits at polar angle \theta = \pi/3 (that is, 60° from the north pole) in the xz-plane. Equivalently, azimuthal angle \varphi = 0, polar angle \theta = \pi/3. In ket form:

|\psi\rangle = \cos(\pi/6)|0\rangle + \sin(\pi/6)|1\rangle = \frac{\sqrt 3}{2}|0\rangle + \frac{1}{2}|1\rangle.

Note the half-angle convention: a Bloch polar angle of \pi/3 corresponds to amplitudes using \pi/6, because the Bloch-sphere formula is |\psi\rangle = \cos(\theta/2)|0\rangle + e^{i\varphi}\sin(\theta/2)|1\rangle.

Hint: a pure-y rotation moves a state along a meridian that passes through both poles, without ever leaving the xz-plane. Start from |0\rangle, rotate by \pi/3 about y, and you land at polar angle \pi/3 on the +x side.

Step 1. Apply R_y(\pi/3) to |0\rangle. The R_y matrix is

R_y(\theta) = \begin{pmatrix} \cos(\theta/2) & -\sin(\theta/2) \\ \sin(\theta/2) & \cos(\theta/2) \end{pmatrix}.

Step 2. Substitute \theta = \pi/3, so \theta/2 = \pi/6.

R_y(\pi/3) = \begin{pmatrix} \cos(\pi/6) & -\sin(\pi/6) \\ \sin(\pi/6) & \cos(\pi/6) \end{pmatrix} = \begin{pmatrix} \sqrt 3/2 & -1/2 \\ 1/2 & \sqrt 3/2 \end{pmatrix}.

Step 3. Apply to |0\rangle.

R_y(\pi/3)|0\rangle = \begin{pmatrix} \sqrt 3/2 & -1/2 \\ 1/2 & \sqrt 3/2 \end{pmatrix}\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} \sqrt 3/2 \\ 1/2 \end{pmatrix} = \frac{\sqrt 3}{2}|0\rangle + \frac{1}{2}|1\rangle.

Why the half-angle appears in the amplitudes: the Bloch sphere convention is |\psi\rangle = \cos(\theta/2)|0\rangle + e^{i\varphi}\sin(\theta/2)|1\rangle, so a Bloch polar angle of \theta = \pi/3 gives amplitudes using \theta/2 = \pi/6. R_y(\theta) is defined exactly to produce this map when applied to |0\rangle: apply R_y(\theta) to |0\rangle, and the resulting state has polar angle \theta in the xz-plane.

Step 4. Check probabilities. Measuring in the computational basis:

  • P(0) = (\sqrt 3/2)^2 = 3/4.
  • P(1) = (1/2)^2 = 1/4.
  • Sum = 1. Correctly normalised.

Result. One gate: R_y(\pi/3). This is a single continuous-parameter gate, not a discrete Clifford+T gate — you would need to compile it further to an \{H, T\} sequence using Solovay-Kitaev (Ch.30) if the hardware required that.

R_y(π/3) tilts |0⟩ by 60 degrees in the xz-planeTwo Bloch spheres. Left shows |0⟩ at the north pole. Right shows the state at polar angle pi over three, 60 degrees from the north pole, lying in the xz-plane.|0⟩beforeR_y(π/3) →θ = π/3targetafter
$R_y(\pi/3)$ tilts $|0\rangle$ by $60°$ about the $y$-axis, landing at a state in the $xz$-plane with amplitudes $(\sqrt 3/2, 1/2)$. The half-angle $\pi/6 = 30°$ appears inside the cosine and sine of the amplitude formula, matching the Bloch-sphere $2:1$ angle convention.

Qiskit one-liner: qc.ry(pi/3, 0) — a rotation gate with a continuous angle parameter. Qiskit handles the decomposition to native gates at compile time.

Self-test: five states to reach

Now you try. Starting from |0\rangle, find a short gate sequence to reach each of these states. Solutions are not given; compute on paper, then verify with Qiskit (or by matrix multiplication).

  1. |-i\rangle = \tfrac{1}{\sqrt 2}(|0\rangle - i|1\rangle) — the -y equator point.
  2. -|0\rangle — the same physical state as |0\rangle, but with a global phase of -1. (Think: what sequence produces a global -1?)
  3. \tfrac{1}{\sqrt 2}(|0\rangle + e^{-i\pi/4}|1\rangle) — an equator state 45° clockwise from |+\rangle.
  4. \tfrac{1}{2}|0\rangle - \tfrac{\sqrt 3}{2}|1\rangle — a state in the xz-plane at polar angle \theta = 2\pi/3 on the negative-x side.
  5. A state whose Bloch vector points in the (+x, +y, +z) octant, specifically at (\theta = \pi/3, \varphi = \pi/3).

Each one is reachable with at most four single-qubit gates from \{H, X, Y, Z, S, S^\dagger, T, T^\dagger, R_y(\text{angle})\}. Some need just one gate; some need three; #2 is a famous trick. Give them an honest attempt, then check.

Summary of single-qubit gates as Bloch rotationsA table of single-qubit gates alongside the rotation axis and angle each one represents, with a small Bloch sphere indicating the axis.Single-qubit gate referenceGateAxisAngleSends |0⟩ toX+xπ|1⟩Y+yπi |1⟩Z+zπ|0⟩ (fixes pole)H(x+z)/√2π|+⟩S+zπ/2|0⟩ (fixes pole)T+zπ/4|0⟩ (fixes pole)R_x(θ)+xθR_y(θ)+yθR_z(θ)+zθEvery single-qubit gate is (axis, angle) — and this is the whole list.
Quick-reference summary of the single-qubit gates and the Bloch-sphere rotation each one represents. Keep this near you while working through problems — "pick the axis, pick the angle" is the pattern every problem follows.

Common confusions about practice

Going deeper

If you can work through the eight problems above without hints, you have the single-qubit toolkit in your hands. The sections below add three options — using Qiskit to verify problems on a simulator, extending to multi-qubit problems that appear in later chapters, and using the qsphere visualisation tool for cases where the plain Bloch sphere isn't enough.

Verifying problems in Qiskit

Qiskit is IBM's open-source quantum computing SDK and it is installable from PyPI in one line: pip install qiskit qiskit-aer. It runs on any laptop and is accessible free for Indian students (no login required for the simulator; IBM Quantum's free tier provides real-hardware access on request).

A minimal Qiskit script to verify Problem 3 (reach |+i\rangle from |0\rangle):

from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector

qc = QuantumCircuit(1)
qc.h(0)       # First gate: H
qc.s(0)       # Second gate: S
state = Statevector(qc)
print(state)  # Expected: (|0⟩ + i|1⟩)/√2, i.e. amplitudes (1, i)/√2

The Statevector class reads the full amplitude vector from the simulator — no measurement collapse. Compare the numerical output to your hand-computed |+i\rangle. For problems where the state has simple real/imaginary amplitudes, a printed statevector is immediate verification.

For simulated measurements at the end (instead of reading the full state), use qc.measure_all() and run on the Aer backend:

from qiskit_aer import AerSimulator
sim = AerSimulator()
qc.measure_all()
result = sim.run(qc, shots=10000).result()
print(result.get_counts())

This runs the circuit 10000 times and reports how often each outcome appeared. For |+i\rangle measured in the computational basis, expect roughly 50-50 counts (since |+i\rangle is 50-50 in the Z-basis); for |+i\rangle measured in the Y-basis, expect +i always. Changing the measurement basis takes a pre-measurement rotation (see Ch.28 on measurement in arbitrary bases).

Using qsphere for complex multi-amplitude visualisation

The Bloch sphere works perfectly for single qubits, but its geometric meaning disappears for multi-qubit states (since two qubits inhabit a 4-complex-dimensional Hilbert space, not a 3D ball). Qiskit provides an alternative visualisation called the qsphere, which plots each basis state as a point on a sphere — with the distance from the centre encoded as amplitude and the rotation angle encoded as phase.

The qsphere is overkill for single-qubit practice (the Bloch sphere is strictly better for one qubit), but it is worth knowing about because it generalises naturally to two, three, or more qubits. When you see qubit counts of 5-10 in later chapters, the qsphere remains readable where the Bloch sphere cannot.

from qiskit.visualization import plot_state_qsphere
plot_state_qsphere(Statevector(qc))

Extending to two-qubit practice

Single-qubit practice sets the stage. The real fun begins with two-qubit circuits: Bell pair creation, CNOT-based entanglement, teleportation, superdense coding, Deutsch's algorithm. For every single-qubit identity here, there is a two-qubit analogue:

A full two-qubit practice chapter will appear later in the curriculum. For now, finish the single-qubit list — they are the building blocks on top of which every two-qubit circuit sits.

Running on real Indian quantum hardware

Besides the Qiskit simulator, you can run the problems on real quantum hardware through IBM Quantum Platform — free-tier access includes 10 minutes per month on a real superconducting quantum computer. Indian students can create accounts at quantum.ibm.com with an email; the quantum circuits you built for the single-qubit problems run on a physical chip in Yorktown Heights, USA (or sometimes Ehningen, Germany), and the results are sent back in seconds.

For problems like these, a real quantum computer adds noise — you will not get exactly P(0) = 3/4 in Problem 8; you will get something like P(0) = 0.73 after 1024 shots on a NISQ device. That noise is itself a lesson: real quantum hardware is not a flawless simulator, and understanding how to tame the noise is the subject of quantum error correction later in the curriculum.

For students based in India, TIFR Mumbai, IISc Bangalore, IIT Madras, and IIT Bombay all have active quantum computing research groups. The National Quantum Mission (launched 2023, ₹6000 crore over 8 years) funds hardware development domestically — so by the time you reach university, some of this practice may run on superconducting or trapped-ion machines built in India rather than shipped from IBM or Google.

Using Cirq or Q# instead

Qiskit is the most widely used SDK, but Cirq (Google) and Q# (Microsoft) both support the same gate set with nearly identical syntax. A single-qubit problem translates between them by changing qc.h(0) to cirq.H(q0) or H(q0) (Q#). The physics is identical; the APIs are just syntactic sugar.

Where this leads next

References

  1. Qiskit Textbook, Single Qubit Gates — interactive examples covering exactly the eight problems in this article.
  2. John Preskill, Lecture Notes on Quantum Computation, Ch. 2 (qubits, gates, single-qubit manipulation) — theory.caltech.edu/~preskill/ph229.
  3. Nielsen and Chuang, Quantum Computation and Quantum Information — §4.2 on single-qubit operations, §4.4 on quantum circuits — Cambridge University Press.
  4. Wikipedia, Quantum logic gate — matrix forms and rotation-axis conventions for every gate in this article.
  5. Qiskit Aer simulator documentation — qiskit.org/ecosystem/aer — how to run and read statevectors for verification of the problem answers.
  6. IBM Quantum Learning, Introduction to Quantum Computing — free self-paced course with exercises parallel to the problems in this article. </content> </invoke>