zero_if_close

  • full name: tenpy.tools.misc.zero_if_close

  • parent module: tenpy.tools.misc

  • type: function

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:
  • a (ndarray) – numpy array to be rounded

  • tol (float) – the threshold which values to consider as ‘0’.