Python Interface

Class

class QBSolv[source]

Wraps the qbsolv C package for python.

Examples

This example uses the tabu search algorithm to solve a small Ising problem.

>>> h = {0: -1, 1: 1, 2: -1}
>>> J = {(0, 1): -1, (1, 2): -1}
>>> response = QBSolv().sample_ising(h, J)
>>> list(response.samples())
'[{0: 1, 1: 1, 2: 1}]'
>>> list(response.energies())
'[1.0]'

Methods

QBSolv.sample(bqm[, num_repeats, seed, …]) Sample low-energy states defined by a QUBO using qbsolv.