Circuit Representation
Quantum circuits provide a visual and mathematical representation of quantum computations. They offer an intuitive way to design, analyze, and implement quantum algorithms using standardized notation and conventions.
Basic Circuit Elements
Quantum Wires
Horizontal lines represent quantum wires carrying qubits:
- Time flows from left to right
- Each wire carries one qubit
- Initial states written on the left
- Final states (if shown) on the right
Single-Qubit Gates
Represented as boxes or symbols on wires:
Common single-qubit gate symbols:
- H: Hadamard gate
- X, Y, Z: Pauli gates
- S: Phase gate (√Z)
- T: π/8 gate (√S)
- [R_x(θ)]: Parameterized rotations
Multi-Qubit Gates
Connected across multiple wires:
Controlled Gates
- ●: Control qubit (filled circle)
- ⊕: Target qubit (plus in circle)
- │: Control connection
General Two-Qubit Gates
Measurement
Represented by meter symbols:
- ■: Measurement operation
- Double lines: Classical information
- M: Measurement symbol in box
Circuit Composition Rules
Sequential Operations
Gates applied left to right in time order:
Represents: \(Z \cdot X \cdot H |\psi\rangle\) (note reverse order in math)
Parallel Operations
Gates on different qubits can be applied simultaneously:
Represents: \((H \otimes X \otimes Z)|\psi_1\psi_2\psi_3\rangle\)
Gate Timing
Vertical alignment indicates simultaneous application:
Standard Gate Notation
Pauli Gates
Rotation Gates
Phase Gates
Controlled Variants
Multi-Control Gates
Toffoli (CCNOT)
Multi-Control Unitary
Alternative Control Symbols
- ●: Control on |1⟩ state
- ○: Control on |0⟩ state (open circle)
Circuit Depth and Width
Circuit Width
Number of qubits in the circuit:
Circuit Depth
Number of time steps (sequential gate layers):
Layer 1: H gate
Layer 2: CNOT gate
Layer 3: Z gate
Parallelization
Gates on disjoint qubits can be parallelized:
Before: |q₀⟩ ──H────X── Depth = 2
|q₁⟩ ──────Y──
After: |q₀⟩ ──H────X── Depth = 2 (no change)
|q₁⟩ ──Y───────── (Y moved to parallel with H)
Quantum Circuit Model
Mathematical Representation
A quantum circuit implements a unitary transformation:
Where \(U_i\) are the gates applied at each time step.
State Evolution
Initial state evolves through the circuit:
Tensor Product Structure
For parallel gates:
Classical Control
Conditional Gates
Gates controlled by classical measurement results:
Feedforward
Using measurement results to control later gates:
Circuit Compilation
Gate Decomposition
Complex gates decomposed into elementary gates:
Original: ──[Toffoli]──
Compiled: ──H──●──T†─●─T──●──T†─●─T──H──
│ │ │ │
──T──⊕──T†─●─T──⊕──T†────────
│ │ │
─────────⊕───────⊕──────────
Optimization Goals
- Minimize depth: Reduce execution time
- Minimize gate count: Reduce error accumulation
- Hardware constraints: Respect connectivity topology
- Native gates: Use hardware-supported operations
Error Correction Integration
Logical Qubits
Physical qubits grouped into error-corrected logical qubits:
Fault-Tolerant Gates
Gates implemented transversally across code blocks:
Visualization Examples
Bell State Circuit
Mathematical: \(|\Phi^+\rangle = \text{CNOT} \cdot (H \otimes I)|00\rangle\)
Teleportation Circuit
QFT Circuit (3 qubits)
|x₀⟩ ──H──●────────●────────H──
│ │
|x₁⟩ ─────S─●─────H──S──H─────
│ │
|x₂⟩ ─────────T──H──────────────
Circuit Simulation
State Vector Evolution
Track full quantum state through circuit:
# Initialize |000⟩
state = [1, 0, 0, 0, 0, 0, 0, 0]
# Apply H⊗I⊗I
state = apply_gate(H_gate, state, qubit=0)
# Apply CNOT₀₁
state = apply_gate(CNOT_gate, state, qubits=[0,1])
Quantum Circuit Simulators
- State vector simulators: Track full quantum state
- Stabilizer simulators: Efficient for Clifford circuits
- Tensor network simulators: Handle large, low-entanglement circuits
- Quantum hardware simulators: Model noise and decoherence
Advanced Circuit Features
Parametric Circuits
Gates with tunable parameters:
Used in variational quantum algorithms and quantum machine learning.
Ancilla Qubits
Helper qubits for complex operations:
Reset Operations
Mid-circuit qubit initialization:
Software Tools
Circuit Description Languages
- QASM: Quantum assembly language
- Cirq: Google's quantum framework
- Qiskit: IBM's quantum toolkit
- PennyLane: Quantum ML framework
Example QASM
Circuit Visualization Tools
- Circuit diagrams: ASCII or graphical representation
- Interactive visualizers: Web-based circuit editors
- Animation tools: Show state evolution through circuit
The quantum circuit model provides the foundation for quantum algorithm design, hardware implementation, and quantum software development.