dimod.CaseLabelDQM.set_quadratic#

CaseLabelDQM.set_quadratic(u, v, biases)[source]#

Set biases associated with the interaction between u and v.

Parameters:
  • u – A variable in the discrete quadratic model, or a unique case label. If u is a unique case label, v must be a unique case label.

  • v – A variable in the discrete quadratic model, or a unique case label. If u is a unique case label, v must be a unique case label.

  • biases (float or array-like/dict) –

    The quadratic biases. If u and v are variables, then biases may be a dictionary of the form {case_u, case_v: bias, …} or a num_cases(u)() by num_cases(v)() array-like.

    If u and v are unique case labels, the quadratic bias is a real number.

Raises:

ValueError – If u is a unique case label and v is not.