dimod.binary.BinaryQuadraticModel.add_variable

BinaryQuadraticModel.add_variable(v: Optional[Hashable] = None, bias: Union[int, float, numpy.number] = 0)[source]

Add a variable to a binary quadratic model.

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

  • bias – Linear bias for the added variable.