DeepPractise
DeepPractise

Phase Gates (S and T)

Track: Quantum Gates & Circuits · Difficulty: Beginner · Est: 15 min

Phase Gates (S and T)

Overview

So far, you’ve seen gates that visibly change probabilities in the computational basis (like X). You’ve also seen a gate (Z) that can leave computational-basis probabilities unchanged while still changing the state.

Phase gates continue that theme. They are essential because:

  • phase is a real degree of freedom in quantum states,
  • phase controls interference,
  • and small phase rotations are building blocks for general single-qubit evolution.

In this lesson we focus on two standard phase gates:

  • S (a π/2\pi/2 phase rotation around zz),
  • T (a π/4\pi/4 phase rotation around zz).

Intuition

A general single-qubit state is

ψ=α0+β1.|\psi\rangle = \alpha|0\rangle + \beta|1\rangle.

A phase gate is a gate that keeps the magnitude of amplitudes but changes the relative phase between basis components.

A particularly important class is “phase on 1|1\rangle”:

  • 0|0\rangle stays the same,
  • 1|1\rangle picks up a complex factor of magnitude 1, like eiφe^{i\varphi}.

That means probabilities in the computational basis are unchanged (because eiφ2=1|e^{i\varphi}|^2 = 1), but the state’s phase structure changes, which affects what happens under later basis changes and measurements.

Bloch-sphere picture:

  • Z was a 180° rotation about the zz axis.
  • S and T are smaller rotations about the same axis.

So you can think of S and T as “phase knobs” that rotate the state around the zz axis by controlled angles.

Formal Description

The S gate

S is defined by

S0=0,S1=i1.S|0\rangle = |0\rangle,\qquad S|1\rangle = i|1\rangle.

So it adds a phase of π2\tfrac{\pi}{2} (a quarter-turn) to the 1|1\rangle component.

Matrix form:

S=(100i).S = \begin{pmatrix} 1 & 0\\ 0 & i \end{pmatrix}.

Interpretation of the matrix:

  • The top-left “1” means the 0|0\rangle amplitude stays α\alpha.
  • The bottom-right “ii” means the 1|1\rangle amplitude becomes iβi\beta.

So for ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle,

Sψ=α0+iβ1.S|\psi\rangle = \alpha|0\rangle + i\beta|1\rangle.

The T gate

T is defined by

T0=0,T1=eiπ/41.T|0\rangle = |0\rangle,\qquad T|1\rangle = e^{i\pi/4}|1\rangle.

Matrix form:

T=(100eiπ/4).T = \begin{pmatrix} 1 & 0\\ 0 & e^{i\pi/4} \end{pmatrix}.

Again, the meaning is direct:

  • the 0|0\rangle amplitude stays α\alpha,
  • the 1|1\rangle amplitude becomes eiπ/4βe^{i\pi/4}\beta.

So

Tψ=α0+eiπ/4β1.T|\psi\rangle = \alpha|0\rangle + e^{i\pi/4}\beta|1\rangle.

Difference between S and T

Both are rotations about zz. The only difference is the rotation angle:

  • S applies a π/2\pi/2 phase to 1|1\rangle.
  • T applies a π/4\pi/4 phase to 1|1\rangle.

You can view S as “two T steps”:

T2=S.T^2 = S.

(We’re stating this relationship as a useful fact; the main point is that S is a bigger phase rotation than T.)

Worked Example

Take

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

Apply S:

S+=12(S0+S1)=12(0+i1).S|+\rangle = \tfrac{1}{\sqrt{2}}(S|0\rangle + S|1\rangle) = \tfrac{1}{\sqrt{2}}(|0\rangle + i|1\rangle).

Computational-basis probabilities are still 1/21/2 and 1/21/2. But the state has moved on the Bloch sphere:

  • +|+\rangle points along +xx.
  • 12(0+i1)\tfrac{1}{\sqrt{2}}(|0\rangle + i|1\rangle) points along +yy.

So S rotates the equator direction by 90° about the zz axis.

Similarly, applying T to +|+\rangle rotates by 45° about zz:

T+=12(0+eiπ/41),T|+\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle + e^{i\pi/4}|1\rangle),

which lands halfway between +xx and +yy on the equator.

Turtle Tip

Turtle Tip

If a gate doesn’t change probabilities in the computational basis, don’t conclude it “does nothing.” Phase changes are often invisible in Z-measurement but become obvious after a basis change (like applying H) or measuring in a different basis.

Common Pitfalls

Common Pitfalls
  • Don’t mix up the imaginary unit ii with an “extra dimension.” It’s a compact way to represent phase.
  • Don’t confuse S and T with Z. Z is a 180° zz-rotation, while S and T are smaller rotations.

Quick Check

Quick Check
  1. What does S do to the 1|1\rangle component of a state?
  2. Why can S or T matter even when P(0)P(0) and P(1)P(1) stay the same in the computational basis?

What’s Next

We’ve learned named gates that rotate around axes by special angles. Next we generalize: instead of a fixed 180°, 90°, or 45° turn, we define rotation gates Rx(θ)R_x(\theta), Ry(θ)R_y(\theta), and Rz(θ)R_z(\theta) that rotate by an arbitrary angle θ\theta.