dimod.binary.BinaryQuadraticModel.is_almost_equal

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

Test if the given binary 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.