Module 2b in the Quantum Computing: A Complete Learning Path series on malcolmlow.com. Following Bloch Sphere Explained: Basis States and the X and Z Gates (Module 2) and our Matplotlib on Termux Lab, this guide expands single-qubit geometry into the imaginary dimension: analyzing the Y-axis eigenstates, tracking equatorial phase drift, mastering the S and T phase gate rotations, and visualizing the difference between the surface of the Bloch sphere and the interior of the Bloch ball.
In our first Bloch sphere tutorial, we visualized how classical bits transition into quantum superpositions along the real coordinate plane ($x$ and $z$ axes). We saw that the computational basis states $|0\rangle$ and $|1\rangle$ occupy the North and South poles, while the Hadamard gate rotates them to the equatorial states $|+\rangle$ and $|-\rangle$.
However, quantum mechanics operates in complex Hilbert space $\mathbb{C}^2$, not real space $\mathbb{R}^2$. Without the y-axis, quantum computing loses the imaginary unit $i$, making it impossible to perform continuous phase rotations, implement quantum Fourier transforms, or achieve universal fault-tolerant computation.
Why does the Pauli $Y$ gate introduce an imaginary phase while flipping bits? How do the $S$ and $T$ phase gates navigate the equator without altering measurement probabilities in the computational basis? And why does an entangled qubit shrink into the interior of the Bloch ball?
In this guide, we demystify the complex dimension of the Bloch sphere from first principles: deriving the $Y$-basis states $|+i\rangle$ and $|-i\rangle$, tracking equatorial rotations under the $S$ and $T$ gates, examining universal single-qubit rotations, and providing tested Matplotlib and Qiskit scripts to render publication-grade 3D Bloch sphere diagrams.
Quick Answer & Key Insight
How do the Pauli Y, Phase S, and T gates rotate states on the Bloch sphere?
Yes, the Y, S, and T gates perform orthogonal rotations across the complex plane. The Pauli $Y$ gate rotates the state vector by $\pi$ radians (180°) around the y-axis, mapping $|0\rangle$ to $i|1\rangle$ while leaving its eigenstates $|+i\rangle$ and $|-i\rangle$ invariant. The Phase $S$ gate rotates the equator by $\pi/2$ radians (90°) around the z-axis, mapping the real state $|+\rangle$ into the imaginary state $|+i\rangle$. The $T$ gate rotates by $\pi/4$ radians (45°), providing the essential non-Clifford operation required for universal quantum computation. Confusing real superposition with complex phase leads to fatal state drift in quantum algorithms.
🌐 Test Phase Rotations in 3D: Interactive Bloch Sphere Simulator
Want to test these Y-basis states and phase rotations dynamically? We built an Interactive 3D Bloch Sphere Simulator (read the guide & exercises on malcolmlow.com) where you can rotate the unit sphere, explore the complex equatorial plane ($|+i\rangle$ and $|-i\rangle$), slide $\theta$ and $\phi$ continuously, and observe quantum measurement probabilities in real time.
1. Why We Need the Y-Axis: The Complex Geometry of Hilbert Space
Any normalized single-qubit pure state in Hilbert space $\mathbb{C}^2$ is expressed algebraically as:
$$|\psi\rangle = \alpha |0\rangle + \beta |1\rangle, \quad \text{where } \alpha, \beta \in \mathbb{C} \text{ and } |\alpha|^2 + |\beta|^2 = 1$$
Because an overall global phase factor $e^{i\gamma}$ has no physical observable consequence, we factor out the phase of $\alpha$, leaving the canonical spherical parameterization:
$$|\psi\rangle = \cos\left(\frac{\theta}{2}\right) |0\rangle + e^{i\phi} \sin\left(\frac{\theta}{2}\right) |1\rangle$$
Here, two geometric angles define the exact state on the unit Bloch sphere:
- Polar angle $\theta \in [0, \pi]$: Controls the relative weight (amplitude) between $|0\rangle$ and $|1\rangle$. When measured in the computational basis, $P(0) = \cos^2(\theta/2)$ and $P(1) = \sin^2(\theta/2)$.
- Azimuthal angle $\phi \in [0, 2\pi)$: Encodes the relative quantum phase. It defines the longitude on the equator and determines how the state interferes during subsequent gate operations.
The Cartesian coordinates on the 3D Bloch sphere map directly to:
- $x = \sin\theta \cos\phi = 2 \text{Re}(\alpha^* \beta)$
- $y = \sin\theta \sin\phi = 2 \text{Im}(\alpha^* \beta)$
- $z = \cos\theta = |\alpha|^2 - |\beta|^2$
If quantum mechanics were restricted to real amplitudes ($\beta \in \mathbb{R}$), then $\phi$ could only be $0$ or $\pi$. The state would be locked to the 2D $x$-$z$ circle ($y = 0$). The y-axis represents non-zero imaginary phase components ($\sin\phi \neq 0$).
2. The Y-Basis States: Superposition with an Imaginary Phase
When $\theta = \pi/2$, the state vector sits directly on the equatorial plane, creating a balanced 50/50 measurement probability between $|0\rangle$ and $|1\rangle$. While $\phi = 0$ yields $|+\rangle$ and $\phi = \pi$ yields $|-\rangle$, setting $\phi = \pi/2$ and $\phi = 3\pi/2$ defines the Y-basis:
- Positive Y-Axis ($+y$, $\phi = \pi/2$): $$|+i\rangle = \frac{|0\rangle + i|1\rangle}{\sqrt{2}}$$
- Negative Y-Axis ($-y$, $\phi = 3\pi/2$): $$|-i\rangle = \frac{|0\rangle - i|1\rangle}{\sqrt{2}}$$

