Skip to content

30-Second Quickstart

Install from PyPI

Qubo Solver can be installed from PyPI with your favorite pyproject-compatible Python manager. Using pip, for example:

pip install qubo-solver

Don't forget to create a virtual environment first!

Your first βš›οΈQuantumβš›οΈ solve

Runs on an emulator, no QPU required

By default, the solver runs locally using Pasqal's emulators, so you can try it out without access to real quantum hardware.

from qubosolver import Instance, Solver, matrix, analysis

# Define an Instance from a symmetric matrix
Q = matrix.tensor(
    [
        [-0.2, 0.0, 1.0],
        [0.0, -1.0, 1.5],
        [1.0, 1.5, -0.1],
    ]
)
instance = Instance(Q)

# Instantiate the quantum solver (default)
solver = Solver(instance)
solution = solver.solve()

print(analysis.to_dataframe([solution]))
  labels bitstrings  costs  counts  probs
0      0        110   -1.2     988  0.988
1      0        001   -0.1      12  0.012

The solver returns a Solution instance holding the candidate bitstrings and their QUBO costs. As the quantum solver samples the solution space, it also reports each bitstring's count (how many times it was measured) and probability.