# zero_if_close¶

tenpy.tools.misc.zero_if_close(a, tol=1e-15)[source]

set real and/or imaginary part to 0 if their absolute value is smaller than tol.

Parameters
andarray

numpy array to be rounded

tolfloat

the threashold which values to consider as ‘0’.