Auxiliary procedures

edipy2.global_env.check_convergence(func, threshold, N1=None, N2=None)

This function checks the variation of a given quantity (Weiss field, Delta, …) against the one for the previous step. It is used to determined whether the DMFT loop has converged. If a maximum number of loops is exceeded, returns True with a warning.

Parameters:
  • func (np.array(dtype=complex)) – the quantity to be checked. It is one-dimensional, with its length being a number of frequencies

  • threshold (float) – the error threshold

  • N1 (int) – minimum number of loops (default = Nsuccess)

  • N2 (int) – maximum number of loops (default = Nloop)

Returns:

  • the error

  • a boolean signifying convergence

Return type:

float, bool

edipy2.global_env.get_bath_type()

This function returns an integer number related to the value of bath_type in the input file

  • 1 for normal bath

  • 2 for hybrid bath

  • 3 for replica bath

  • 4 for general bath

Returns:

the integer index

Return type:

int

edipy2.global_env.get_ed_mode()

This function returns an integer number related to the value of ed_mode in the input file

  • 1 for normal mode

  • 2 for superc mode

  • 3 for nonsu2 mode

Returns:

the integer index

Return type:

int

edipy2.global_env.search_variable(var, ntmp, converged)

This function checks the value of the read density ntmp against the desired value nread (if different from zero) and adjusts var accordingly (in a monotonous way).

Parameters:
  • var (float) – the variable to be adjusted (usually xmu )

  • ntmp (float) – the density value at the given iteration

  • converged (bool) – whether the DMFT loop has achieved a sufficiently small error independently on the density

Returns:

  • the new value of var

  • a boolean signifying convergence

Return type:

float, bool