dimod.testing.asserts.assert_bqm_almost_equal#
- assert_bqm_almost_equal(actual, desired, places=7, ignore_zero_interactions=False)[source]#
Test if two binary quadratic models have almost equal biases.
- Parameters:
actual (
BinaryQuadraticModel
) – First binary quadratic model.desired (
BinaryQuadraticModel
) – Second binary quadratic model.places (int, optional, default=7) – Bias equality is computed as
round(b0 - b1, places) == 0
.ignore_zero_interactions (bool, optional, default=False) – If true, interactions with 0 bias are ignored.