dimod.higherorder.polynomial.BinaryPolynomial.to_hubo#

BinaryPolynomial.to_hubo()[source]#

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

Returns:

A 2-tuple of the form (H, offset) where H is the HUBO and offset is the linear offset.

Return type:

tuple

Examples

>>> poly = dimod.BinaryPolynomial({'a': -1, ('a', 'b', 'c'): -1}, dimod.BINARY)
>>> H, off = poly.to_hubo()