QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
HomeLearnCatalogRanksPlaygroundDocs
  1. Docs
  2. The Hamiltonian: where gates come from
Learn
  • Quantum basics
  • OpenQASM 3 cheat sheet
  • All gates, with the math
  • Every gate, interactive
  • Entanglement: how CNOT connects qubits
Circuits
  • Dynamic circuits: if/else, loops and conditions
Lessons
  • Learning path: from one qubit to algorithms
  • Quantum machine learning by hand
Run
  • Compile (transpile): levels, basis gates, topology
  • Simulators, noise, T1/T2 and fake backends
  • Python in the Playground
  • GitHub and git in the Playground
  • Articles and sharing
Analyze
  • Metrics: comparing distributions
  • Q-sphere and Bloch spheres
Hardware
  • Real IBM Quantum hardware
  • Device topology and calibration heat maps
  • Benchmark circuits: MQT Bench and QASMBench
Advanced
  • Circuit cutting, in depth
Story
  • The story of quantum computing
  • The Hamiltonian: where gates come from
  • What to expect next
Documentation/Story/The Hamiltonian: where gates come from

The Hamiltonian: where gates come from

Every gate in this IDE is a snapshot of a physical system evolving for a short time. The object that decides how a system evolves is the Hamiltonian. Here is who invented it, what it means, and how it turns into the matrices in the Gate Lab.

1833 · William Rowan Hamilton

An Irish mathematician, Hamilton rewrote Newton's mechanics in terms of a single function H(q, p): the total energy of a system expressed through positions q and momenta p. His equations ẋ = ∂H/∂p, ṗ = −∂H/∂q describe planets, pendulums and, a century later, electrons. He also invented quaternions, carving i² = j² = k² = ijk = −1 into Broom Bridge in Dublin in 1843; the Pauli matrices X, Y, Z are quaternions in disguise.

1926 · Schrödinger makes H an operator

iℏdtd​∣ψ(t)⟩=H∣ψ(t)⟩
The Schrödinger equation. H is now a Hermitian matrix (H = H†) whose eigenvalues are the allowed energies. It tells the state how to move.
∣ψ(t)⟩=e−iHt/ℏ∣ψ(0)⟩=U(t)∣ψ(0)⟩
Solving it for a constant H gives a unitary U(t). A gate is simply U for the right duration t. This is the bridge between physics and the matrices you see in the Gate Lab.

Gates as time evolution

RX​(θ)=e−iθX/2⇐H=2ℏΩ​X,;θ=Ωt
Drive a transmon with a microwave pulse on resonance and its Hamiltonian is proportional to X (or Y, depending on the pulse phase). Pulse for time t and you get RX(Ωt). A π pulse is the X gate; a π/2 pulse is √X: that is why √X is native on IBM.
RZ​(φ)=e−iφZ/2⇐H=2ℏω​Z
The qubit's own energy splitting is a Z Hamiltonian: left alone, a qubit rotates about Z forever. IBM implements RZ by shifting the phase of all later pulses instead of waiting, which is why RZ is free and error-less.
RZZ​(θ)=e−iθZ⊗Z/2,CNOT∼e−i4π​(I−Z)⊗(I−X)
Two-qubit gates come from coupling Hamiltonians: a ZZ or XX interaction between neighbours. Cross-resonance (Eagle) and tunable couplers (Heron) are two ways of switching such a coupling on for a few hundred nanoseconds. Try RZZ and ECR in the Gate Lab.

Hamiltonians as problems to solve

HMaxCut​=21​(i,j)∈E∑​(I−Zi​Zj​),HH2​​=k∑​ck​Pk​
The same word is used for the thing you want to compute. QAOA encodes a graph problem as a cost Hamiltonian of ZZ terms (the QAOA example); VQE writes a molecule's energy as a sum of Pauli strings and minimizes ⟨ψ(θ)|H|ψ(θ)⟩ (the VQE example). The cutting tab reconstructs exactly such ⟨Pauli⟩ expectation values.

Three faces of one idea: Hamilton's energy function (1833) → Schrödinger's operator that moves the state (1926) → today's gates, which are e^{-iHt} for engineered H, and today's problems, which are H whose ground state we want.

← Previous
The story of quantum computing
Next →
What to expect next
On this page
  • 1833 · William Rowan Hamilton
  • 1926 · Schrödinger makes H an operator
  • Gates as time evolution
  • Hamiltonians as problems to solve
Try it in the IDE →
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in