dimod.BinaryQuadraticModel.remove_offset

BinaryQuadraticModel.remove_offset()[source]

Set the binary quadratic model’s offset to zero.

Examples

This example creates an Ising model with a positive energy offset, and then removes it.

>>> import dimod
...
>>> bqm = dimod.BinaryQuadraticModel({}, {}, 1.3, dimod.SPIN)
>>> bqm.remove_offset()
>>> bqm.offset
0.0