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
ed_input_vars: User-accessible input variablesed_vars_global: Global variable accessible throughout the code
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 zerosreal: will be converted to stringcharacter[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 positionposto 0 in the bit representation of the integerin. Further it evaluates the corresponding fermionic signfsignas \(\sum_{i<pos}(-1)^{i}\). The obtained bitset identifies a new integerOut.- Parameters:
pos [integer, in] – Position to be set to
0in [integer, in] – Input index
out [integer, inout] – Output index
fsgn [real, inout] – Accrued sign
- Options:
ierr [logical] – Error flag: if present, the operator cannot be applied on the state, it is set to
.false.. Else, execution stops.
- 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 positionposto 1 in the bit representation of the integerin. Further it evaluates the corresponding fermionic signfsignas \(\sum_{i<pos}(-1)^{i}\). The obtained bitset identifies a new integerOut.- Parameters:
pos [integer, in] – Position to be set to
1in [integer, in] – Input index
out [integer, inout] – Output index
fsgn [real, inout] – Accrued sign
- Options:
ierr [logical] – Error flag: if present, the operator cannot be applied on the state, it is set to
.false.. Else, execution stops.
- function ed_aux_funx/bdecomp(i, ntot)
Binary decomposition of the integer
iwithntotbits. The input integers represents a Fock state \(|i-1\rangle\) with \(i=1,\dots,2^{2N_s}\). The resulting vectorivecdescribes 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 variableed_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 variableed_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 variableed_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 variableed_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 variableed_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 variableed_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
ntmpagainst the desired valuenread(if different from zero) and adjustsvaraccordingly (in a monotonous way).The updated
xmuis saved insearch_variable_iteration"//reg(ed_file_suffix)//".edThe converged
xmuis saved invar_compressibility.restartIf a file
var_compressibility.usedis 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
ntmpagainst the desired valuenread(if different from zero) and adjustsxmuaccordingly (in a monotonous way).The updated
xmuis saved insearch_mu_iteration"//reg(ed_file_suffix)//".edThe converged
xmuis saved inxmu.restartIf a file
var_compressibility.usedis present, its value is readNOTE: this function is accessible to the user as
edipack/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