dimod.higherorder.polynomial.BinaryPolynomial.from_hubo#

classmethod BinaryPolynomial.from_hubo(H, offset=None)[source]#

Construct a binary polynomial from a higher-order unconstrained binary optimization (HUBO) problem.

Parameters:

H (dict) – Coefficients of a higher-order unconstrained binary optimization (HUBO) model.

Returns:

BinaryPolynomial

Examples

>>> poly = dimod.BinaryPolynomial.from_hubo({('a', 'b', 'c'): -1})
>>> poly.degree
3