dimod.binary.BinaryQuadraticModel.add_quadratic#

BinaryQuadraticModel.add_quadratic(u: Hashable, v: Hashable, bias: float | floating | integer)[source]#

Add a quadratic bias between two variables.

Parameters:
  • u – Variable in the binary quadratic model.

  • v – Variable in the binary quadratic model.

  • bias – Quadratic bias for the interaction.

Raises:

ValueError – If any self-loops are given. E.g. (u, u, bias) is not a valid triplet.