Home 9 Blog 9 FlexQAOA in Energy Management

A Case Study with E.ON

FlexQAOA in

Energy Management

Quantum Optimization for Energy:
Addressing the Prosumer Challenge with a Use Case from E.ON

The energy sector is undergoing a profound transformation. Renewable electricity rapidly displaces fossil fuels, production is increasingly decentralized, and smart devices proliferate throughout our homes and businesses. This transition brings immense opportunities but also unprecedented challenges. As our electricity grid evolves into a complex, dynamic system with millions of interconnected participants, orchestrating energy flows has become exponentially more complicated.

This blog post showcases how Aqarios and E.ON jointly approached the “Prosumer Problem” with Aqarios’ newly developed quantum algorithm, FlexQAOA, specifically designed for the constrained optimization problems that naturally arise in real-world problems such as energy operations.

The Growing Complexity Challenge

Today’s electricity grid must balance supply and demand across countless nodes in real-time while adhering to strict technical constraints. As more variable renewable sources, electric vehicles, battery storage systems, and smart appliances come online, the computational challenge of optimizing this ecosystem increases.

Grid operators and energy providers must make thousands of decisions at short time intervals – when to charge or discharge batteries, how to shift flexible demand, where to route electricity, and how to prevent local overloads. These decisions must account for volatile generation, time-varying prices, and strict capacity constraints across the network.

The above animation shows a single April day of generation and demand in the north of Germany, separated by ZIP codes. It demonstrates the challenges posed by variable renewable electricity production (yellow circles) and local demand (red shading). Source: E.ON.

Classical optimization techniques that have served the industry for decades are increasingly at risk of falling behind as the pace of the system complexity increases. Some algorithms in use today are expected to scale poorly as problem sizes grow, limiting their suitability for real-time decision-making at scale.

Quantum optimization offers a promising, complementary path forward for solving such complex problems. By harnessing the unique capabilities of quantum computing, it becomes possible to explore vast solution spaces more efficiently than classical methods. This can dramatically accelerate the solving of complex optimization tasks – especially those involving combinatorial decisions.

“Quantum optimization is exactly what we need to address the growing complexity in energy systems,” says Michael Lachner, CEO of Aqarios. “It allows us to go beyond the limitations of standard classical approaches and tackle real-world problems with scalability and precision.”

This paradigm shift opens new possibilities for energy providers and technology companies alike, enabling smarter coordination of distributed resources, better cost-efficiency, and stronger grid resilience.

“Quantum computing is a fascinating field with tremendous potential for energy applications. E.ON has been actively working in this space, and we are glad to explore this field further in collaboration with Aqarios. Their approach to quantum optimization aligns well with the complex challenges we face in managing tomorrow’s energy ecosystem,” says Dr. Giorgio Cortiana, Head of Data & AI – Energy Intelligence at E.ON Digital Technology.

The Prosumer Problem: A Key Challenge in Modern Electricity Management

A particularly relevant challenge in this landscape is the so-called “Prosumer Problem” – a scenario that captures the complexity of coordinating flexible electricity demand within households. Prosumers – consumers that can also produce (part of) their own energy – shape both sides of the energy system through rooftop solar, smart appliances, and electric vehicles.

Imagine a household with several smart appliances – an electric vehicle charger, a heat pump, a washing machine, and a clothes dryer. Each device has a pre-defined load profile that spans multiple time steps. For instance, an EV charging process might have a variable load for three consecutive hours, while a heat pump might have a relatively constant consumption pattern over its two-hour cycle. The figure below illustrates such a setting – some devices have variable loads, others are more constant.

The optimization challenge is to decide when each device should start operating in order to, for example, minimize electricity costs while maximizing the use of locally produced renewable energy in a time-varying environment. But there’s a critical constraint: at any point in time, the total load must not exceed a given limit – imposed either by the home’s electrical infrastructure or the local grid.

This seemingly simple problem becomes computationally challenging as the number of devices and time intervals increases. Classical optimization approaches may struggle to find optimal solutions that meet exact requirements in real-world applications with millions of devices and fine-grained, long time intervals.

Yet, solving this problem effectively brings tangible benefits: cost savings for consumers, better alignment between energy usage and renewable generation, and improved grid stability through congestion avoidance and peak load reduction.

To tackle this challenge at scale exploring novel optimization methods with the potential for higher computational efficiency offers a promising path to complement standard approaches and solve such complex problems.

Structuring the Problem for Algorithms

To solve the Prosumer Problem, a mathematical formulation that captures all relevant objectives and constraints is needed. This formal structure allows optimization algorithms like our new FlexQAOA to operate efficiently and focus on feasible solutions.

Below, we outline the core modeling components of the problem – offering insight into how loads, prices, and constraints translate into a form that algorithms can handle.

The formulation relies on binary decision variables. Each load i can be started at the time step t<m-\tau_i where m is the optimization horizon and \tau_i the respective running duration of the load. This allows us to encode the starting time of a load i using m-\tau_i binary decision variables x_{i,t}.

