BinaryQuadraticModel.add_variable(v=None, bias=0.0)

Parameters: v (hashable, optional) – A label for the variable. Defaults to the length of the binary quadratic model, if that label is available. Otherwise defaults to the lowest available positive integer label. bias (numeric, optional, default=0) – The initial bias value for the added variable. If v is already a variable, then bias (if any) is adding to its existing linear bias. The label of the added variable. hashable TypeError – If the label is not hashable.

Examples

>>> bqm = dimod.AdjDictBQM('SPIN')
0

>>> bqm = dimod.AdjDictBQM('SPIN')