triqs.utility.comparison_tests

Numerical equality assertions for arrays and Green’s functions.

These helpers are used throughout the TRIQS test suite to compare numerical objects up to a tolerance. Each function raises AssertionError when the inputs differ by more than precision in maximum absolute element-wise difference, and returns None on success.

Functions

assert_array_close_to_scalar(a, x[, precision])

Assert that a square matrix equals x times the identity.

assert_arrays_are_close(a, b[, precision])

Assert that two arrays are equal in maximum absolute difference.

assert_block2_gfs_are_close(a, b[, precision])

Assert that two Block2Gf objects are equal block by block.

assert_block_gfs_are_close(a, b[, precision])

Assert that two BlockGf objects are equal block by block.

assert_gfs_are_close(a, b[, precision])

Assert that two Green's functions agree on their data array.