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

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:

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 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] – 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 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]

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 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]

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]

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 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] – reset convergence