Phase Gates Explained: The Quantum Trick Beginners Struggle With

Key Insights
- Phase gates change the relative phase of a qubit’s state components without directly flipping the basis states
and
.
- The S gate applies a
phase shift, while the T gate applies a smaller
shift; S† and T† reverse these operations.
- Phase shifts may leave immediate computational-basis measurement probabilities unchanged, but subsequent gates can make their effects observable through interference.
- On the Bloch sphere, phase gates correspond to rotations around the Z axis, helping visualise how they affect superposition states.
- The Clifford+T gate set supports universal quantum computation when combined with suitable entangling operations, and T-gate optimisation can matter in fault-tolerant circuit design.
- Qiskit provides built-in methods such as s(), sdg(), t(), tdg() and p() to implement phase gates in quantum circuits.
The S gate, also called the phase gate or Z₉₀ gate, is a single-qubit quantum logic gate that rotates the phase of a qubit state by 90 degrees (π/2 radians) around the Z-axis of the Bloch sphere. Quantum gates change qubit states, but not every gate flips a qubit between 0 and 1. Phase gates instead change the relative phase of a qubit’s state components, influencing how quantum states interfere during later operations.
This article explores the general phase gate P(φ), the differences between the S, S†, T and T† gates, and how phase shifts can be understood through Bloch-sphere rotations and matrix representations. It also explains why the T gate matters for universal quantum computation and demonstrates how to implement phase gates in a quantum circuit using Qiskit.
What Are Phase Gates in Quantum Computing?
A phase gate changes the phase of the |1⟩ component of a qubit without directly flipping |0⟩ and |1⟩. This phase shift becomes important when a qubit is in superposition and later operations allow the relative phase to affect measurement outcomes.
The General Phase Gate P(φ)
The general quantum phase gate is represented by the matrix:
P(φ) = ((1, 0), (0, e^(iφ)))
Here, φ is the phase angle. The gate leaves |0⟩ unchanged and multiplies |1⟩ by e^(iφ). Different values of φ produce different phase shifts. The S and T gates are specific examples, corresponding to phase angles of π/2 and π/4, respectively.
Why Phase Matters in a Superposition
Consider the state:
|+⟩ = (|0⟩ + |1⟩)/√2
Applying a phase gate changes it to:
P(φ)|+⟩ = (|0⟩ + e^(iφ)|1⟩)/√2
The two components still have equal probabilities when measured immediately in the computational basis. However, the relative phase has changed. Subsequent gates can make this difference observable through quantum interference.
What Is the Difference Between S, S†, T and T† Gates?
The S and T gates apply different phase shifts, while S† and T† reverse those shifts. All four are special cases of the general phase gate.

S Gate and S-Dagger Gate
The S gate, also called the phase gate in some contexts, applies a phase shift of π/2 (90°).
S = P(π/2) = ((1, 0), (0, i))
Its inverse, the S dagger gate, applies the opposite shift:
S† = P(−π/2) = ((1, 0), (0, −i))
Applying S twice produces the Pauli-Z gate: S² = Z. The S gate is therefore known as the square root of Z.
T Gate and T-Dagger Gate
The T gate applies a smaller phase shift of π/4 (45°).
T = P(π/4) = ((1, 0), (0, e^(iπ/4)))
Its inverse is:
T† = P(−π/4) = ((1, 0), (0, e^(−iπ/4)))
Applying T twice produces S, so T² = S. The T gate is particularly important because it is a non-Clifford gate, unlike S.
Phase Gate Family at a Glance
| Gate | Phase angle | Key relationship |
|---|---|---|
| S | +π/2 | S² = Z |
| S† | −π/2 | SS† = I |
| T | +π/4 | T² = S |
| T† | −π/4 | TT† = I |
| P(φ) | φ | General phase shift |
These matrices follow the standard definitions in the official Qiskit gate documentation.
How Do Phase Gates Work on the Bloch Sphere?
The Bloch sphere represents a single qubit’s state geometrically. Phase gates correspond to rotations around its Z axis, providing an intuitive way to understand how they change relative phase.

