dimod.higherorder.polynomial.BinaryPolynomial.energy

BinaryPolynomial.energy(sample_like, dtype=<class 'float'>)[source]

The energy of the given sample.

Parameters
  • sample_like (samples_like) – A raw sample. sample_like is an extension of NumPy’s array_like structure. See as_samples().

  • dtype (numpy.dtype, optional) – The data type of the returned energies. Defaults to float.

Returns

The energy.