dimod.DiscreteQuadraticModel.get_quadratic#

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

  • v – A variable in the discrete quadratic model.

  • array (bool, optional, default=False) – If True, a dense array is

  • dict. (returned rather than a)

Returns:

The quadratic biases. If array=False, returns a dictionary of the form {case_u, case_v: bias, …} If array=True, returns a num_cases(u)() by num_cases(v)() numpy array.