Figure 1: The six cardinal quantum states on the Bloch sphere and equatorial phase trajectories under the T and S gates.
Like the computational basis ${|0\rangle, |1\rangle}$ and the Hadamard basis ${|+\rangle, |-\rangle}$, the Y-basis ${|+i\rangle, |-i\rangle}$ forms a complete orthonormal basis of Hilbert space:
$$\langle +i | -i \rangle = \frac{1}{2} (1 - i) \begin{pmatrix} 1 \ -i \end{pmatrix} = \frac{1}{2}(1 - i^2) = 0$$
They represent states with maximal phase chirality: measuring a $|+i\rangle$ state in the computational basis gives $0$ or $1$ with equal 50% probability, but measuring it along the y-axis returns $+1$ with 100% certainty.
3. The Pauli Y Gate: 180° Rotation Around the Y-Axis
The Pauli $Y$ matrix is the third fundamental Pauli operator:
$$Y = \begin{pmatrix} 0 & -i \ i & 0 \end{pmatrix}$$
Notice that $Y = i X Z$. Geometrically, the Pauli $Y$ gate performs a $\pi$ radian (180°) right-handed rotation around the y-axis.
How Pauli Y Acts on Key States
- On $|0\rangle$ (North Pole): $$Y |0\rangle = \begin{pmatrix} 0 & -i \ i & 0 \end{pmatrix} \begin{pmatrix} 1 \ 0 \end{pmatrix} = \begin{pmatrix} 0 \ i \end{pmatrix} = i |1\rangle$$ The state rotates from the North Pole down to the South Pole. Because global phase $i = e^{i\pi/2}$ is unobservable, $i|1\rangle$ corresponds to the South Pole ($z = -1$), exactly like the $X$ gate, but it traverses the y-z longitudinal meridian.
- On $|1\rangle$ (South Pole): $$Y |1\rangle = -i |0\rangle$$
- On the Y-basis states ($|+i\rangle$ and $|-i\rangle$): Because $|+i\rangle$ and $|-i\rangle$ lie directly on the axis of rotation, they are eigenstates of $Y$: $$Y |+i\rangle = +1 |+i\rangle, \quad Y |-i\rangle = -1 |-i\rangle$$
4. The Phase Gate Hierarchy: Z, S, and T Gates
While the Pauli $X$, $Y$, and Hadamard $H$ gates rotate states across different latitudes (changing computational basis probabilities), phase gates rotate vectors exclusively around the z-axis.
The general phase shift operator $P(\lambda)$ is defined as:
$$P(\lambda) = \begin{pmatrix} 1 & 0 \ 0 & e^{i\lambda} \end{pmatrix}$$
On the Bloch sphere, $P(\lambda)$ shifts the azimuthal angle by $\lambda$: $\phi \to \phi + \lambda$. Computational basis probabilities remain completely unchanged:
$$P(\lambda) \left( \cos\frac{\theta}{2}|0\rangle + e^{i\phi}\sin\frac{\theta}{2}|1\rangle \right) = \cos\frac{\theta}{2}|0\rangle + e^{i(\phi + \lambda)}\sin\frac{\theta}{2}|1\rangle$$
1. The Pauli Z Gate ($\lambda = \pi$)
$$Z = \begin{pmatrix} 1 & 0 \ 0 & -1 \end{pmatrix}$$
- Rotation: 180° around the z-axis.
- Action: Maps $|+\rangle \leftrightarrow |-\rangle$ (from $+x$ to $-x$).
2. The Phase S Gate ($\lambda = \pi/2$)
The $S$ gate (also known as the $\sqrt{Z}$ or phase gate) performs a 90° rotation:
$$S = \begin{pmatrix} 1 & 0 \ 0 & i \end{pmatrix}, \quad S^2 = Z$$
- Rotation: 90° counterclockwise around the z-axis.
- Action on $|+\rangle$: $$S |+\rangle = S \left(\frac{|0\rangle + |1\rangle}{\sqrt{2}}\right) = \frac{|0\rangle + i|1\rangle}{\sqrt{2}} = |+i\rangle$$
- The Bridge: The $S$ gate is the geometric bridge connecting the real Hadamard state $|+\rangle$ ($+x$) to the imaginary state $|+i\rangle$ ($+y$).
3. The Phase T Gate ($\lambda = \pi/4$)
The $T$ gate (often called the $\pi/8$ gate because of its diagonal form $e^{\pm i\pi/8}$) rotates the equator by 45°:
$$T = \begin{pmatrix} 1 & 0 \ 0 & e^{i\pi/4} \end{pmatrix}, \quad T^2 = S, \quad T^4 = Z$$
- Rotation: 45° around the z-axis.
- Action on $|+\rangle$: $$T |+\rangle = \frac{|0\rangle + e^{i\pi/4}|1\rangle}{\sqrt{2}} = \frac{|0\rangle + \frac{1+i}{\sqrt{2}}|1\rangle}{\sqrt{2}}$$
Why the T Gate Unlocks Universal Quantum Computation
Under the Gottesman-Knill theorem, any quantum circuit consisting purely of Clifford group gates (Hadamard $H$, Phase $S$, and Controlled-NOT $CNOT$) can be perfectly simulated in polynomial time on a classical computer.
Clifford gates only rotate states between the 6 cardinal poles on the Bloch sphere ($\pm x, \pm y, \pm z$). The $T$ gate breaks out of this finite discrete set by rotating states by 45° into the non-Clifford octants. Adding the $T$ gate to the Clifford group is what makes quantum computing universal and classically intractable.
5. Visual Progression: Y, S, and T Gate Operations Side by Side
The multi-panel diagram below tracks the exact state transformations of the Pauli $Y$, Phase $S$, and Phase $T$ gates:

