from pyqubo import Binary

x_0, x_1, x_2 = (Binary('x_'+str(i)) for i in range(3))
linear_obj = - x_0 - x_2
quadratic_obj = - x_0 + x_0*x_2 + x_1 - 2*x_1*x_2
linear_cstr = 8*(x_1 - x_2)**2
qubo_bqm = (linear_obj + quadratic_obj + linear_cstr).compile().to_bqm()

print(qubo)