dimod.QuadraticModel.add_variables_from¶
- QuadraticModel.add_variables_from(vartype: Union[dimod.vartypes.Vartype, str, frozenset], variables: Iterable[Hashable])[source]¶
Add multiple variables of the same type to the quadratic model.
- Parameters
Examples
>>> from dimod import QuadraticModel, Binary >>> qm = QuadraticModel() >>> qm.add_variables_from('BINARY', ['x', 'y'])