The cost of starting a load is then determined by its load pattern \ell_{i,t} and the time-variable electricity cost rate r_t.

This leads to the following optimization objective (minimizing the total cost):

\underset{x}{\mathrm{argmin}}\, \sum_i \sum_{t=0}^{m - \tau_i} x_{i,t} \sum_{t'=0}^{\tau_i - 1} r_{t + t'} \ell_{i,t'}
However, this minimization formulation must be constrained, as only a selection of assignments leads to feasible solutions.

First, a load must be started once during the time horizon, but it cannot be started more than once. Therefore, we require the sum of all binary variables corresponding to a single load to be exactly one – the so-called one-hot constraint:

\sum_t^{m - \tau_i} x_{i,t} = 1 \quad \forall i
Second, physical grid limitations disallow drawing arbitrary amounts of electricity at specific times. Therefore, we require the total power draw to remain below the local capacity W. For that, we must consider all starting locations of i that still have an influence on the total power draw at the time step t:

\sum_i \sum_{t' = \max\{0, t - \tau_i + 1\}}^{\min\{t, m - \tau_i\}} \ell_{i, t' - t + \tau_i - 1} x_{i,t'} \leq W \quad \forall t
Together, the objective and constraints form a structured linear optimization problem that resembles the well-known multi-knapsack problem, making the Prosumer Problem a natural candidate for exploring quantum optimization approaches.

This sets the stage for FlexQAOA – a novel quantum algorithm built to tackle exactly these kinds of constraint-heavy, real-world problems.

Introducing FlexQAOA: A Quantum Approach to Real-World Optimization

The Prosumer Problem is well-suited for quantum optimization, as it involves purely discrete decision variables. However, traditional quantum approaches struggle with the constraints present in this problem (see above).

One of the most promising techniques in quantum optimization is the Quantum Approximate Optimization Algorithm (QAOA). It is designed to find the ground state of unconstrained Ising Hamiltonians, which correspond to Quadratic Unconstrained Binary Optimization (QUBO) problems. To handle constraints in this paradigm, they must be transformed into quadratic penalty terms and added to the objective function.

This approach, however, comes with two significant drawbacks. First, inequality constraints require ancillary variables for encoding, which substantially enlarges the search space. Second, quadratic penalty terms distort the energy spectrum of the solution space, making it harder to identify optimal solutions reliably.

This is where our novel QAOA-based algorithm, FlexQAOA, enters the picture. FlexQAOA represents a significant advancement in quantum optimization by embracing constraints as an integral part of the algorithm rather than treating them as inconvenient additions. It combines two powerful constraint-handling techniques:

  1. XY-Mixers for One-Hot Constraints: Many optimization problems involve mutually exclusive choices, such as deciding which time slot a device should start in. FlexQAOA uses specialized quantum operators called XY-mixers that naturally enforce these “one-hot” constraints and reduce the search space by focusing only on feasible solutions.
  2. Indicator Functions for Inequality Constraints: For constraints like maximum load limits, FlexQAOA employs Indicator Functions that efficiently encode constraint satisfaction – without distorting the energy landscape or requiring additional slack variables, as traditional methods do.

By working with constraints rather than against them, FlexQAOA dramatically reduces the search space and focuses computational resources on finding high-quality, feasible solutions.

Outperforming Standard QAOA: Benchmark Results for FlexQAOA

In the results presented here, FlexQAOA was evaluated through quantum circuit simulations. While quantum hardware is rapidly advancing, many real-world problem sizes remain beyond current device capabilities. Simulating the circuits allows us to analyze algorithmic performance independently of hardware noise and limitations – and to directly compare different QAOA variants under controlled conditions.

We benchmarked FlexQAOA against three QAOA baselines, each representing a different approach to constraint handling:

  • QUBO-QAOA, the standard approach where all constraints are embedded into the objective function as quadratic penalty terms.

  • XY-QAOA, which uses XY-mixers to enforce one-hot constraints, while inequality constraints are still encoded as penalties.

  • IF-QAOA, which handles inequality constraints through Indicator Functions, but relies on penalties for one-hot encoding.

FlexQAOA’s constraint-aware formulation drastically reduces the search space, which enables faster and more efficient quantum circuit simulation.
For instance, the largest instance we simulated using the QUBO-QAOA approach required 23 qubits – representing a massive search space of 2^{23} possible solutions. FlexQAOA reduced the same problem to just 80 feasible solution candidates by eliminating invalid configurations through direct constraint encoding. This particular instance involved 13 binary variables, 5 time steps, and 3 loads.

FlexQAOA also scaled to larger problems: in one case, we simulated an instance with 88 binary variables, 14 time steps, and 7 loads. Representing this instance as a QUBO would have required 130 qubits, which is well beyond the limits of current simulation tools.

To assess the quality and efficiency of the algorithms, we compared them across three key metrics:

Random-Adjusted Approximation Ratio (RAAR):
This metric measures the quality of solutions produced by the algorithm, adjusted for random baselines. A value of 0 corresponds to random sampling, while 1 indicates consistent sampling of optimal solutions. FlexQAOA achieved RAAR values above 0.95 across all tested instances – substantially outperforming the other variants.

Optimal Probability (P^*):
This value captures the probability of sampling the optimal solution in a single run. A higher P^* means fewer repetitions (shots) are required to obtain the best result. FlexQAOA consistently yielded higher P^* values compared to the baselines.

Time-to-Solution (TTS):
TTS combines the optimal probability with the depth and complexity of the quantum circuit to estimate the total number of circuit executions required to obtain an optimal solution once. FlexQAOA demonstrated lower TTS in all benchmarked cases. Moreover, our scaling analysis indicates that this advantage grows even further as problem sizes increase.

The Future of Energy Optimization with FlexQAOA

FlexQAOA demonstrates that addressing the fundamental challenge of constraint encoding can unlock significant performance improvements in quantum optimization. This marks an important step toward practical quantum applications in the energy sector. As quantum hardware continues to mature, algorithms like FlexQAOA – designed with real-world constraints in mind – will be essential for turning theoretical potential into tangible value.

“The results are extremely exciting and represent a great step forward in applying quantum technologies to real-world energy problems. We’re glad to have been part of this study in bringing the first practical use case to the application of the new constraint-aware algorithm FlexQAOA. This collaboration demonstrates how innovative quantum approaches could be used to address the growing complexity in future energy systems,” says Dr. Giorgio Cortiana, Head of Data & AI – Energy Intelligence at E.ON Digital Technology.

Michael Lachner, CEO of Aqarios, adds: “We are delighted to have worked on this study with E.ON as the first to benchmark the novel FlexQAOA algorithm on a real-world energy challenge. This partnership demonstrates how our constraint-aware quantum approach can deliver meaningful performance improvements for complex optimization problems in the industry.”

Our successful application of FlexQAOA to the Prosumer Problem is only the beginning. The underlying methodology can be extended to a wide range of high-impact challenges in the energy sector.

For example, unit commitment problems – deciding which power plants to operate and when – are becoming increasingly complex with the integration of renewables, as they require consideration of startup costs, ramp rates, reserve margins, and minimum run times.

Grid-scale battery optimization is another natural fit. These systems face difficult decisions about when to charge or discharge, factoring in price signals, battery degradation, and state-of-charge and other power-grid-related constraints.

Similarly, coordinating electric vehicle charging requires balancing the needs of millions of EVs against grid constraints and time-dependent electricity prices.

Beyond the energy sector, FlexQAOA’s ability to natively handle one-hot and inequality constraints makes it a powerful tool for domains like logistics, manufacturing, and scheduling. Problems such as the classic Job Shop Scheduling task exhibit similar structural patterns and stand to benefit greatly from constraint-aware quantum optimization.

FlexQAOA shows that embracing constraints is not a limitation – but an opportunity to make quantum optimization real.

This work was supported by the German Federal Ministry of Research, Technology and Space (BMFTR) under the funding program “Förderprogramm Quantentechnologien – von den Grundlagen zum Markt” (funding program quantum technologies — from basic research to market), project QuCUN and project Q-Grid.

Further Reading and Next Steps

FlexQAOA is now available on our Luna platform, enabling real-world optimization with built-in constraint handling – powered by quantum, hybrid, and classical backends.

If you want to explore FlexQAOA in more depth:

FlexQAOA is available as part of our Commercial and Academic plans. You can register for Luna here or contact us directly to explore tailored access.

Curious how FlexQAOA fits your use case?

Get in touch – or start experimenting today on Luna.

About Aqarios

Aqarios, headquartered in Munich, Germany, is a leading provider of quantum computing solutions across industries such as energy, aerospace, logistics, finance, manufacturing and many more. The company delivers advanced quantum software that focuses on optimization, machine learning, and simulation, offering practical tools that address critical business challenges. Aqarios has collaborated with globally recognized organizations to deliver tailored quantum solutions that drive efficiency and innovation.

Founded in 2021 by three professors and seasoned business professionals, Aqarios is a spin-off from the QAR-Lab at LMU Munich, a globally renowned hub for quantum computing research that ranks among the world’s top quantum computing institutes. With nearly a decade of experience in quantum applications, Aqarios is at the forefront of quantum innovation, leveraging its deep expertise to bridge the gap between theoretical quantum research and real-world applications.

Transform Complexity

Into Competitive Advantage

At Aqarios, we empower people and organizations to solve their most complex optimization challenges — through tailored technology, strategic guidance, and deep scientific expertise. From intuitive software like our Luna platform to custom-built solutions, we offer a full spectrum of services. Whether you’re exploring cutting-edge quantum capabilities or scaling classical methods, Aqarios is your partner in turning complexity into competitive advantage.

Let’s redefine what’s possible through advanced optimization!