classmethod ConstrainedQuadraticModel.from_dqm(dqm: DiscreteQuadraticModel, *, relabel_func: Callable[[Variable, int], Variable] = <function ConstrainedQuadraticModel.<lambda>>) ConstrainedQuadraticModel[source]

Construct a constrained quadratic model from a discrete quadratic model.

  • 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).


A constrained quadratic model.