Skip to content

qiboteam/qiboopt

Repository files navigation

Qiboopt

Qiboopt is a plugin to Qibo for solving combinatorial optimization problems.

Documentation

For the complete documentation on qiboopt, please refer to qiboopt.

Minimum working example

This repository can create QAOA circuits given a QUBO. For certain applications such as maximum independent set and traveling salesman problem, more functionalities have been coded to prepare the QUBO faster.

For example, to construct a Maximal Independent Set problem instance as a QUBO and solving it using QAOA:

import networkx as nx
from qiboopt.combinatorial.combinatorial import MIS

# Defining the problem, and converting it to a QUBO
G = nx.Graph()
G.add_edges_from([(0, 1), (1, 2), (2, 0)])
mis = MIS(G)
penalty = 10
qp = mis.penalty_method(penalty)  # qp is a QUBO class in qiboopt

# Train 2 layers of regular QAOA
gammas = [0.1, 0.2]
betas = [0.3, 0.4]
output = qp.train_QAOA(gammas=gammas, betas=betas)
print(output)

Contact

To get in touch with the community and the developers, consider joining the Qibo workspace on Matrix:

Matrix

If you have a question about the project, contact us at 📫.

Contributing

Contributions, issues and feature requests are welcome.

About

Optimization tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 5