Describe the bug
The output of the to_qubo() function in pyqubo does not correctly include the coefficients for single binary variables in the expected output.
To Reproduce
from pyqubo import Binary, Constraint
def output_qubo(H):
model = H.compile()
qubo, _ = model.to_qubo()
print(qubo)
a, b = Binary('a'), Binary('b')
M = 5.0
output_qubo(2 * a + b)
output_qubo(2 * a + b + M * Constraint((a + b) ** 2, label='a+b=0'))
Describe the bug The output of the
to_qubo()
function inpyqubo
does not correctly include the coefficients for single binary variables in the expected output.To Reproduce
Actual Output
Expected Output The expected output should include the coefficients for the single binary variables as well as follows: