Simple Algorithm
Quantum Computing · Excited State · 20 min

Physical Qubits: Two-Level Systems

Spins, photons and atoms: what a qubit actually is in the lab.

Mathematically a qubit is C2\C^2. Physically it is an electron spin, a photon's polarization, two levels of an ion, or the two lowest states of a superconducting circuit. All of them obey the same equation, and in this lesson you derive it: a two-level Hamiltonian that turns the Bloch sphere into a gyroscope, and a resonant drive that steers it.

What you’ll learn

  • Show that every two-level Hamiltonian is H=E0I+ℏ2Ω⃗⋅σ⃗H=E_0\id+\tfrac\hbar2\vec\Omega\cdot\vec\sigma and that it makes the Bloch vector precess, r⃗˙=Ω⃗×r⃗\dot{\vec r}=\vec\Omega\times\vec r.
  • Map spins, photon polarization, atomic levels and superconducting circuits onto the same qubit description, and say what differs between them.
  • Derive the rotating-frame Hamiltonian of a driven qubit under the rotating-wave approximation, and compute π and π/2 pulse durations.
  • Identify the main ways a real system deviates from an ideal two-level system.

One Hamiltonian for every qubit

Any physical qubit has a Hamiltonian, a 2×22\times2 Hermitian matrix. Expand it in the basis {I,X,Y,Z}\{\id,X,Y,Z\}; Hermiticity makes all four coefficients real:

H=E0 I+ℏ2(ΩxX+ΩyY+ΩzZ)=E0 I+ℏ2 Ω⃗⋅σ⃗H=E_0\,\id+\frac\hbar2\left(\Omega_xX+\Omega_yY+\Omega_zZ\right)=E_0\,\id+\frac\hbar2\,\vec\Omega\cdot\vec\sigma
E0E_0 shifts both levels equally, which only produces a global phase. Ω⃗\vec\Omega is the precession vector, in angular-frequency units.

The eigenvalues are E0±ℏ2∣Ω⃗∣E_0\pm\tfrac\hbar2\abs{\vec\Omega}, so the level splitting is ℏ∣Ω⃗∣\hbar\abs{\vec\Omega}. Time evolution is U(t)=e−iE0t/ℏ RΩ^(∣Ω⃗∣t)U(t)=e^{-iE_0t/\hbar}\,R_{\hat\Omega}(\abs{\vec\Omega}t): up to phase, a rotation of the Bloch sphere about Ω^\hat\Omega at angular velocity ∣Ω⃗∣\abs{\vec\Omega}. The same fact, seen through expectation values:

DerivationFree precession of the Bloch vector
  1. ddt⟨σj⟩=iℏ⟨[H,σj]⟩\frac{d}{dt}\expval{\sigma_j}=\frac{i}{\hbar}\expval{[H,\sigma_j]}

    Heisenberg (Ehrenfest) equation for a time-independent HH.

  2. [Ω⃗⋅σ⃗,σj]=∑kΩk[σk,σj]=−2i∑k,lϵjkl Ωk σl[\vec\Omega\cdot\vec\sigma,\sigma_j]=\sum_k\Omega_k[\sigma_k,\sigma_j]=-2i\sum_{k,l}\epsilon_{jkl}\,\Omega_k\,\sigma_l

    Use [σk,σj]=2iϵkjlσl[\sigma_k,\sigma_j]=2i\epsilon_{kjl}\sigma_l. The E0IE_0\id term commutes with everything.

  3. r˙j=iℏ⋅ℏ2⋅(−2i)∑k,lϵjkl Ωk rl=∑k,lϵjkl Ωk rl\dot r_j=\frac{i}{\hbar}\cdot\frac\hbar2\cdot(-2i)\sum_{k,l}\epsilon_{jkl}\,\Omega_k\,r_l=\sum_{k,l}\epsilon_{jkl}\,\Omega_k\,r_l

    Insert rl=⟨σl⟩r_l=\expval{\sigma_l}.

  4. r⃗˙=Ω⃗×r⃗\dot{\vec r}=\vec\Omega\times\vec r

    The Bloch vector precesses about Ω⃗\vec\Omega like a gyroscope: counterclockwise by the right-hand rule, at angular frequency ∣Ω⃗∣\abs{\vec\Omega}. Its length and its component along Ω⃗\vec\Omega are conserved.

