QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
HomeLearnCatalogRanksPlaygroundDocs
02 · Phase and rotation gates0%

You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.

Learn/QC 102Gates and Circuits·Lesson 2 of 7

Phase and rotation gates

S, T, P and the RX/RY/RZ family: fine control of a qubit, and why T matters.

Beginner12 min read4 sections · 2 questions+45
By the end you will be able to
  1. 01Relate S, T and P(λ) to RZ.
  2. 02Pick the rotation gate that prepares a given single-qubit state.
  3. 03Explain 'universal gate set' in one sentence.
P(λ)=(10​0eiλ​),S=P(2π​),T=P(4π​),Rz​(θ)=e−iθZ/2
P and RZ differ only by a global phase, which no measurement can see. S² = Z and T² = S.

Rotations let you place a qubit anywhere on the Bloch sphere: RY(θ) sets the latitude, RZ(φ) the longitude. Together with CNOT, the set {H, T, CNOT} is universal: any n-qubit unitary can be approximated to any precision from those three alone. That is why the T gate, not the more common S, decides the cost of fault-tolerant circuits.

Hands-on

Prepare a target state

The goal is the state with probability 0.75 on |1⟩ and phase π/2 on it. The slider on RY sets the probability (cos²(θ/2) = 0.25 → θ = 2π/3); the RZ adds the phase. Check the Amplitudes view.

OpenQASM 3
OPENQASM 3.0;
include "stdgates.inc";
qubit[1] q;
ry(2*pi/3) q[0];
rz(pi/2) q[0];
Sign in to run (nothing is saved)
Open in the IDE Open in the Playground
You wantUse
Flip the probabilitiesx
An equal superpositionh (or ry(pi/2))
Any probability p on |1⟩ry(2·acos(√(1−p)))
A phase without changing probabilitiesp(λ) / rz(θ) / s / t
Knowledge check

2 questions · one try each counts

Question 1

Which pair of gates is equal up to a global phase?

Sign in to answer and climb the ranks; you will come back to this lesson.

Question 2

Why is {H, S, CNOT} not universal while {H, T, CNOT} is?

Sign in to answer and climb the ranks; you will come back to this lesson.

Key takeaway

Phase gates rotate about Z; RY sets probabilities, RZ sets phase. With CNOT and H, a single non-Clifford gate such as T is enough to build anything.

Finished reading?

Knowledge check: 2 questions waiting above. Questions are optional. Mark it complete, or press Next: moving on marks it complete too.

Up next
Lesson 3 · 12 min
Two-qubit gates: CNOT, CZ, SWAP
Controls and targets, the matrices, and how CZ is a CNOT in disguise.
Further reading
  • Docs: the full gate catalogue
More in Gates and Circuits
  • Pauli gates: X, Y, Z
  • Entanglement and the Bell states
  • Phase Kickback: The Algorithm Secret
Pauli gates: X, Y, ZTwo-qubit gates: CNOT, CZ, SWAP
In this lesson0%
  1. Introduction
  2. Try it: Prepare a target state
  3. Knowledge check
  4. Key takeaway
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in