A prototype of the new solver, HOBO solver "hobotan," is now available.
We have created a new solver with volunteers on Discord.
We are extending QUBO to HOBO.
We are working on integrating it into the QUBO annealing compatible library TYTAN.
A prototype is available at https://github.com/ShoyaYasuda/hobotan.
You can try it with limited functionality, so please give us your feedback.
pip install -U git+https://github.com/ShoyaYasuda/hobotan
import numpy as np
from hobotan import *
"""
Only supports 1-dimensional arrays; [4, 4] is not allowed.
Only supports symbols named 'q'.
"""
q = symbols_list(5, 'q{}')
print(q)
"""
Expressions are probably OK with any number of terms.
"""
H = (q[0] + q[1] + q[2] + q[3] + q[4] - 5)**2 - 20*q[1]*q[2] - 10*q[1]*q[2]*q[3] + 5*q[1]*q[2]*q[3]*q[4]
Compile to HOBO tensor
hobo, offset = Compile(H).get_hobo()
print(offset)
print(hobo)
Select sampler (random seed fixed)
solver = sampler.SASampler(seed=0)
Sampling (100 times)
result = solver.run(hobo, shots=100)
Results
for r in result:
print(r)
arr, subs = Auto_array(r[0]).get_ndarray('q{}')
print(arr)