Auxiliary procedures

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

This function checks the relative variation of a given quantity (Weiss field, Delta, …) against the one for the previous step. It is used to determine whether the DMFT loop has converged. If a maximum number of loops is exceeded, returns True with a warning and appends it to the plain text file ERROR.README.

Parameters:
  • func (np.array(dtype=complex)) – the quantity to be checked. It can have any rank and shape, but the last dimension is summed over to get the relative error. All the components in the other dimensions are evalutated in the same way. The overall error is the average of the component-resolved error. It is appended to the plain text file error.err. The maximum and minimum component-resolve errors, as well as all the finite component-resolved error values are appended to the plain text files error.err.max, error.err.min and error.err.distribution respectively.

  • threshold (float) – the error threshold (default = dmft_error)

  • 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()[source]

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()[source]

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)[source]

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