triqs.utility.comparison_tests.assert_block_gfs_are_close

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

Assert that two BlockGf objects are equal block by block.

Iterates over the blocks of a and b in parallel, checks that the block names match, and defers the data comparison of each block to assert_gfs_are_close().

Parameters:
a, btriqs.gf.BlockGf

Block Green’s functions with the same number of blocks and the same block names.

precisionfloat, optional

Maximum allowed element-wise absolute difference on each block’s data array. Default 1e-6.

Raises:
AssertionError

If the number of blocks differs, the block names differ, or any block fails assert_gfs_are_close().