dimod.QuadraticModel.is_almost_equal

QuadraticModel.is_almost_equal(other: Union[QuadraticModel, BinaryQuadraticModel, int, float, numpy.number], places: int = 7) bool[source]

Test if the given quadratic model’s biases are almost equal.

Test whether each bias in the binary quadratic model is approximately equal to each bias in other. Approximate equality is calculated by passing the difference to round(). places determines the number of decimal places.