dimod.QuadraticModel.from_bqm#

classmethod QuadraticModel.from_bqm(bqm: BinaryQuadraticModel) QuadraticModel[source]#

Construct a quadratic model from a binary quadratic model.

Parameters:

bqm – Binary quadratic model from which to create the quadratic model.

Returns:

Quadratic model.

Examples

>>> from dimod import QuadraticModel, BinaryQuadraticModel
>>> bqm = BinaryQuadraticModel({'a': 0.1, 'b': 0.2}, {'ab': -1}, 'SPIN')
>>> qm = QuadraticModel.from_bqm(bqm)