- Energy
TotalEnergies: QAOA for Energy Grid Optimization
TotalEnergies
TotalEnergies partnered with Atos and French quantum initiatives to apply QAOA to energy grid load balancing, formulating grid dispatch as a QUBO/Ising problem and testing on simulators and small quantum hardware.
- Key Outcome
- QAOA solved toy grid problems (10-20 nodes) at quality matching classical branch-and-bound methods. Scaling to realistic grid sizes (1000+ nodes) requires quantum hardware two to three orders of magnitude beyond current capabilities. The work contributes to European quantum strategy and positions TotalEnergies for future advantage.
The Problem
Modern electricity grids are becoming harder to manage. Renewable energy sources, wind and solar, are variable and cannot be dispatched on demand. Demand fluctuates throughout the day. Grid operators must constantly decide which power sources to activate, at what levels, and how to route electricity across transmission lines, all while minimizing cost, maintaining voltage stability, and avoiding line overloads.
This optimal power flow problem is NP-hard at large scale. For a grid with thousands of nodes and hundreds of generators, exact classical solvers are too slow for real-time dispatch. Industry uses heuristics and approximations, which means some value is left on the table.
The increasing share of renewables makes this harder. A grid with 30% wind and solar has more uncertainty and faster fluctuations than one running on dispatchable gas and coal. Better optimization algorithms would reduce curtailment of renewable energy and lower consumer costs.
Formulating Grid Dispatch as an Ising Model
TotalEnergies and Atos (now Eviden) formulated a simplified version of the dispatch problem as a Max-Cut problem on a graph, which maps naturally to an Ising Hamiltonian. In the formulation, each edge in the grid graph represents a transmission line, and partitioning nodes into two groups (cut edges maximized) approximates optimal dispatch under certain assumptions.
QAOA is designed to find approximate solutions to exactly this type of problem.
from qiskit import QuantumCircuit
from qiskit.primitives import Sampler
from qiskit_algorithms import QAOA
from qiskit_algorithms.optimizers import COBYLA
from qiskit_optimization import QuadraticProgram
from qiskit_optimization.algorithms import MinimumEigenOptimizer
from qiskit_optimization.converters import QuadraticProgramToQubo
import numpy as np
# Define a small grid as a weighted graph
# Nodes: generators and substations
# Edges: transmission lines with capacity weights
grid_edges = [
(0, 1, 1.0), # line 0-1, capacity weight 1.0
(1, 2, 0.8),
(2, 3, 1.2),
(3, 0, 0.9),
(0, 2, 0.5), # cross-connection
]
n_nodes = 4
# Build Max-Cut as a QuadraticProgram
qp = QuadraticProgram()
for i in range(n_nodes):
qp.binary_var(name=f"x{i}")
# Max-Cut objective: maximize sum of w_{ij} * (x_i + x_j - 2*x_i*x_j)
# Equivalently minimize: -sum w_{ij} * (x_i + x_j - 2*x_i*x_j)
linear = {}
quadratic = {}
for (i, j, w) in grid_edges:
linear[f"x{i}"] = linear.get(f"x{i}", 0) - w
linear[f"x{j}"] = linear.get(f"x{j}", 0) - w
quadratic[(f"x{i}", f"x{j}")] = quadratic.get((f"x{i}", f"x{j}"), 0) + 2 * w
qp.minimize(linear=linear, quadratic=quadratic)
# Convert to QUBO (already in QUBO form for unconstrained Max-Cut)
converter = QuadraticProgramToQubo()
qubo = converter.convert(qp)
# Run QAOA with p=2 layers
sampler = Sampler()
optimizer = COBYLA(maxiter=200)
qaoa = QAOA(sampler=sampler, optimizer=optimizer, reps=2)
solver = MinimumEigenOptimizer(qaoa)
result = solver.solve(qubo)
print("QAOA solution:", result.x)
print("Objective value:", result.fval)
# Brute force for comparison (only feasible for small n)
best_classical = None
best_val = float("inf")
for mask in range(2 ** n_nodes):
x = [(mask >> i) & 1 for i in range(n_nodes)]
val = sum(-w * (x[i] + x[j] - 2 * x[i] * x[j])
for (i, j, w) in grid_edges)
if val < best_val:
best_val = val
best_classical = x
print("Classical optimum:", best_classical, "value:", best_val)
QAOA Circuit Structure
For a grid with N nodes, the QAOA circuit has N qubits. Each qubit represents a binary dispatch decision. The circuit alternates between a cost layer (encoding the grid objective function) and a mixer layer (exploring the solution space).
With p layers, the circuit has p gamma parameters (cost layer angles) and p beta parameters (mixer layer angles), all optimized classically. Deeper circuits (larger p) give better approximation ratios but require longer coherence times.
For the 4-node grid above, the QAOA circuit with p=2 has 8 parameters and roughly 20-30 two-qubit gates, well within the reach of current hardware.
Results
TotalEnergies and Atos tested QAOA on grid instances with up to 20 nodes on IBM Quantum hardware and simulators. At this scale, the quantum results matched or approached the classical branch-and-bound optimum, with solution quality declining on noisy hardware due to gate errors.
The scaling analysis was sobering. Real grid dispatch problems involve:
- Thousands of nodes and generators
- Continuous variables (power output levels), not just binary dispatch decisions
- Hard physical constraints (voltage limits, line capacities)
- Sub-second time requirements for real-time operation
Mapping this to QUBO requires discretizing continuous variables and adding penalty terms, which expands the qubit count dramatically. A 100-node realistic problem could require thousands of qubits with full connectivity, far beyond current hardware.
European Quantum Strategy Context
TotalEnergies participates in France’s national quantum plan and the broader European Quantum Flagship initiative. The grid optimization research is partly funded as a strategic investment in quantum readiness, not just an internal R&D project.
The European energy transition context adds urgency. As France and its neighbors integrate more wind and solar, better grid optimization has a direct monetary and climate value. TotalEnergies is positioning to be an early adopter when quantum hardware reaches the scale needed.
What Progress Would Unlock Value
Three hardware milestones would change the calculus for quantum grid optimization:
- 1000+ logical qubits: Enough to encode medium-scale grid problems without excessive discretization
- Low-depth advantage: QAOA showing better solution quality than classical heuristics at the same time budget
- Hybrid integration: Classical grid solvers augmented by quantum subroutines for specific subproblems, not full replacement
The hybrid path, similar to BMW’s approach in manufacturing, is likely to deliver value sooner than waiting for fully quantum solutions.
Framework
TotalEnergies used Qiskit and Qiskit Optimization for QUBO formulation and QAOA execution. Experiments ran on IBM Quantum hardware and Aer simulators. Atos contributed classical solver benchmarks and problem formulation expertise.
Learn more: Qiskit Reference