dimod.binary.BinaryQuadraticModel.add_linear_from#
- BinaryQuadraticModel.add_linear_from(linear: Mapping[Hashable, float | floating | integer] | Iterable[Tuple[Hashable, float | floating | integer]])[source]#
Add variables and linear biases to a binary quadratic model.
- Parameters:
linear – Variables and their associated linear biases, as either a dict of form
{v: bias, ...}
or an iterable of(v, bias)
pairs, wherev
is a variable andbias
is its associated linear bias.