triqs.utility.comparison_tests.assert_arrays_are_close

triqs.utility.comparison_tests.assert_arrays_are_close(a, b, precision=1e-06)[source]

Assert that two arrays are equal in maximum absolute difference.

Computes \(d = \max_i |a_i - b_i|\) and requires d < precision. The assertion error message embeds both arrays and the computed difference, to aid debugging.

Parameters:
a, barray-like

Arrays of identical shape.

precisionfloat, optional

Maximum allowed value of the elementwise absolute difference. Default 1e-6.

Raises:
AssertionError

If max(abs(a - b)) >= precision.