02 / Circuit language · LESSON 3 / 27 · 12 MIN
Gates as linear algebra.
Follow the order of gates, control wires and complex amplitudes.
H = [1 1] / √2
[1 −1]
X = [0 1]
[1 0]Multiply the vector
Treat a qubit as the column [α, β]. X turns it into [β, α], Z into [α, −β], and H into [(α+β)/√2, (α−β)/√2]. All of these ideal unitary gates keep the vector normalized.
Order is significant
The lab runs gates left to right, in the sequence given inside a step. After two gates the state is U₂U₁|ψ⟩. Starting from |0⟩, Ry(θ) prepares cos(θ/2)|0⟩ + sin(θ/2)|1⟩, where θ is in radians.
Bookkeeping with several qubits
Basis labels read |q0 q1 …⟩, so q0 is the leftmost bit. In a CX the first wire is the control and the second is the target; the target flips only in the part of the state where the control is 1. Gates acting on other wires leave the remaining bits as they are.
LIVE EXPERIMENT / 1 OF 3
Start in zero
Every qubit begins in |0⟩.
TEST YOURSELF
Lesson quiz
Get all 2 questions right to pass. Retry as often as you like.
0/2 answered
Sign in with email or a wallet to check your answers and keep your lesson progress in sync.