dimod.CaseLabelDQM.get_quadratic#

CaseLabelDQM.get_quadratic(u, v, array=False)[source]#

The 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.

  • array (bool, optional, default=False) – If True and u and v are variables, a dense array is returned rather than a dict. If u and v are unique case labels, ignored.

Returns:

The quadratic biases. If array=False and u and v are variables, returns a dictionary of the form {case_u, case_v: bias, …}

If array=True and u and v are variables, returns a NumPy array of size num_cases(u)() by num_cases(v)().

If u and v are unique case labels, returns a float.

Raises:

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