Skip to content

Optimization and QUBO

openqaoa

Maintained by entropicalabs

OpenQAOA is one of the clearest open-source projects focused specifically on QAOA-style optimization workflows, making it a natural reference point for teams exploring quantum optimization claims.

PythonMITFlagshipQtangl relevant
openqaoa illustration

Resource snapshot

Category

Optimization and QUBO

Stars

139

Last pushed

Aug 29, 2024Updated 2y ago

Open issues

25

What it is

For readers trying to separate real software from abstract promise, OpenQAOA is valuable because it exposes the mechanics of a QAOA-oriented workflow in code. It gives people something inspectable to compare against both classical baselines and other hybrid libraries.

That makes it an especially strong resource in a learn section built around operational honesty. It helps readers understand what QAOA actually looks like in software, not just in slideware.

Who it's for

Developers and evaluators comparing QAOA tooling, hybrid optimization workflows, and the practical software around combinatorial optimization experiments.

What you can build or learn

  • Inspect how QAOA workflows are modeled, executed, and evaluated.
  • Compare quantum optimization tooling against classical-first baselines.
  • Use the project as a concrete reference point in optimization discussions.

Code samples

Examples from the repository.

01 Workflows Example (examples/01_workflows_example.ipynb)
#some regular python libraries
import networkx as nx
import numpy as np
from pprint import pprint
import matplotlib.pyplot as plt

#import problem classes from OQ for easy problem creation
from openqaoa.problems import MaximumCut, NumberPartition

#import the QAOA workflow model
from openqaoa import QAOA

#import method to specify the device
from openqaoa.backends import create_device
02 Simulators Comparison (examples/02_simulators_comparison.ipynb)
#some regular python libraries
import networkx as nx
import numpy as np
from pprint import pprint
import matplotlib.pyplot as plt

#import problem classes from OQ for easy problem creation
from openqaoa.problems import MaximumCut, NumberPartition

#import the QAOA workflow model
from openqaoa import QAOA

#import method to specify the device
from openqaoa.backends import create_device
03 Qaoa On Qpus (examples/03_qaoa_on_qpus.ipynb)
#import problem classes from OQ for easy problem creation
from openqaoa.problems import NumberPartition

#import the QAOA workflow model
from openqaoa import QAOA

#import method to specify the device
from openqaoa.backends import create_device

#Import IBMQ
from qiskit import IBMQ

License

MIT

SPDX identifier detected from the repository metadata or license files.

Repository README

Preview from the project README.

Rendered as Markdown inside a scrollable preview. Long READMEs stay contained; expand or open on GitHub for the full document.

~780 words · about 4 min readOpen on GitHub

build test Documentation Status PyPI version Downloads Binder

OpenQAOA

A multi-backend python library for quantum optimization using QAOA on Quantum computers and Quantum computer simulators. Check out the OpenQAOA website at https://openqaoa.entropicalabs.com/

OpenQAOA is currently in OpenBeta.

Please, consider joining our discord if you want to be part of our community and participate in the OpenQAOA's development.

Installation instructions

OpenQAOA is divided into separately installable plugins based on the requirements of the user. The core elements of the package are placed in openqaoa-core which comes pre-installed with each flavour of OpenQAOA.

Currently, OpenQAOA supports the following backends and each can be installed exclusively with the exception of openqaoa-azure which installs openqaoa-qiskit as an additional requirement because Azure backends support circuit submissions via qiskit.

  • openqaoa-braket for AWS Braket
  • openqaoa-azure for Microsoft Azure Quantum
  • openqaoa-pyquil for Rigetti Pyquil
  • openqaoa-qiskit for IBM Qiskit

The OpenQAOA metapackage, openqaoa allows you to install all OpenQAOA plug-ins together.

Install via PyPI

You can install the latest version of OpenQAOA directly from PyPI. First, create a virtual environment with python3.8, 3.9, 3.10 and then pip install openqaoa with the following command

pip install openqaoa

Install via git clone

Alternatively, you can install OpenQAOA manually from the GitHub repository by following the instructions below.

NOTE: We recommend creating a python virtual environment for this project using a python environment manager, for instance Anaconda. Instructions can be found here. Make sure to use python 3.8 (or newer) for the environment.

  1. Clone the git repository:
