dimod.binary.BinaryQuadraticModel.from_qubo#

classmethod BinaryQuadraticModel.from_qubo(Q: Mapping, offset: float = 0)[source]#

Create a binary quadratic model from a QUBO problem.

Parameters:
  • Q – Coefficients of a quadratic unconstrained binary optimization (QUBO) problem as a dict of form {(u, v): bias, ...}, where u, v, are binary-valued variables and bias is their associated coefficient.

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

Returns:

A binary-valued binary quadratic model.