Impurity Problem Initialization, Solution and Finalization

These functions initialize, solve and finalize the impurity problem. They can be invoked inside or outside the DMFT loop. The solution environment can be completely reconstructed from the bath parameters array and the global variables.

edipy2.global_env.finalize_solver()

This function cleans up the ED environment, deallocates the relevant arrays and makes a second call to init_solver possible

Returns:

Nothing

Return type:

None

edipy2.global_env.init_solver(bath=None, Nb=None, Nlat=None)

This function initializes the ED environment for the impurity problem solution, and sets the bath reading it from the hamiltonian.restart file or initializing it in a symmetric way. The function can take different argument combinations.

If no input is provided, a single-impurity bath is allocated, with dimension given by get_bath_dimension().

Parameters:
  • bath (np.array(dtype=float) or [float]) – If a bath array is provided, it has to be a numpy array or a tuple of floats. It has to have one or two dimensions. If it has one dimension, that must be the same as specified by get_bath_dimension(). If it has two dimensions, the first has to be the number of inequivalent sites for real-space DMFT, the second must be in agreement with get_bath_dimension(). If Nlat or Nb are provided, this overrides them. If the provided vector is not in agreement with the global system parameters, EDIpack2 will exit with an error. The array is ordered in F convention inside the function.

  • Nb (int) – This sets the bath vector length for each single impurity problem. It has to be in agreement with get_bath_dimension(). When this parameter alone is provided, a numpy array of this length will be initialized.

  • Nlat (int) – This sets the number of inequivalent sites for real-space DMFT. If this parameter alone is provided, get_bath_dimension() is invoked to determine the bath vector length Nb for each impurity. A [Nlat,Nb] vector is then allocated.

Returns:

An array of floats that contains the bath parameters for the impurity problem. This is a required input of solve() and chi2_fitgf(). Its elements are ordered differently depending on the bath geometry. They are (de)compactified for user interaction via bath_inspect(). Specific symmetrization operations are implemented and listed in the Bath Manipulation section.

Return type:

np.array(dtype=float)

edipy2.global_env.set_hloc(hloc, Nlat=None)

This function sets the local Hamiltonian of the impurity problem.

Parameters:
  • hloc (np.array(dtype=complex)) –

    Local Hamiltonian matrix. This can have the following shapes:

    • [ Nspin \(\cdot\) Norb , Nspin \(\cdot\) Norb ]: single-impurity case, 2-dimensional array

    • [ Nspin , Nspin , Norb , Norb ]: single-impurity case, 4-dimensional array

    • [ Nlat \(\cdot\) Nspin \(\cdot\) Norb , Nlat \(\cdot\) Nspin \(\cdot\) Norb ]: real-space DMFT case, 2-dimensional array.

    • [ Nlat , Nspin \(\cdot\) Norb , Nspin \(\cdot\) Norb ]: single-impurity case, 3-dimensional array.

    • [ Nlat , Nspin , Nspin , Norb , Norb ]: single-impurity case, 5-dimensional array.

    The array is ordered in F convention inside the function.

    Note: the way the EDIpack2 library passes from 1 comulative to 2 or 3 running indices is, from slower to faster: lat, spin, orb

  • Nlat (int) – Number of inequivalent sites for real-space DMFT. The function will raise a ValueError if the dimensions of hloc are inconsistent with the presence or absence of Nlat. The EDIpack2 library will check the correctness of the dimensions of hloc and terminate execution if inconsistent.

Raises:

ValueError – If hloc is not provided or has the wrong shape

Returns:

Nothing

Return type:

None

edipy2.global_env.solve(bath, sflag=True, iflag=True, fmpi=True, mpi_lanc=False)

This function solves the impurity problem and calculates the observables, Green’s function and self-energy.

Parameters:
  • bath (np.array(dtype=float)) – The bath array returned by init_solver(). If the bath dimensions are inconsistent with the global properties of the problem, EDIpack2 will exit with an error.

  • sflag (bool) – for single-impurity DMFT, if False, it disables the calculation of the Green’s function and susceptibilities

  • iflag (bool) – for real-space DMFT, if False, it disables the calculation of the Green’s function and susceptibilities

  • fmpi (bool) – if False, for single-impurity DMFT, it disables MPI for the ED routine, if the communicator is used elsewhere

  • mpi_lanc (bool) – if True, for real-space DMFT sets the MPI parallelization for the ED routine. By default it is False, and each inequivalent site is solved serially by a different core.

Returns:

Nothing

Return type:

None