Understanding the Z-Axis Rotation
The S gate produces a π/2 rotation around the Z axis, while T produces a π/4 rotation. Their dagger versions rotate in the opposite direction.
A general phase gate P(φ) can be understood as a Z-axis rotation up to a global phase. This distinction matters because P(φ) and the conventional rotation gate Rz(φ) do not have identical matrices, even though they describe equivalent physical transformations up to global phase.
Why the Effect Depends on the Input State
For the input |0⟩, a phase gate has no effect because the |1⟩ component is absent. For a superposition such as |+⟩, it changes the relative phase between the components.
A phase shift is therefore not a bit flip: the gate does not directly exchange |0⟩ and |1⟩.
Why Is the T Gate Important for Universal Quantum Computing?
The T gate extends the Clifford gate set, allowing quantum circuits to represent a broader range of operations. In the widely used Clifford+T framework, suitable Clifford gates, T gates and an entangling gate such as CNOT can approximate arbitrary quantum computations to the desired accuracy.
What Is the Clifford+T Gate Set?
Clifford gates include H, S and CNOT. Although useful, Clifford operations alone are not universal for quantum computation. Adding a non-Clifford gate such as T enables universality when combined with suitable entangling operations.
IBM Quantum explains this distinction in its guide to stabilizer codes and Clifford operations.
Why Is the T Gate Important in Practice?
T gates matter when compiling circuits for fault-tolerant quantum computation. Their implementation can carry significant resource costs, so reducing the number of T gates can help optimise a circuit. The T gate is not the only possible route to universality, nor must every quantum circuit explicitly contain one.
How Do You Use Phase Gates in a Quantum Circuit?
Phase gates control relative phase within a circuit. Their effects become easier to observe when combined with other gates before measurement.
A Simple Circuit Example
Consider the sequence H → S → H → Measurement:
- The first H gate creates the superposition |+⟩ from |0⟩.
- S changes the relative phase.
- The second H gate converts the phase difference into measurement probabilities.
- Measurement records the final result.
For this specific circuit, the final measurement probabilities are 50% for 0 and 50% for 1. The phase change is observable through the full sequence, even though measuring immediately after S would still give equal computational-basis probabilities.
Implementing Phase Gates in Qiskit
Qiskit provides built-in methods for S, S†, T, T† and general phase gates. The following example creates the circuit above:
from qiskit import QuantumCircuit
qc = QuantumCircuit(1, 1)
qc.h(0)
qc.s(0)
qc.h(0)
qc.measure(0, 0)
print(qc.draw())
Use qc.s(0), qc.sdg(0), qc.t(0), qc.tdg(0) or qc.p(theta, 0) to apply the corresponding gates.
Conclusion
Phase gates are essential to understanding how quantum circuits manipulate relative phase and use interference to influence measurement outcomes. From the S and T gates to their inverse operations and the general phase gate P(φ), these gates provide different ways to control phase shifts. Understanding their matrices, Bloch-sphere rotations and role in the Clifford+T gate set helps build a stronger foundation for quantum circuit design and universal quantum computation.
To explore these concepts further, the Applied Quantum Computing & AI programme by IIT Delhi., delivered through Varsity by InterviewBit, offers structured learning in quantum computing, quantum gates and circuit design, alongside practical applications. It can help learners build on these fundamentals and progress towards more advanced quantum computing concepts.
Frequently Asked Questions
Why is the T gate called the π/8 gate?
The name comes from its representation as a rotation generated by the Z operator, up to a global phase. Its phase-gate matrix applies a π/4 phase to the |1⟩ component.
Is the S gate the same as the Z gate?
No. S applies a π/2 phase shift, while Z applies a π phase shift. Applying S twice produces Z.
Can phase gates change measurement probabilities?
Not necessarily when measured immediately in the computational basis. Their relative-phase changes can affect probabilities when combined with subsequent gates.
What happens if you apply the S gate four times?
Since S² = Z and Z² = I, four applications of S produce the identity operation.
What happens if you apply the T gate eight times?
Since T² = S and S⁴ = I, eight applications of T produce the identity operation.
Are S and T gates reversible?
Yes. S† and T† are their respective inverse gates.
What is the difference between a phase gate and a rotation gate?
P(φ) applies a phase to the |1⟩ component. Rz(φ) describes a Z-axis rotation with a different matrix convention; the two are equivalent up to global phase.
Can phase gates be applied to multiple qubits?
Yes. Controlled-phase gates can apply a phase conditionally to particular multi-qubit basis states.
Do phase gates create superposition?
No. They do not create superposition from |0⟩ or |1⟩ alone, but they can change the relative phase of an existing superposition.
When should I use P(φ) instead of S or T?
Use P(φ) when you need a phase angle other than the specific angles provided by S or T, subject to the target circuit’s supported gate set.
Resources
- Microsoft Quantum — Single-Qubit Gates
- IBM Quantum Documentation — PhaseGate and Its Matrix Representation
- IBM Quantum Documentation — S Gate and Its Matrix Representation
- IBM Quantum Documentation — QuantumCircuit Methods for Implementing Gates
- Microsoft Learn — Using the Bloch Sphere Visualizer in the Quantum Development Kit
- Microsoft Quantum — Quantum Circuits






