Introducing the IQM QAOA Library: An Open-Source Toolkit for Quantum Optimization

14 Jul 2025
2 min read

Built in Python, the library provides a full-stack interface for running a variety of different Quantum Approximate Optimization Algorithm (QAOA) flavors from problem definition to hardware execution. Whether you’re a researcher, developer, or just curious about quantum computing, this library is designed to support you every step of the way. 

Why QAOA? Why Now?

QAOA is a powerful algorithm for tackling combinatorial optimization problems. Its versatility makes it a key candidate for early quantum advantage. Our goal with this library is to democratize access to QAOA, making it easier to experiment, prototype, and run on real hardware while being able to quickly switch between different variants.

 

What’s Inside the IQM QAOA Library?

Problem Definition

QAOA is commonly used for solving Quadratic Unconstrained Binary Optimization (QUBO) problems, where the objective is to minimize a cost function:

To make this easier, our library provides multiple ways to define QUBO problems:

  • Directly with a matrix Q
  • Through intuitive representations like graphs using networkx (for prob- lems like MaxCut or Maximum Independent Set)
  • Using random instance generators, useful for benchmarking (e.g., calcu- lating the Q-score)

Advanced users can also extend the base classes to define their own custom problems.

QAOA Training

QAOA is a variational algorithm. It has a single hyperparameter p (the number of layers), and each layer comes with two real-valued parameters that need to be optimized.

The standard training method involves sampling from a quantum circuit and minimizing the energy retrieved from the measurements – although this can run into issues like barren plateaus. To address this, the library includes advanced training strategies:

  • Exact energy expectation via tensor networks (for low-depth QAOA)
  • Analytical solutions for sparse instances of problems like MaxCut and MIS—no training loop needed
Transpilation and Routing

QAOA circuits have a structure that allows highly specialized transpilation. Each layer contains a block of commuting gates, which allows for an efficient mapping to the hardware.

Therefore, the library includes several transpilers you can experiment with:

  • A swap network transpiler for grid-based QPUs
  • A greedy transpiler for sparse problems (developed in-house at IQM)
  • A transpiler tailored for IQM’s proprietary star-shaped QPU topology
Running QAOA Experiments

Once you’ve defined a problem and trained your QAOA parameters, you’re ready to run it:

  • Login to IQM Resonance, submit your jobs directly and get back results – all seamlessly integrated. If you don’t have a Resonance account yet, go here to get started with your free account.
  • Export as a circuit for simulation or deployment on other platforms

 

What’s Next?

We’re just getting started. Here’s a glimpse of what’s coming soon to the IQM QAOA Library:

  • More built-in problem types
  • Support for the parameter concentration training strategy
  • Integration with Qrisp

Join us on this journey to make quantum optimization accessible, powerful, and practical. Explore the code, contribute, and let us know what you want to build with it!

https://docs.meetiqm.com/iqm-qaoa/readme.html

About the Author

Author Image
Jiri Guth Jarkovsky
Quantum Application Engineer

Jiri Guth Jarkovsky is a quantum application engineer at IQM Quantum Computers, specializing in quantum and classical optimization algorithms. Coming from a quantum information theory background, he loves diving deep into the mathematical complexities of the hardest optimization problems and laying those complexities out in clear, efficient code.

Are you ready to change the future?

Turn your ideas into impact and connect with us today.

Search faster—hit Enter instead of clicking.