Check your understanding

A qubit has H=ℏω02ZH=\tfrac{\hbar\omega_0}{2}Z and starts in ∣+⟩\ket+. After time t=π/(2ω0)t=\pi/(2\omega_0), where is its Bloch vector?

  1. +x^+\hat x (unchanged)
  2. +y^+\hat y
  3. −x^-\hat x
  4. +z^+\hat z
Show the answer

B. +y^+\hat y

The vector precesses about +z^+\hat z at rate ω0\omega_0, so after a quarter period it has turned by π/2\pi/2, from +x^+\hat x to +y^+\hat y. In amplitudes: e−iω0tZ/2∣+⟩∝∣0⟩+eiω0t∣1⟩e^{-i\omega_0tZ/2}\ket+\propto\ket0+e^{i\omega_0t}\ket1.

Four ways to build a qubit

The same 2×22\times2 algebra describes very different physics. What changes from platform to platform is what the basis states are, what sets Ω⃗\vec\Omega, and what disturbs it.

Platform∣0⟩\ket0 / ∣1⟩\ket1Splitting ℏω0\hbar\omega_0 set byControl
Electron or nuclear spin-½spin up / down along a static field BBZeeman energy gμBBg\mu_BB (electron ≈28\approx28 GHz/T, proton ≈43\approx43 MHz/T)oscillating magnetic field (ESR, NMR) or electric-dipole spin resonance
Photon polarization∣H⟩\ket H / ∣V⟩\ket V, or any orthogonal pairnothing: the two modes are degeneratewave plates (fixed, passive rotations)
Trapped ion or neutral atomtwo hyperfine or optical levelsatomic structure: GHz (hyperfine) or hundreds of THz (optical)microwaves, or lasers (direct or Raman)
Superconducting transmonlowest two levels of a nonlinear LC circuitℏω01≈8EJEC−EC\hbar\omega_{01}\approx\sqrt{8E_JE_C}-E_C, typically 4–8 GHzshaped microwave pulses
Orders of magnitude only. EJE_J and ECE_C are the Josephson and charging energies of the circuit.

In every case the qubit is a two-level approximation. An ion has many levels, a transmon a whole ladder, and the qubit is one well-isolated pair. How well it is isolated from the other levels, and how well it is shielded from its environment, separates a good physical qubit from a bad one.

Driving a qubit: resonance and Rabi oscillations

A static Hamiltonian only precesses the qubit about one fixed axis. To flip it you add a weak transverse field oscillating near the qubit frequency. The trick for solving this is to move into a frame rotating with the drive, in which the drive looks static.

DerivationRotating frame and rotating-wave approximation
  1. H(t)=−ℏω02Z+ℏΩcos⁡(ωt) XH(t)=-\frac{\hbar\omega_0}{2}Z+\hbar\Omega\cos(\omega t)\,X

    Lab frame, with ∣0⟩\ket0 the ground state, driven at frequency ω\omega with strength Ω\Omega.

  2. ∣ψ~⟩=V∣ψ⟩,V=e−iωtZ/2,H~=VHV†+iℏ V˙V†\ket{\tilde\psi}=V\ket\psi,\quad V=e^{-i\omega tZ/2},\qquad\tilde H=VHV^\dagger+i\hbar\,\dot VV^\dagger

    Change to a frame rotating with the drive. The extra term comes from differentiating V(t)V(t).

  3. H~=ℏ(ω−ω0)2Z+ℏΩ2[(1+cos⁡2ωt) X+sin⁡(2ωt) Y]\tilde H=\frac{\hbar(\omega-\omega_0)}{2}Z+\frac{\hbar\Omega}{2}\Big[(1+\cos2\omega t)\,X+\sin(2\omega t)\,Y\Big]

    iℏV˙V†=ℏω2Zi\hbar\dot VV^\dagger=\tfrac{\hbar\omega}{2}Z, and VXV†=cos⁡(ωt)X+sin⁡(ωt)YVXV^\dagger=\cos(\omega t)X+\sin(\omega t)Y; multiply by cos⁡ωt\cos\omega t and use product-to-sum formulas.

  4. H~≈ℏ2(Δ Z+Ω X),Δ=ω−ω0\tilde H\approx\frac\hbar2\big(\Delta\,Z+\Omega\,X\big),\qquad\Delta=\omega-\omega_0

    Rotating-wave approximation (RWA): drop the terms oscillating at 2ω2\omega, which average out when Ω≪ω\Omega\ll\omega. What remains is time independent: rotation about the fixed axis (Ω,0,Δ)(\Omega,0,\Delta).

  5. P1(t)=Ω2Ω2+Δ2 sin⁡2 ⁣(Ω2+Δ2  t2)P_1(t)=\frac{\Omega^2}{\Omega^2+\Delta^2}\,\sin^2\!\Big(\frac{\sqrt{\Omega^2+\Delta^2}\;t}{2}\Big)

    Starting from ∣0⟩\ket0: Rabi's formula. On resonance (Δ=0\Delta=0) the drive is Rx(Ωt)R_x(\Omega t) and the qubit swings fully between ∣0⟩\ket0 and ∣1⟩\ket1 at the Rabi frequency Ω\Omega.