Figure 2: 3D Bloch sphere vector transformations showing the Pauli Y bit-and-phase flip, the S gate 90° equatorial rotation, and the T gate 45° rotation.
Gate Rotation & Coordinate Summary
| Quantum Gate | Geometric Rotation & Axis | Coordinate Map & Action |
|---|---|---|
Y gate |
180° about y-axis |
(x,y,z) → (−x,y,−z) · Maps |0⟩ → i|1⟩
|
S gate |
90° about z-axis |
(x,y,z) → (−y,x,z) · Maps |+⟩ → |+i⟩
|
T gate |
45° about z-axis |
(x,y,z) → ((x−y)/√2, (x+y)/√2, z) · Non-Clifford octant rotation |
6. Beyond the Surface: The Bloch Ball, Mixed States & Entanglement
Every state vector we have plotted so far has length $|\vec{r}| = 1$. These are pure states, representing systems about which we have complete quantum information.
However, a real quantum system interacts with its environment, leading to decoherence. Furthermore, when two qubits become entangled, individual subsystems cannot be described by a state vector $|\psi\rangle$. Instead, we must use the density matrix $\rho$:
$$\rho = \frac{1}{2} \left( I + \vec{r} \cdot \vec{\sigma} \right) = \frac{1}{2} \begin{pmatrix} 1 + z & x - iy \ x + iy & 1 - z \end{pmatrix}$$
Where $\vec{r} = (x, y, z)$ is the Bloch vector, and its Euclidean length dictates the purity of the state:
- Pure States ($|\vec{r}| = 1$): Lie exclusively on the surface of the sphere. $\text{Tr}(\rho^2) = 1$.
- Mixed States ($0 < |\vec{r}| < 1$): Lie strictly inside the interior of the Bloch ball. $\text{Tr}(\rho^2) < 1$. This represents statistical uncertainty or partial decoherence ($T_1$ relaxation and $T_2$ dephasing).
- Maximally Mixed State ($\vec{r} = \vec{0}$): Located at the exact center origin of the sphere: $$\rho = \frac{1}{2} \begin{pmatrix} 1 & 0 \ 0 & 1 \end{pmatrix} = \frac{1}{2} I$$
Why Entangled Qubits Vanish from the Surface
If you create a Bell state $|\Phi^+\rangle = \frac{|00\rangle + |11\rangle}{\sqrt{2}}$ and trace out the second qubit, the reduced density matrix of the first qubit is:
$$\rho_A = \text{Tr}_B(|\Phi^+\rangle \langle \Phi^+|) = \frac{1}{2}|0\rangle\langle 0| + \frac{1}{2}|1\rangle\langle 1| = \frac{1}{2} I$$
The Bloch vector of qubit A has length $|\vec{r}| = 0$. Its arrow has completely vanished into the center of the sphere. This is the physical signature of maximum quantum entanglement: the composite two-qubit system is in a perfectly pure state, but looking at either qubit in isolation reveals total randomness.
7. Python Implementation: Generate Bloch Spheres with Qiskit & Matplotlib
You can generate both Figure 1 and Figure 2 using standard Qiskit 2.x and Matplotlib:
import matplotlib.pyplot as plt
import numpy as np
from qiskit.circuit.library import SGate, TGate, YGate
from qiskit.quantum_info import Statevector
from qiskit.visualization.bloch import Bloch
def bloch_vector(state):
"""Calculates [x, y, z] coordinates from a 2-element Statevector."""
alpha, beta = state.data
overlap = np.conj(alpha) * beta
return [
float(2 * np.real(overlap)),
float(2 * np.imag(overlap)),
float(abs(alpha) ** 2 - abs(beta) ** 2),
]
# 1. Base Quantum States
zero = Statevector.from_label("0")
plus = Statevector.from_label("+")
# 2. Gate Evolutions
y_zero = zero.evolve(YGate())
s_plus = plus.evolve(SGate())
t_plus = plus.evolve(TGate())
# 3. Setup Multi-Panel Progression Figure (3 rows x 2 cols)
rows = [
("Y gate", zero, y_zero, r"Y input: $|0\rangle$", r"Y output: $i|1\rangle$"),
("S gate", plus, s_plus, r"S input: $|+\rangle$", r"S output: $|+i\rangle$"),
("T gate", plus, t_plus, r"T input: $|+\rangle$", r"T output: $(|0\rangle + e^{i\pi/4}|1\rangle)/\sqrt{2}$"),
]
fig = plt.figure(figsize=(9.6, 12.6), facecolor="white")
for row_index, (gate, before, after, before_title, after_title) in enumerate(rows):
for col_index, (state, title, color) in enumerate((
(before, before_title, "#1565C0"),
(after, after_title, "#D32F2F"),
)):
ax = fig.add_subplot(3, 2, row_index * 2 + col_index + 1, projection="3d")
sphere = Bloch(fig=fig, axes=ax, font_size=12)
sphere.xlabel = [r"$|+\rangle$", r"$|-\rangle$"]
sphere.ylabel = [r"$|+i\rangle$", r"$|-i\rangle$"]
sphere.zlabel = [r"$|0\rangle$", r"$|1\rangle$"]
sphere.vector_color = [color]
sphere.add_vectors(bloch_vector(state))
sphere.render(title=title)
fig.text(
0.03, 0.805 - row_index * 0.31, gate,
rotation=90, va="center", ha="center", fontweight="bold", fontsize=14
)
fig.suptitle(
"Bloch-Sphere Gate Progression: Y, then S, then T",
fontsize=18, fontweight="bold", y=0.98
)
plt.savefig("bloch_sphere_y_s_t_gates.png", dpi=300, bbox_inches="tight")
print("✓ Successfully generated bloch_sphere_y_s_t_gates.png")
8. Summary & Key Takeaways
- The Y-Axis Captures Quantum Phase: The positive and negative y-axes represent the eigenstates $|+i\rangle$ and $|-i\rangle$, embodying quantum superposition with an imaginary phase factor $e^{i\pi/2}$.
- Phase Gates Preserve Computational Amplitudes: The $Z$, $S$, and $T$ gates rotate vectors strictly around the z-axis, changing relative interference without altering the probabilities of measuring $0$ or $1$.
- The T Gate is Computationally Essential: While $X, Y, Z, H,$ and $S$ belong to the classically simulable Clifford group, the non-Clifford 45° rotation of the $T$ gate enables universal quantum computing.
- Surface vs. Core: Pure states remain on the unit surface ($|\vec{r}| = 1$). Decoherence and entanglement drag the Bloch vector inside the sphere toward the center origin ($|\vec{r}| < 1$).
Frequently Asked Questions
Why does the Pauli Y gate add an imaginary i to the state?
The Pauli $Y$ matrix is defined as $\begin{pmatrix} 0 & -i \ i & 0 \end{pmatrix}$. When it acts on $|0\rangle$, it produces $\begin{pmatrix} 0 \ i \end{pmatrix} = i|1\rangle$. Because global phase is physically unobservable, $i|1\rangle$ points directly to the South Pole on the Bloch sphere, identical to $X|0\rangle = |1\rangle$, but its unitary evolution represents a rotation through the complex y-z plane.
What is the difference between the S gate and the T gate?
The $S$ gate rotates the qubit state by 90° ($\pi/2$ radians) around the z-axis, mapping the real state $|+\rangle$ into the imaginary state $|+i\rangle$. The $T$ gate rotates by 45° ($\pi/4$ radians), making it the square root of the $S$ gate ($T^2 = S$). The $T$ gate is non-Clifford, making it indispensable for quantum advantage.
Can an entangled two-qubit state be visualized on a single Bloch sphere?
No. The Bloch sphere is strictly a representation of single-qubit state space $\mathbb{C}^2$. When two qubits are entangled, the state cannot be factored into individual state vectors. Tracing out one qubit leaves a mixed state whose Bloch vector collapses into the interior of the sphere ($|\vec{r}| < 1$).
Originally published at malcolmlow.com.
Top comments (0)