dimod.QuadraticModel.set_quadratic

QuadraticModel.set_quadratic(u: Hashable, v: Hashable, bias: Union[int, float, numpy.number])[source]

Set the quadratic bias between a pair of variables in the quadratic model.

Parameters
  • u – Variable in the quadratic model.

  • v – Variable in the quadratic model.

  • bias – Quadratic bias to set for interaction (u, v).

Raises

TypeError – If u or v is not hashable.