Level 2

Quantum Circuits

A quantum circuit is a time-ordered recipe of qubit declarations, gates, and measurements.

Try it now

Visualize

Each wire is a qubit; each gate is an operation along the timeline.

Understand

The DSL mirrors the circuit: declare qubits, apply gates, measure.

Why it matters

Circuit diagrams make abstract state changes debuggable and shareable.

Misconception

A longer circuit is not automatically better; it can add complexity without insight.

Apply

Start with Bell, then remove CX to see correlation disappear.

Example DSL

# Bell
qubits 2
H 0
CX 0 1
MEASURE 0
MEASURE 1

Quick check

What does MEASURE 0 do?