/ quantum course Back to lab
PATHWAY PROGRESS0/27 passed

02 / Circuit language · LESSON 3 / 27 · 12 MIN

Gates as linear algebra.

Follow the order of gates, control wires and complex amplitudes.

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

q0|0⟩q1|0⟩X

Start in zero

Every qubit begins in |0⟩.

BasisAmplitudeProbability
|00⟩1.000100.0%

TEST YOURSELF

Lesson quiz

Get all 2 questions right to pass. Retry as often as you like.

0/2 answered

1. CX(q0,q1) is applied to |10⟩. What comes out?
2. How does Z act on [α, β]?

Sign in with email or a wallet to check your answers and keep your lesson progress in sync.

Your account

Sign in to pick up your progress on any device.

or

Wallet sign-in uses a free signature (EIP-4361) on whatever EVM network your wallet is on. No gas, no transaction.