A phase gate is a single-qubit gate that multiplies the amplitude of the basis state |1⟩ by a complex phase factor while leaving the amplitude of |0⟩ untouched. In quantum computing, and specifically in the study of quantum gates & circuits, the name usually refers to the S gate, which applies a phase of i (a quarter turn, 90 degrees), although the same word also describes the general phase gate P(φ) with an arbitrary angle.
Because a phase gate does not change the probability of measuring 0 or 1, its effect is invisible to a direct measurement. Its value appears only when the phase is converted into amplitude differences by later gates such as the Hadamard gate, which is why phase gates sit at the heart of interference-based algorithms and of the Clifford group.
How the phase gate acts on a qubit
The phase gate acts as a diagonal unitary matrix in the computational basis. The S gate is written S = diag(1, i), and the general form is P(φ) = diag(1, e^(iφ)). A qubit in the state a|0⟩ + b|1⟩ becomes a|0⟩ + b·e^(iφ)|1⟩: only the relative phase between the two components changes.
On the Bloch sphere, this operation is a rotation about the z-axis by the angle φ. The poles, which represent |0⟩ and |1⟩, stay fixed, while every point on the equator moves around it. The S gate turns the |+⟩ state into the |+i⟩ state, moving it a quarter of the way around the equator from the x-axis to the y-axis.
The S gate is closely related to the Rz rotation gate: Rz(π/2) equals S multiplied by a global phase of e^(−iπ/4). Global phases have no physical consequence for a single isolated gate, but they matter once the gate is controlled, a subtlety that often trips up circuit designers.
The following table lists the most common members of the phase gate family and their angles.
| Gate | Phase on |1⟩ | Angle φ | Relation |
|---|---|---|---|
| Z gate | −1 | π (180°) | S squared |
| S gate | i | π/2 (90°) | Square root of Z |
| S† gate | −i | −π/2 (−90°) | Inverse of S |
| T gate | e^(iπ/4) | π/4 (45°) | Square root of S |
| P(φ) | e^(iφ) | Any real value | Continuous family |
Algebraic properties of the S gate
The S gate has several identities that compilers and theorists use constantly. S applied twice gives Z, so S is a square root of the Pauli Z gate, and S applied four times gives the identity. Its inverse, S†, equals S applied three times.
The most important property is that S is a Clifford gate: conjugating a Pauli operator by S yields another Pauli operator. Under conjugation, S maps X to Y and Y to −X, while Z stays unchanged. Together with the Hadamard gate, S generates the single-qubit Clifford group, which has 24 elements when global phases are ignored.
The table below summarizes how the S gate transforms each Pauli operator, which is the basis of stabilizer tracking in simulation and error correction.
| Input Pauli | Result of S P S† | Bloch sphere meaning |
|---|---|---|
| X | Y | x-axis turns into y-axis |
| Y | −X | y-axis turns into negative x-axis |
| Z | Z | Poles stay in place |
Because S is Clifford, circuits built only from S, Hadamard and CNOT gates can be simulated efficiently on a classical computer according to the Gottesman–Knill theorem. Reaching universal quantum computation requires at least one non-Clifford gate, most often the T gate.
Phase gate compared with neighboring gates
The phase gate is easy to confuse with other diagonal or z-axis gates. The differences concern angle, global phase and error-correction cost, and the following comparison sets them side by side.
| Gate | Clifford | Fault-tolerant cost | Typical role |
|---|---|---|---|
| S gate | Yes | Moderate, code dependent | Basis changes, Clifford circuits |
| T gate | No | High, needs magic states | Universality |
| Z gate | Yes | Low, often transversal | Sign flips, phase oracles |
| Rz(θ) | Only for multiples of π/2 | High for arbitrary θ | Variational and native rotations |
| Controlled-S | No | High | Quantum Fourier transform |
The controlled phase gate CP(φ) applies the phase only when both qubits are in |1⟩ and is symmetric between control and target. The controlled-Z gate is the special case with φ equal to π. In the quantum Fourier transform, a sequence of controlled phase gates with angles π/2, π/4, π/8 and smaller produces the required phase pattern.
Practical use in circuits and hardware
The most frequent practical use of S is changing the measurement basis. Hardware usually measures only in the Z basis, so measuring in the Y basis requires applying S† followed by Hadamard before readout. The same pair prepares |+i⟩ states and appears in tomography and in Pauli-string expectation values in variational algorithms.
On superconducting processors, z-axis rotations including S are often implemented as virtual Z gates: the control software shifts the phase reference of all later microwave pulses instead of sending a physical pulse. Such a gate takes zero time and adds essentially no gate error. Trapped-ion and neutral-atom systems use comparable phase-tracking techniques.
The decision table below shows how the implementation choice depends on the computing regime.
| Regime | Implementation | Reason |
|---|---|---|
| Noisy physical qubits | Virtual Z frame change | Free and error-free in software |
| Surface code logical qubit | Y-state injection or lattice surgery | S is not transversal in this code |
| Color code logical qubit | Transversal application | Code structure supports S directly |
| Classical stabilizer simulation | Tableau update | Clifford operations stay efficient |
Common mistakes with phase gates
Most errors with phase gates come from naming and sign conventions rather than from physics. Experienced practitioners check the following points before trusting a circuit.
- Confusing S with S†: the wrong sign rotates toward −y instead of +y and silently flips results in Y-basis measurements.
- Ignoring global phase when controlling: a controlled Rz(π/2) differs from a controlled S, because the hidden global phase becomes a relative phase.
- Mixing naming conventions: some texts use P(φ), others U1(φ) or R(φ), and the label phase gate may refer to S only or to the whole family.
- Expecting a visible effect: a phase gate followed directly by a Z-basis measurement changes no outcome probability, so a test circuit needs an interfering gate afterward.
A plain-language summary
A qubit has two parts, a part that leans toward 0 and a part that leans toward 1, and each part carries a hidden direction, much like the hand on a clock face. A phase gate turns the hand attached to the 1 part without changing how large that part is.
If you measure right away, nothing seems different, because the chance of seeing 0 or 1 stays exactly the same. The turn becomes important when the qubit later meets another gate that mixes the two parts. Then the hidden directions add up or cancel out, and the phase decides the final answer. The S gate is the version that turns the hand by exactly a quarter.
An example from practice
A research team running a variational quantum eigensolver on a 20-qubit superconducting processor needs the energy of a small molecule. The Hamiltonian contains hundreds of Pauli strings, and many of them include Y operators that the hardware cannot measure directly.
For every qubit that must be read in the Y basis, the compiler inserts S† followed by Hadamard just before measurement. Because the device implements S† as a virtual Z gate, the basis change adds no duration and no measurable error, so only the Hadamard pulse contributes noise.
Grouping compatible Pauli strings in this way lets the team cut the number of distinct circuits by roughly a factor of three, and the measured energies stay within the expected statistical uncertainty of the shot count. Without the phase gate, the Y terms could not be estimated at all on this hardware.