Auxiliary Functions

Description

Hosts a number of auxiliary procedures required in different parts of the code. Specifically, it implements: creation/annihilation fermionic operators, binary decomposition of integer representation of Fock states and setup the local impurity Hamiltonian

Quick access

Routines:

allgather_vector_mpi(), bdecomp(), c(), cdg(), ed_reset_suffix(), ed_search_variable(), ed_set_hloc(), ed_set_suffix(), read_denschimatrix(), read_exctchimatrix(), read_impdmatrix(), read_impgmatrix(), read_pairchimatrix(), read_spinchimatrix(), scatter_vector_mpi(), search_chemical_potential()

Used modules

External modules

Subroutines and functions

interface  ed_aux_funx/ed_set_hloc(hloc)

This subroutine sets the local Hamiltonian of the impurity problem. The local hamiltonian can have different shapes:

Parameters:

hloc (various shapes) [complex, in] – The local Hamiltonian array

interface  ed_aux_funx/ed_set_suffix(indx)

This subroutine sets a suffix for the output files generated by the library as stored in the global variable ed_file_suffix. The suffix can be of type:

  • integer: will be converted to string and padded with zeros

  • real: will be converted to string

  • character[len=*]

Parameters:

indx [integer/real/character(len=*)]

interface  ed_aux_funx/scatter_vector_mpi(mpicomm, v, vloc)

Scatter the vector \(\vec{V}\) into the smaller parts \(\vec{V}_{t}\) on each thread such that \(\sum_{t}{\rm size}(\vec{V}_t) = {\rm size}(\vec{V})\)

Parameters:
  • mpicomm [integer]

  • v (•) [real/complex] – = Mpi_Allreduce(Nloc)"

  • vloc (•) [real/complex] – size[Nloc]

interface  ed_aux_funx/allgather_vector_mpi(mpicomm, vloc, v)

All threads gather the other portions \(\vec{V}_{t}\) of the vector \(\vec{V}\) and reduce it into a local copy.

Parameters:
  • mpicomm [integer]

  • vloc (•) [real/complex] – size[Nloc]

  • v (•) [real/complex] – = Mpi_Allreduce(Nloc)"

subroutine  ed_aux_funx/ed_reset_suffix()

This subroutine resets the suffix set by ed_set_suffix() to an empty string

subroutine  ed_aux_funx/c(pos, in, out, fsgn[, ierr])

Fermionic destruction operator, used in the construction of the sector Hamiltonian. The c() operator set the bit at position pos to 0 in the bit representation of the integer in. Further it evaluates the corresponding fermionic sign fsign as \(\sum_{i<pos}(-1)^{i}\). The obtained bitset identifies a new integer Out.

Parameters:
  • pos [integer, in]

  • in [integer, in]

  • out [integer, inout]

  • fsgn [real, inout]

Options:

ierr [logical]

subroutine  ed_aux_funx/cdg(pos, in, out, fsgn[, ierr])

Fermionic creation operator, used in the construction of the sector Hamiltonian. The cdg() operator set the bit at position pos to 1 in the bit representation of the integer in. Further it evaluates the corresponding fermionic sign fsign as \(\sum_{i<pos}(-1)^{i}\). The obtained bitset identifies a new integer Out.

Parameters:
  • pos [integer, in]

  • in [integer, in]

  • out [integer, inout]

  • fsgn [real, inout]

Options:

ierr [logical]

function  ed_aux_funx/bdecomp(i, ntot)

Binary decomposition of the integer i with ntot bits. The input integers represents a Fock state \(|i-1\rangle\) with \(i=1,\dots,2^{2N_s}\). The resulting vector ivec describes the state \(|n_1,n_2,\dots,n_{N_{tot}}\rangle\) with \(n_i=0,1\).

Parameters:
  • i [integer]

  • ntot [integer]

Result:

ivec (ntot) [integer]

subroutine  ed_aux_funx/read_impgmatrix([file])

This subroutine reads weights and poles of the impurity Green's function by calling read_GFmatrix(). These are read from a file named "file"//str(ed_file_suffix)//.restart" taking into account the value of the global variable ed_file_suffix , which is "_ineq_Nineq" padded with 4 zeros in the case of inequivalent sites, as per documentation

Options:

file [character(len=*)]

subroutine  ed_aux_funx/read_impdmatrix([file])

This subroutine reads weights and poles of the phonons Green's function by calling read_GFmatrix(). These are read from a file named "file"//str(ed_file_suffix)//.restart" taking into account the value of the global variable ed_file_suffix , which is "_ineq_Nineq" padded with 4 zeros in the case of inequivalent sites, as per documentation

Options:

file [character(len=*)]

subroutine  ed_aux_funx/read_spinchimatrix([file])

This subroutine reads weights and poles of the impurity spin susceptibility function by calling read_GFmatrix(). These are read from a file named "file"//str(ed_file_suffix)//.restart" taking into account the value of the global variable ed_file_suffix , which is "_ineq_Nineq" padded with 4 zeros in the case of inequivalent sites, as per documentation

Options:

file [character(len=*)]

subroutine  ed_aux_funx/read_denschimatrix([file])

This subroutine reads weights and poles of the impurity charge density susceptibility function by calling read_GFmatrix(). These are read from a file named "file"//str(ed_file_suffix)//.restart" taking into account the value of the global variable ed_file_suffix , which is "_ineq_Nineq" padded with 4 zeros in the case of inequivalent sites, as per documentation

Options:

file [character(len=*)]

subroutine  ed_aux_funx/read_pairchimatrix([file])

This subroutine reads weights and poles of the impurity pair susceptibility function by calling read_GFmatrix(). These are read from a file named "file"//str(ed_file_suffix)//.restart" taking into account the value of the global variable ed_file_suffix , which is "_ineq_Nineq" padded with 4 zeros in the case of inequivalent sites, as per documentation

Options:

file [character(len=*)]

subroutine  ed_aux_funx/read_exctchimatrix([file])

This subroutine reads weights and poles of the impurity exciton susceptibilities calling read_GFmatrix(). These are read from a file named "file"//str(ed_file_suffix)//.restart" taking into account the value of the global variable ed_file_suffix , which is "_ineq_Nineq" padded with 4 zeros in the case of inequivalent sites, as per documentation

Options:

file [character(len=*)]

subroutine  ed_aux_funx/ed_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).

The updated xmu is saved in search_variable_iteration"//reg(ed_file_suffix)//".ed

The converged xmu is saved in var_compressibility.restart

If a file var_compressibility.used is present, its value is read

Parameters:
  • var [real, inout] – the variable to be adjusted

  • ntmp [real, in] – the density value at the given iteration

  • converged [logical, inout] – whether the DMFT loop has achieved a sufficiently small error independently on the density

subroutine  ed_aux_funx/search_chemical_potential(var, ntmp, converged)

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

The updated xmu is saved in search_mu_iteration"//reg(ed_file_suffix)//".ed

The converged xmu is saved in xmu.restart

If a file var_compressibility.used is present, its value is read

NOTE: this function is accessible to the user as edipack2/ed_search_chemical_potential()

Parameters:
  • var [real, inout] – the chemical potential

  • ntmp [real, in] – the density value at the given iteration

  • converged [logical, inout] – whether the DMFT loop has achieved a sufficiently small error independently on the density