dimod.binary.BinaryQuadraticModel.from_ising

classmethod BinaryQuadraticModel.from_ising(h: Union[Mapping, Sequence], J: Mapping, offset: float = 0)[source]

Create a binary quadratic model from an Ising problem.

Parameters
  • h – Linear biases of the Ising problem, as either a dict of the form {v: bias, ...}, where v is a spin-valued variable and bias is its associated bias, or as a list of biases, where the indices are the variable labels.

  • J – Quadratic biases of the Ising problem.

  • offset – Constant offset.

Returns

A spin-valued binary quadratic model.