dimod.binary.BinaryQuadraticModel.add_variable#

BinaryQuadraticModel.add_variable(v: Hashable | None = None, bias: float | floating | integer = 0)[source]#

Add a variable to a binary quadratic model.

Parameters:
  • v – Variable label. If not provided, the next integer label is used.

  • bias – Linear bias for the added variable.