dimod.binary.BinaryQuadraticModel.maximum_energy_delta#

BinaryQuadraticModel.maximum_energy_delta() float | floating | integer[source]#

Compute a conservative bound on the maximum change in energy that can result from flipping a single variable in a binary quadratic model.

The bound is useful as a starting point for determining the values of penalty parameters in a penalty model.

Returns:

Bound on change in energy.

Examples

>>> Q = {(0, 0): -1, (0, 1): 1, (1, 2): -4.5}
>>> bqm = dimod.BinaryQuadraticModel.from_qubo(Q)
>>> bqm.maximum_energy_delta()
5.5