dimod.ConstrainedQuadraticModel.from_discrete_quadratic_model

ConstrainedQuadraticModel.from_discrete_quadratic_model()[source]

Construct a constrained quadratic model from a discrete quadratic model.

Parameters
  • dqm – Discrete quadratic model.

  • relabel_func (optional) – A function that takes two arguments, the variable label and the case label, and returns a new variable label to be used in the CQM. By default generates a 2-tuple (variable, case).

Returns

A constrained quadratic model.