Predict before you look

A qubit is driven on resonance with Rabi frequency Ω=2π×10\Omega=2\pi\times10 MHz. How long is a π\pi pulse, in nanoseconds?

Show the answer

50 ns

tπ=π/Ω=π/(2π×107 s−1)=50t_\pi=\pi/\Omega=\pi/(2\pi\times10^7\,\mathrm{s^{-1}})=50 ns, half of the Rabi period 2π/Ω=1002\pi/\Omega=100 ns. A π/2\pi/2 pulse takes 25 ns. Typical superconducting single-qubit gates are in this range.

When two levels are not enough

Real two-level systems depart from the ideal in three main ways:

  • Decoherence. Coupling to the environment relaxes ∣1⟩→∣0⟩\ket1\to\ket0 (time T1T_1) and randomizes the relative phase (time T2T_2, with T2≤2T1T_2\le2T_1).
  • Extra levels. A transmon is a weakly anharmonic oscillator. Its 1→21\to2 transition sits only a few hundred MHz below 0→10\to1, so short pulses can leak population out of the qubit subspace.
  • Approximations in the drive. The RWA drops counter-rotating terms. They shift the resonance by the Bloch–Siegert shift ≈Ω2/(4ω0)\approx\Omega^2/(4\omega_0) and matter for strong drives.
Check your understanding

Why can't a perfectly harmonic oscillator (equally spaced levels) serve as a qubit under a simple resonant drive?

  1. Its levels are too closely spaced to resolve
  2. Harmonic oscillators have no ground state
  3. A drive resonant with 0→10\to1 is equally resonant with 1→21\to2, 2→32\to3, and so on
  4. Its states cannot be put into superposition
Show the answer

C. A drive resonant with 0→10\to1 is equally resonant with 1→21\to2, 2→32\to3, and so on

Equal spacing means one frequency drives every transition: the state spreads up the ladder (into a coherent state) instead of rotating between two levels. Anharmonicity, which the Josephson junction provides in a transmon, makes 0→10\to1 individually addressable.

Key takeaways

  • Every two-level Hamiltonian is E0I+ℏ2Ω⃗⋅σ⃗E_0\id+\tfrac\hbar2\vec\Omega\cdot\vec\sigma; it rotates the Bloch vector, r⃗˙=Ω⃗×r⃗\dot{\vec r}=\vec\Omega\times\vec r.
  • Spins, polarization, atomic levels and superconducting circuits all fit this form. They differ in what sets Ω⃗\vec\Omega, how they are controlled, and what disturbs them.
  • In the frame rotating with a drive, the RWA gives H~=ℏ2(ΔZ+ΩX)\tilde H=\tfrac\hbar2(\Delta Z+\Omega X): a π pulse takes π/Ω\pi/\Omega, and detuning caps P(1)P(1) at Ω2/(Ω2+Δ2)\Omega^2/(\Omega^2+\Delta^2).
  • Every physical qubit is an approximation. Decoherence, extra levels and counter-rotating terms are the leading corrections.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

