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:
ed_set_hloc()
,ed_set_suffix()
,scatter_vector_mpi()
,allgather_vector_mpi()
,ed_reset_suffix()
,c()
,cdg()
,bdecomp()
,ed_search_variable()
,search_chemical_potential()
Used modules
ed_input_vars
: Contains all global input variables which can be set by the user through the input file. A specific preocedureed_read_input()
should be called to read the input file usingparse_input_variable()
procedure from SciFortran. All variables are automatically set to a default, looked for and updated by reading into the file and, sequentially looked for and updated from command line (std.input) using the notation variable_name=variable_value(s) (case independent).ed_vars_global
: Contains all variables, arrays and derived types instances shared throughout the code. Specifically, it contains definitions of theeffective_bath
, thegfmatrix
and thesector
data structures.-
sf_spin
-
-
-
Subroutines and functions
- interface ed_aux_funx/ed_set_hloc(hloc, nlat)
This subroutine sets the local Hamiltonian of the impurity problem. The local hamiltonian can have different shapes:
[
nspin
.norb
,nspin
.norb
]: single-impurity case, rank-2 array[
nspin
,nspin
,norb
,norb
]: single-impurity case, rank-4 array[
nlat
.nspin
.norb
,nlat
.nspin
.norb
]: real-space DMFT case, rank-2 array.[
nlat
,nspin
.norb
,nspin
.norb
]: real-space RDMFT case, rank-3 array.[
nlat
,nspin
,nspin
,norb
,norb
]: real-space RDMFT case, rank-5 array.
In the case of real-space DMFT, the number of impurities
nlat
must be provided.- Parameters:
hloc (various shapes) [complex, in] – The local Hamiltonian array
nlat [integer] – Number of impurities for real-space DMFT
- 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] – size[N]
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] – size[N]
- 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)
Fermionic destruction operator, used in the construction of the sector Hamiltonian. The
c()
operator set the bit at positionpos
to 0 in the bit representation of the integerin
. Further it evaluates the corresponding fermionic signfsign
as \(\sum_{i<pos}(-1)^{i}\). The obtained bitset identifies a new integerOut
.- Parameters:
pos [integer, in]
in [integer, in]
out [integer, inout]
fsgn [real, inout]
- subroutine ed_aux_funx/cdg(pos, in, out, fsgn)
Fermionic creation operator, used in the construction of the sector Hamiltonian. The
cdg()
operator set the bit at positionpos
to 1 in the bit representation of the integerin
. Further it evaluates the corresponding fermionic signfsign
as \(\sum_{i<pos}(-1)^{i}\). The obtained bitset identifies a new integerOut
.- Parameters:
pos [integer, in]
in [integer, in]
out [integer, inout]
fsgn [real, inout]
- function ed_aux_funx/bdecomp(i, ntot)
Binary decomposition of the integer
i
withntot
bits. The input integers represents a Fock state \(|i-1\rangle\) with \(i=1,\dots,2^{2N_s}\). The resulting vectorivec
describes the state \(|n_1,n_2,\dots,n_{N_{tot}}\rangle\) with \(n_i=0,1\).- Parameters:
i [integer]
ntot [integer]
- Return:
ivec (ntot) [integer]
- subroutine ed_aux_funx/ed_search_variable(var, ntmp, converged)
This function checks the value of the read density
ntmp
against the desired valuenread
(if different from zero) and adjustsvar
accordingly (in a monotonous way).The updated
xmu
is saved insearch_variable_iteration"//reg(ed_file_suffix)//".ed
The converged
xmu
is saved invar_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 valuenread
(if different from zero) and adjustsxmu
accordingly (in a monotonous way).The updated
xmu
is saved insearch_mu_iteration"//reg(ed_file_suffix)//".ed
The converged
xmu
is saved inxmu.restart
If a file
var_compressibility.used
is present, its value is readNOTE: 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] – reset convergence