qubols allow to solve linear system of equations using a QUBO approach and to deploy this calculation on D`Wave hardware. See an example of use here
To install qubols from GitHub repository, do:
git clone https://github.com/QuantumApplicationLab/qubols.git
cd qubols
python3 -m pip install .
import numpy as np
from qubols.qubols import QUBOLS
from qubols.encodings import RangedEfficientEncoding
from dwave.samplers import SimulatedAnnealingSampler
# define a symmetric matrix
size = 4
A = np.random.rand(size,size)
A = 0.1*(A+A.T)
# define the right hand side of the system
b = np.random.rand(size,1)
# options of the qubols solver
options = {'num_reads':50, 'sampler':SimulatedAnnealingSampler(),
'encoding': RangedEfficientEncoding, 'num_qbits':4, 'range':10.0}
# create the solver
qubols= QUBOLS(options)
# solve the linear system
sol_num = qubols.solve(A, b)
If you want to contribute to the development of qubols, have a look at the contribution guidelines.
This package was created with Cookiecutter and the NLeSC/python-template.