A framework for optimizing power generation and distribution across electrical grids, comparing classical methods against Qiskit-based quantum optimization.
New here? Read In Plain English — a short, no-jargon walkthrough of what this project does and why it's built the way it is.
Electrical grids face a constant optimization problem: which generators to turn on, how much power each should produce, and how to route electricity across transmission lines to meet demand at the lowest cost. This is known as Unit Commitment and Optimal Power Flow.
Classical methods handle this today, but the problem is growing harder. Renewable sources like solar and wind are intermittent and uncertain. Demand patterns are shifting. The grid is getting larger and more complex. Solvers run every 5 to 15 minutes, and even small improvements in solution quality translate to billions of dollars in savings annually.
This project explores whether quantum optimization via Qiskit can offer a different approach, benchmarked honestly against classical baselines.
Status: the full pipeline is implemented and benchmarked — classical baselines (brute force, MILP), a QUBO formulation, and a QAOA solver, all validated against one another. See Results for what the numbers actually show.
Given:
- a network of generators with different costs, capacities, and ramp rates
- transmission lines with capacity limits
- demand at each node that varies over time
- uncertainty from renewable generation
Determine:
- which generators to turn on or off (unit commitment)
- how much power each produces (economic dispatch)
- how power flows across the network (optimal power flow)
Such that:
total cost is minimized while meeting demand and respecting physical constraints.
- Model a simplified power grid as a network optimization problem
- Implement classical baselines (greedy dispatch, LP, mixed-integer programming)
- Formulate the binary commitment layer as a QUBO for quantum solvers (see caveat below)
- Solve using Qiskit (QAOA, VQE)
- Compare classical and quantum methods on solution quality, runtime, and scaling
Grid dispatch — Operators decide every few minutes which plants to run and at what output. Suboptimal decisions waste fuel and money.
Renewable integration — Solar and wind output is uncertain. The grid must handle variability without blackouts or over-generation.
Demand response — Shifting industrial load during peaks is another binary decision layer on top of generation scheduling.
Microgrid management — Small local grids (military bases, hospitals, remote communities) with batteries, solar, and backup generators.
Grid resilience — After a storm or failure, deciding which lines to restore first and how to reroute power.
Unit commitment is a mixed-integer optimization problem. The on/off state of each generator is binary, and the search space grows exponentially:
| Generators | Time steps | Binary variables | Combinations |
|---|---|---|---|
| 10 | 1 | 10 | 1,024 |
| 20 | 1 | 20 | ~1 million |
| 50 | 24 | 1,200 | ~10³⁶¹ |
| 100 | 24 | 2,400 | astronomical |
Classical solvers (branch-and-bound, Lagrangian relaxation) handle medium instances well. But with renewables adding uncertainty, tighter constraints, and faster re-optimization cycles, the problem keeps growing.
QAOA encodes generator on/off decisions as qubits. The cost function becomes the problem Hamiltonian. The algorithm explores combinations through superposition and uses interference to bias measurements toward low-cost solutions.
The hoped-for advantage — stated as a research hypothesis, not a settled result. Classical solvers like branch-and-bound still search exponential space; they're just smart about pruning. The hope is that variational quantum algorithms sample good solutions from a fundamentally different mechanism (interference) and might scale more gracefully on certain instances. This is not proven. In practice QAOA faces real obstacles: circuit depth often has to grow with problem hardness to stay competitive, classical optimization of the variational parameters is itself hard (barren plateaus), and there is no theorem guaranteeing near-optimal solutions at shallow depth for unit commitment.
What this project actually tests. Not quantum advantage — that has not been demonstrated for grid optimization by anyone, and current hardware is far too small and noisy to attempt the large instances in the table above. The 2,400-variable case is a motivation for why the problem is hard, not a target we can run on a quantum device: it would need 2,400+ qubits with deep circuits, well beyond near-term hardware. What we can do is build a correct QUBO formulation, run it on small instances using simulators (and classical exact solvers through the same qiskit-optimization interface), and benchmark solution quality, feasibility, and scaling honestly. The point is having a defensible formulation ready for if and when hardware catches up.
Qiskit is IBM's open-source quantum computing SDK.
qiskit-optimizationhandles QUBO formulation and solver management- Same problem definition works with classical exact solvers, QAOA, and VQE
- Develop on simulators locally, run on IBM quantum hardware when ready
- Widely used in research and industry
1. GRID MODEL Network of generators, lines, and demand nodes
↓
2. COST MODEL Fuel costs, startup costs, ramping penalties
↓
3. CONSTRAINTS Capacity limits, demand balance, line flow limits
↓
4. CLASSICAL SOLVERS Greedy dispatch, LP relaxation, MIP
↓
5. QUBO FORMULATION Binary generator states → quadratic cost + penalty terms
↓
6. QISKIT SOLVERS QAOA, VQE
↓
7. BENCHMARK Compare cost, feasibility, runtime, scaling
QUBO is binary-only and unconstrained, which means the mapping is not as clean as the pipeline suggests:
- Continuous variables (per-generator output, line flows) have no native QUBO representation. They must be discretized into binary expansions, which inflates the qubit count quickly — so the quantum side of this project realistically targets the unit commitment (on/off) layer, not full economic dispatch.
- Constraints (demand balance, generator capacity, line limits) become quadratic penalty terms. Penalty weights must be tuned: too small and the optimum is infeasible, too large and the landscape becomes hard to optimize.
- Power flow is nonlinear and nonconvex. Even the classical baselines here use the linearized DC-OPF approximation; full AC-OPF is out of scope for the QUBO formulation.
These are known limitations of the QUBO/quantum approach, not flaws in the plan — but they're the reason the honest framing is "formulate the binary layer and benchmark on small instances," not "solve OPF on a quantum computer."
Five solvers — brute-force, LP/MILP, an exact QUBO solve in pure Python, the same QUBO through Qiskit, and QAOA — were benchmarked on instances from 4 to 16 binary variables. Key findings:
- Everything agrees. On every instance, all solvers that ran returned the same optimal cost (0% gap). Five independent methods converge on one answer, which is what makes the comparison trustworthy.
- Classical is exact and instant. MILP never exceeds ~0.03 s and is always optimal — the bar quantum has to clear.
- QAOA matches only on toy sizes, at exploding cost. It found the optimum on the 4- and 8-qubit instances, but its runtime jumped ~12× (1.5 s → 18.9 s) for 4 extra qubits — already ~2,000× slower than the exact solver at 8 qubits, and too slow to run at all on the larger cases.
- No quantum advantage is shown or claimed. What the project delivers is a correct, validated, quantum-ready formulation and an honest baseline.
Full table, methodology, and caveats: RESULTS.md. Reproduce
with python benchmarks/run_benchmark.py.
Tracked in references/research-papers/README.md
MIT License. See LICENSE for details.