Curriculum / Quantum Machine Learning / Variational Quantum Eigensolver

Lesson 8 of 15Code challengePro+175 XP

Variational Quantum Eigensolver

VQE, the hybrid algorithm for finding molecular ground states.

Variational Quantum Eigensolver (VQE)

The Variational Quantum Eigensolver is one of the most important near-term quantum algorithms. You met the variational principle in the Quantum Algorithms track and ran VQE under device constraints in Hardware & NISQ; this lesson treats it in depth as a quantum simulation tool, the lens that matters for quantum machine learning. It addresses the quantum simulation problem: finding the lowest energy (ground state) of a physical system described by a Hamiltonian. This computation scales exponentially with system size on classical computers. VQE prepares and measures trial states using polynomial-depth circuits, but it has no proven exponential speedup. Whether VQE can outperform the best classical methods for chemistry is an open research question, limited by the difficulty of the classical optimization, the measurement cost to reach chemical accuracy, and barren plateaus.

Why Ground States Matter

In chemistry and materials science, the ground state energy determines:

  • Molecular geometry: The equilibrium structure a molecule adopts
  • Reaction rates: Whether a chemical reaction is energetically favorable
  • Material properties: Band gaps, magnetism, superconductivity
  • Drug design: Binding affinity of candidate molecules to protein targets

The hydrogen molecule H₂ in a minimal basis already has 4 spin orbitals. Accurately simulating larger molecules like FeMoco (the active site of nitrogenase, relevant to nitrogen fixation) requires resources far beyond classical computers. VQE is the leading candidate for tackling this class of problems.

The variational principle, why VQE always gives an upper bound

A theorem of quantum mechanics: for any parameterized state |ψ(θ)⟩, the expectation value ⟨ψ(θ)|H|ψ(θ)⟩ is always ≥ the true ground state energy E₀. This means we can safely minimize the expectation value, the minimum we find is the best upper bound on E₀ our ansatz can achieve. The tighter and more expressive the circuit, the closer we approach the true ground state.

The VQE Algorithm

VQE is a hybrid classical-quantum algorithm. The quantum processor handles state preparation and measurement; the classical computer handles optimization:

This is the opening of the lesson. The full walkthrough, the interactive circuit, and the graded challenge continue inside myqubit.

How this lesson works

A hands-on coding challenge. You write Qiskit-compatible Python in the browser editor, run it instantly via WebAssembly, watch the circuit and Bloch sphere react, and pass automatic output checks. The AI tutor Qubitus gives Socratic hints if you get stuck.

Part of: Quantum Machine Learning

Apply quantum computing to machine learning with variational circuits and optimization.

This lesson is part of Pro

Unlock Quantum Machine Learning and all 10 tracks with Pro: $12.99/month, $79/year, or $97 lifetime. Start with the free track first if you are new.