What are the energy levels of H=E0I+ℏ2(ΩxX+ΩzZ)H=E_0\id+\tfrac\hbar2(\Omega_xX+\Omega_zZ)?

  1. E0±ℏ2(Ωx+Ωz)E_0\pm\tfrac\hbar2(\Omega_x+\Omega_z)
  2. E0±ℏ2Ωx2+Ωz2E_0\pm\tfrac\hbar2\sqrt{\Omega_x^2+\Omega_z^2}
  3. E0±ℏΩx2+Ωz2E_0\pm\hbar\sqrt{\Omega_x^2+\Omega_z^2}
  4. E0±ℏ2ΩzE_0\pm\tfrac\hbar2\Omega_z, because XX has no diagonal entries
Show the answer

B. E0±ℏ2Ωx2+Ωz2E_0\pm\tfrac\hbar2\sqrt{\Omega_x^2+\Omega_z^2}

Ω^⋅σ⃗\hat\Omega\cdot\vec\sigma has eigenvalues ±1\pm1, so HH has E0±ℏ2∣Ω⃗∣E_0\pm\tfrac\hbar2\abs{\vec\Omega}, a splitting of ℏ∣Ω⃗∣\hbar\abs{\vec\Omega}.

Question 2

Starting from ∣0⟩\ket0, a resonant pulse along XX of duration π/(2Ω)\pi/(2\Omega) produces which state?

  1. ∣1⟩\ket1
  2. 12(∣0⟩+∣1⟩)\tfrac1{\sqrt2}(\ket0+\ket1)
  3. 12(∣0⟩−i∣1⟩)\tfrac1{\sqrt2}(\ket0-i\ket1)
  4. ∣0⟩\ket0, up to a phase
Show the answer

C. 12(∣0⟩−i∣1⟩)\tfrac1{\sqrt2}(\ket0-i\ket1)

On resonance H~=ℏΩ2X\tilde H=\tfrac{\hbar\Omega}{2}X, so the pulse is Rx(π/2)R_x(\pi/2), and Rx(π2)∣0⟩=12(∣0⟩−i∣1⟩)=∣−i⟩R_x(\tfrac\pi2)\ket0=\tfrac1{\sqrt2}(\ket0-i\ket1)=\ket{-i}.

Question 3

A drive is detuned by Δ=Ω\Delta=\Omega. What is the largest P(1)P(1) you can reach from ∣0⟩\ket0?

  1. 11
  2. 14\tfrac14
  3. 12\tfrac1{\sqrt2}
  4. 12\tfrac12
Show the answer

D. 12\tfrac12

Pmax⁡=Ω2/(Ω2+Δ2)=12P_{\max}=\Omega^2/(\Omega^2+\Delta^2)=\tfrac12. The rotation axis is tilted 45∘45^\circ out of the equator, so the Bloch vector sweeps a cone that only just reaches the equator.

Question 4

Which statement about a polarization-encoded photonic qubit is correct?

  1. Single-qubit gates are passive wave plates, but photons barely interact, so two-qubit gates are the hard part
  2. Its ∣H⟩\ket H and ∣V⟩\ket V states differ in energy by a few GHz
  3. It cannot be put into superposition
  4. It decoheres within nanoseconds in free space
Show the answer

A. Single-qubit gates are passive wave plates, but photons barely interact, so two-qubit gates are the hard part

∣H⟩\ket H and ∣V⟩\ket V are degenerate modes. Combinations of wave plates implement any single-qubit unitary, but there is no deterministic photon–photon interaction, so linear-optics schemes rely on measurement and feed-forward.

Go deeper

Further reading

  • M. A. Nielsen & I. L. Chuang, Quantum Computation and Quantum Information, Ch. 7 (Cambridge, 10th anniv. ed., 2010).
  • P. Krantz, M. Kjaergaard, F. Yan, T. P. Orlando, S. Gustavsson & W. D. Oliver, A quantum engineer's guide to superconducting qubits, Applied Physics Reviews (2019).
  • I. I. Rabi, Space quantization in a gyrating magnetic field, Physical Review (1937).
  • D. P. DiVincenzo, The physical implementation of quantum computation, Fortschritte der Physik (2000).