dimod.binary.BinaryQuadraticModel.add_linear_from

BinaryQuadraticModel.add_linear_from(linear: Union[Iterable, Mapping])[source]

Add variables and linear biases to a binary quadratic model.

Parameters

linear – A collection of variables and their associated linear biases. If a dict, should be of the form {v: bias, …} where v is a variable and bias is its associated linear bias. Otherwise, should be an iterable of (v, bias) pairs.