dimod.higherorder.polynomial.BinaryPolynomial.from_hising#

classmethod BinaryPolynomial.from_hising(h, J, offset=None)[source]#

Construct a binary polynomial from a higher-order Ising problem.

Parameters:
  • h (dict) – The linear biases.

  • J (dict) – The higher-order biases.

  • offset (optional, default=0.0) – Constant offset applied to the model.

Returns:

BinaryPolynomial

Examples

>>> poly = dimod.BinaryPolynomial.from_hising({'a': 2}, {('a', 'b'): -1}, 0)
>>> poly.degree
2