git clone https://github.com/entropicalabs/openqaoa.git
  1. After cloning the repository cd openqaoa and pip install the package with instructions from the Makefile as follows
make local-install

Installation instructions for Developers

Users can install OpenQAOA in the developer mode via the Makefile. For a clean editable install of the package run the following command from the openqaoa folder.

make dev-install

The package can be installed as an editable with extra requirements defined in the setup.py. If you would like to install the extra requirements to be able run the tests module or generate the docs, you can run the following

make dev-install-x,   with x = {tests, docs, all}

Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue!

Getting started

The API documentation for OpenQAOA can be found here. We also provide a set of tutorials to get you started. Among the many, perhaps you can get started with the following ones:

Key Features

  • Build advanced QAOAs. Create complex QAOAs by specifying custom parametrisation, mixer hamiltonians, classical optimisers and execute the algorithm on either simulators or QPUs.

  • Recursive QAOA. Run RQAOA with fully customisable schedules on simulators and QPUs alike.

  • QPU access. Built in access for IBM Quantum, Rigetti QCS, Amazon Braket and Azure Quantum.

Available devives

Devices are serviced both locally and on the cloud. For the IBM Quantum experience, the available devices depend on the specified credentials. For QCS and Amazon Braket, the available devices are listed in the table below:

Device locationDevice Name
local['qiskit.shot_simulator', 'qiskit.statevector_simulator', 'vectorized', 'pyquil.statevector_simulator']
Amazon BraketIonQ, Rigetti, OQC, and simulators
IBMQPlease check the IBMQ backends available to your account
Rigetti QCSAspen-11, Aspen-M-1, and QVM simulator
AzureIonQ, Quantinuum, Rigetti, QCI

Running the tests

To run the unit-tests, first, make sure to have installed all the optional testing dependencies by running make dev-install-tests. Next type pytest tests/ /src/*/tests/ from the project's root folder. This runs the common metapackage unit-tests and the unit-tests for each OpenQAOA plugin.

:warning: Some tests require authentication: Please, check the flags in pytest.ini. Currently these testes are marked qpu, api, docker_aws, braket_api, sim

:warning: Some tests require authentication: Please, note that the PyQuil-Rigetti tests contained in test_pyquil_qvm.py requires an active qvm (see Rigetti's documentation here)

Contributing and feedback

If you find any bugs or errors, have feature requests, or code you would like to contribute, feel free to open an issue or send us a pull request on GitHub.

We are always interested to hear about projects built with OpenQAOA. If you have an application you'd like to tell us about, drop us an email at openqaoa@entropicalabs.com

Read on GitHub

Activity

Latest release

—

Watchers

14

Python support

—

How this relates to Qtangl

OpenQAOA is directly relevant to Qtangl because it sits close to the product's most visible research story: bounded quantum-assisted optimization. Even if Qtangl returns classical plans by default today, OpenQAOA is part of the real comparison set for understanding where QAOA workflows help, where they stay research-sized, and how much orchestration surrounds them in practice.

Learn digest

Get monthly updates when library entries change.

Monthly digest: new library entries, updated flagships, and one editorial pick.

Related resources

Keep exploring nearby tools.

dwavesystems

dwave_sapi_dimod

dimod wrapper for D-Wave's SAPI Client Library

PythonApache-2.0Archive

9 stars · Updated 8y ago

cda-tum

mqt-qmap

MQT QMAP - A tool for Quantum Circuit Mapping written in C++

C++MITFlagshipQtangl relevant

138 stars · Updated 3mo ago

dwavesystems

penaltymodel

Utilities and interfaces for using penalty models.

PythonApache-2.0Archive

19 stars · Updated 1y ago

Qiskit

qiskit-optimization

Quantum Optimization

PythonApache-2.0FlagshipQtangl relevant

281 stars · Updated 5mo ago

jtiosue

qubovert

The one-stop package for formulating, simulating, and solving problems in boolean and spin form

PythonApache-2.0FlagshipQtangl relevant

41 stars · Updated 4mo ago

goodchemistryco

Tangelo

A python package for exploring end-to-end chemistry workflows on quantum computers and simulators.

PythonApache-2.0Qtangl relevant

137 stars · Updated 8mo ago