02 / Circuit language · LESSON 3 / 27 · 12 MIN
Gates as linear algebra.
Follow gate order, control wires and complex amplitudes.
H = [1 1] / √2
[1 −1]
X = [0 1]
[1 0]Multiply the vector
Write a qubit as the column [α, β]. X changes it to [β, α]. Z changes it to [α, −β]. H changes it to [(α+β)/√2, (α−β)/√2]. These ideal unitary gates preserve normalization.
Order matters
In this lab, gates execute from left to right, in the order listed within a step. The state after two gates is U₂U₁|ψ⟩. Ry(θ) prepares cos(θ/2)|0⟩ + sin(θ/2)|1⟩ from |0⟩, with θ in radians.
Multi-qubit bookkeeping
Basis labels read |q0 q1 …⟩, so q0 is the leftmost bit. A CX uses the first wire as control and the second as target. It flips the target only in sectors where the control is 1. Gates on other wires leave the remaining bits unchanged.
CHECK YOUR UNDERSTANDING
Lesson quiz
Answer all 2 questions correctly. Unlimited retries.
0/2 answered
Checking your account…
