Correlation Functions
This is the documentation of the classes that have been implemented to represent the correlation functions and related objects that are computed in all numerical calculations. Those are the different vertex classes and the class used to represent the self-energy, which are used together to represent the ‘’state’’ of a calculation. In addition, there are two helper classes, which don’t hold any additional non-trivial information, but which are used for convenience. First, there is a class to represent propagators, which combines the trivial non-interacting part determined by the physical system and the non-trivial self-energy. Second, there is another class that combines one pair of propagators in such a way that it is used to contract bubble-type diagrams.
Vertices
In total, the code contains the four classes irreducible, rvert, fullvert, and GeneralVertex to store different types of four-point vertices.
-
template<class Q>
class irreducible The irreducible part of the vertex. Working in the PA, it’s just a set of 16 numbers, one per Keldysh component, of which at least half are always zero.
- Template Parameters:
Q – Type of the data.
Public Functions
-
template<typename result_type = Q>
auto val(my_index_t iK, my_index_t i_in, my_index_t spin) const -> result_type Returns the value of the irreducible vertex. Just constants, if it is the bare vertex.
- Template Parameters:
result_type – Type of the result. Typically =Q.
- Parameters:
iK – Keldysh index.
i_in – Internal index. Always = 0 for the SIAM.
spin – Spin index.
- Returns:
Value of the irreducible vertex.
-
template<typename Q>
class rvert Reducible vertex in channel r, split into diagrammatic classes K1, K2, K2b, K3.
Member functions allow for access of values at arbitrary frequencies and in each channel-specific frequency representation.
- Template Parameters:
Q – Type of the data.
Public Functions
-
template<typename Func>
inline auto apply_unary_op_to_all_vertexBuffers(Func &&f) Applies unary operator f to this rvert
- Template Parameters:
Func – Type of f.
- Parameters:
f – f can be given via a lambda expression (for an example see arithmetic operations)
- Returns:
returns this.
-
template<typename Func>
inline auto apply_unary_op_to_all_vertexBuffers(Func &&f) const Applies unary operator f to this rvert (const member function)
- Template Parameters:
Func – Type of f.
- Parameters:
f – f can be given via a lambda expression (for an example see arithmetic operations)
- Returns:
returns this.
-
template<typename Func>
inline auto apply_binary_op_to_all_vertexBuffers(Func &&f, const rvert<Q> &other_rvert) Applies binary operator f to this rvert and to another rvertex
- Template Parameters:
Func – Type of f.
- Parameters:
f – f can be given via a lambda expression (for an example see arithmetic operations)
other_rvert – Other rvert.
- Returns:
returns this
-
inline rvert(const char channel_in, const double Lambda, const fRG_config &config, const bool is_reserve)
Constructor for the rvert class.
- Parameters:
channel_in – Channel index r.
Lambda – Value of the regulator Λ.
config – fRG_config struct, holding parameters.
is_reserve – If true, memory is allocated immediately. If false, the array is empty for the time being.
-
template<char ch_bubble>
auto value(VertexInput input, const rvert<Q> &rvert_crossing) const -> Q Return the value of the reducible vertex in channel r = sum of all K_classes K1, K2, K2b and K3. This version of value() is used for the symmetric_full vertex.
- Template Parameters:
ch_bubble – Channel index r.
- Parameters:
input – Combination of input arguments.
rvert_crossing – Reducible vertex in the related channel (t,p,a) for r=(a,p,t), needed to apply symmetry transformations that map between channels a <–> t.
- Returns:
K1 + K2 + K2b + K3 in channel r.
-
template<char ch_bubble>
auto value(const VertexInput &input, const rvert<Q> &rvert_crossing, const rvert<Q> &vertex_half2_samechannel, const rvert<Q> &vertex_half2_switchedchannel) const -> Q Overload for accessing non-symmetric_full vertices, with
- Parameters:
vertex_half2 – : vertex related to the calling vertex by symmetry, needed for transformations with asymmetry_transform=true Overload of the value function for accessing a non-symmetric_full vertex.
input – Combination of input arguments. See VertexInput.
rvert_crossing – Reducible vertex in the related channel (t,p,a) for r=(a,p,t), needed to apply symmetry transformations that map between channels a <–> t.
vertex_half2_samechannel – Vertex related to the calling vertex by symmetry in the same channel.
vertex_half2_switchedchannel – Vertex related to the calling vertex by symmetry in the other channel.
- Template Parameters:
ch_bubble – Channel index r.
- Returns:
K1 + K2 + K2b + K3 in channel r.
-
template<K_class k>
const rvert<Q> &symmetry_reduce(const VertexInput &input, IndicesSymmetryTransformations &indices, const rvert<Q> &rvert_this, const rvert<Q> &rvert_crossing) const Returns the symmetry reduced vertex component and the information where to read it out (in IndicesSymmetryTransformations
).
This version is used for a symmetric_full vertex.
- Template Parameters:
k – Asymptotic class.
- Parameters:
input – Combination of input arguments. See VertexInput.
indices – Properties of the vertex. See IndicesSymmetryTransformations.
rvert_this – This instance of rvert. Only used for debugging purposes is DEBUG_SYMMETRIES is defined.
rvert_crossing – Related vertex by crossing symmetry.
- Returns:
Symmetry reduced vertex.
-
template<K_class k>
const rvert<Q> &symmetry_reduce(const VertexInput &input, IndicesSymmetryTransformations &indices, const rvert<Q> &rvert_crossing, const rvert<Q> &vertex_half2_samechannel, const rvert<Q> &vertex_half2_switchedchannel) const Returns the symmetry reduced vertex component and the information where to read it out (in IndicesSymmetryTransformations
).
This version is used for an asymmetric vertex.
- Template Parameters:
k – Asymptotic class.
- Parameters:
input – Combination of input arguments. See VertexInput.
indices – Properties of the vertex. See IndicesSymmetryTransformations.
rvert_crossing – Related vertex by crossing symmetry.
vertex_half2_samechannel – Vertex related to the calling vertex by symmetry in the same channel.
vertex_half2_switchedchannel – Vertex related to the calling vertex by symmetry in the other channel.
- Returns:
Symmetry reduced vertex.
-
template<K_class k>
Q read_symmetryreduced_rvert(const IndicesSymmetryTransformations &indices, const rvert<Q> &readMe) const Reads out a symmetry reduced vertex component. Hence symmetry_reduce must be called before!
- Template Parameters:
k – K_class
- Parameters:
indices – contains information for reading out the symmetry reduced vertex component
readMe – vertex to be read
- Returns:
Value of the symmetry reduced vertex component.
-
template<K_class k>
auto valsmooth(const VertexInput &input, const rvert<Q> &rvert_crossing) const -> Q Return the value of the asymptotic class k of the vertex in channel r.
Return the value of the vertex Ki in channel r.
- Template Parameters:
k – Asymptotic class
- Parameters:
input – Combination of input arguments. See VertexInput.
rvert_crossing – Reducible vertex in the related channel (t,p,a) for r=(a,p,t), needed to apply symmetry transformations that map between channels a <–> t.
input – : Combination of input arguments.
rvert_crossing – : Reducible vertex in the related channel (t,p,a) for r=(a,p,t), needed to apply symmetry transformations that map between channels a <–> t.
- Returns:
Value of type Q.
-
template<K_class k>
auto valsmooth(const VertexInput &input, const rvert<Q> &rvert_crossing, const rvert<Q> &vertex_half2_samechannel, const rvert<Q> &vertex_half2_switchedchannel) const -> Q Overload of value for accessing non-symmetric_full vertices with
Return the value of the vertex Ki in channel r.
- Parameters:
vertex_half2_samechannel – Vertex related to the calling vertex by symmetry in the same channel.
vertex_half2_switchedchannel – Vertex related to the calling vertex by symmetry in the other channel.
input – : Combination of input arguments.
rvert_crossing – : Reducible vertex in the related channel (t,p,a) for r=(a,p,t), needed to apply symmetry transformations that map between channels a <–> t.
vertex_half2 – : vertex related to the calling vertex by symmetry, needed for transformations with asymmetry_transform=true
-
template<char ch_bubble>
void transfToR(VertexInput &input) const Transform the frequencies from the frequency convention of input.channel to the frequency convention of this->channel. Necessary when accessing the r vertex from a different channel r’.
- Template Parameters:
ch_bubble – Channel index r’
- Parameters:
input – Input related to the starting channel r.
-
template<K_class k, typename FGrid>
void update_grid(const FGrid &frequencyGrid_in, rvert<Q> &rvert4data) Interpolate the vertex to updated grid.
- Template Parameters:
k – Asymptotic class.
- Parameters:
frequencyGrid_in – new frequency grid
rvert4data – vertex to be interpolated can be different from *this, so we can backup a vertex and interpolate the backup
-
void check_symmetries(std::string identifier, const rvert<Q> &rvert_this, const rvert<Q> &rvert_crossing) const
This function is defined if the flag DEBUG_SYMMETRIES is defined. It iterates over all vertex entries and checks whether symmetry relations are fulfilled. Deviations from the symmetry relation are stored in a file.
Iterates over all vertex components and compares with the value obtained from application of the symmetry relations
- Parameters:
identifier – string to distinguish the filename of the stored
spin – spin component (currently 0 or 1)
rvert_this – rvert of the related vertex with spin 0 (contains symmetry reduced sector of vertex)
rvert_crossing – rvert that is related to rvert_this via crossing symmetry
- Template Parameters:
Q –
-
template<char channel_bubble, bool is_left_vertex>
void symmetry_expand(const rvert<Q> &rvert_this, const rvert<Q> &rvert_crossing, const rvert<Q> &vertex_half2_samechannel, const rvert<Q> &vertex_half2_switchedchannel, int spin) const Iterates over all vertex components and fills in the value obtained from the symmetry-reduced sector
- Template Parameters:
Q –
-
template<class Q>
class fullvert The class fullvert defines a vertex in a full channel decomposition, i.e., it includes an irreducible (bare) contribution and a, p and t channel reducible contributions.
In the standard configuration (only_same_channel=false and Ir=false), the fullvert is the full vertex Γ with all components. For Ir=true, it is an r-irreducible vertex I_r; for only_same_channel=true, it only contains the r-reducible component.
- Template Parameters:
Q – Type of the data.
Public Functions
-
inline explicit fullvert(const double Lambda)
Constructor at regulator Λ with the standard configuration.
- Parameters:
Lambda – Value of the regulator.
-
inline explicit fullvert(const double Lambda, const fRG_config &config)
Constructor at regulator Λ with a given configuration.
- Parameters:
Lambda – Value of the regulator.
config – Set of parameters.
-
template<char ch_bubble, bool r_irred>
auto value(const VertexInput &input) const -> Q Gives access to the data.
- Template Parameters:
ch_bubble – Channel index r used for the parametrization.
r_irred – Determines whether the vertex is irreducible in channel r.
- Parameters:
input – VertexInput struct for the set of arguments.
- Returns:
Value of the full vertex
-
template<char ch_bubble, bool r_irred>
auto left_same_bare(const VertexInput &input) const -> Q Combination of those diagrams that connect to the same bare vertex on the left side: Gamma0, K1, K2b
- Template Parameters:
ch_bubble – Channel index r used for the parametrization.
r_irred – Determines whether the vertex is irreducible in channel r.
- Parameters:
input – VertexInput struct for the set of arguments.
- Returns:
Value of Gamma0 + K1 + K2b.
-
template<char ch_bubble, bool r_irred>
auto right_same_bare(const VertexInput &input) const -> Q Combination of those diagrams that connect to the same bare vertex on the right side: Gamma0, K1, K2
- Template Parameters:
ch_bubble – Channel index r used for the parametrization.
r_irred – Determines whether the vertex is irreducible in channel r.
- Parameters:
input – VertexInput struct for the set of arguments.
- Returns:
Value of Gamma0 + K1 + K2
-
template<char ch_bubble, bool r_irred, bool only_channel_r>
auto left_diff_bare(const VertexInput &input) const -> Q Combination of those diagrams that connect to the different bare vertices on the left side: K2, K3, gamma_bar{r}
- Template Parameters:
ch_bubble – Channel index r used for the parametrization.
r_irred – Determines whether the vertex is irreducible in channel r.
only_channel_r – If true, only the r-reducible part K2 + K3 is given.
- Parameters:
input – VertexInput struct for the set of arguments.
- Returns:
Value of K2 + K3 + gamma_bar{r}
-
template<char ch_bubble, bool r_irred, bool only_channel_r>
auto right_diff_bare(const VertexInput &input) const -> Q Combination of those diagrams that connect to the different bare vertices on the right side: K2b, K3, gamma_bar{r}
- Template Parameters:
ch_bubble – Channel index r used for the parametrization.
r_irred – Determines whether the vertex is irreducible in channel r.
only_channel_r – If true, only the r-reducible part K2b + K3 is given.
- Parameters:
input – VertexInput struct for the set of arguments.
- Returns:
Value of K2b + K3 + gamma_bar{r}
-
template<typename Q, vertexType symmtype, bool differentiated>
class GeneralVertex symmetric_full and symmetric_r_irred vertex container class (contains only half 1, since half 1 and 2 are related by symmetry) non_symmetric contains the actual vertex in “vertex” and the left-right-symmetry-related one in “vertex_half2” (the latter is needed for reading from the symmetry-reduced sector)
Public Members
-
mutable std::vector<fullvert<Q>> vertices_bubbleintegrand
Buffer for vectorized computation of an r-bubble Each entry contains exactly one spin component; all Keldysh components are present, they are ordered by GeneralVertex::symmetry_expand() such that they allow vectorized operations for the computation in channel r
-
mutable std::vector<fullvert<Q>> vertices_bubbleintegrand
Self-Energy
-
template<typename Q>
class SelfEnergy Class used for the 2-point self-energy Σ.
- Template Parameters:
Q – Type of the data.
Public Functions
-
inline explicit SelfEnergy(double Lambda, const fRG_config &config)
Constructor for a given regulator Λ and a set of parameters. The frequency grid is set accordingly.
- Parameters:
Lambda – Value of the regulator Λ.
config – Set of parameters.
-
inline explicit SelfEnergy(const freqGrid_type &frequencies_in)
Constructor for a given frequency grid.
- Parameters:
frequencies_in – Frequency grid.
-
void initialize(Q valR, Q valK)
Function initializes the Retarded and Keldysh components of the self-energy
- Template Parameters:
Q – : Type of values (usually comp)
- Parameters:
valR – : Value for the constant Retarded self-energy
valK – : Value for the constant Keldysh self-energy
-
auto val(int iK, int iv, int i_in) const -> Q
Returns the saved value of the self-energy
- Template Parameters:
Q – : Type of values (usually comp)
- Parameters:
iK – : Keldysh index (either 0 or 1)
iv – : Frequency index
i_in – : Internal structure index
- Returns:
The value of SigmaR/K at the chosen indices
-
auto valsmooth(int iK, double v, int i_in) const -> Q
Linear interpolating function returning the value of the Retarded or Keldysh self-energy at freq v
- Template Parameters:
Q – : Type of values (usually comp)
- Parameters:
iK – : Keldysh index (either 0 or 1)
v – : Frequency
i_in – : Internal index
- Returns:
: Interpolated value using the saved values as basis
-
void setself(int iK, int iv, int i_in, Q val)
Sets the value of the self-energy to a specific value at the specified location
- Template Parameters:
Q – : Type of values (usually comp)
- Parameters:
iK – : Keldysh index (either 0 or 1)
iv – : Frequency index
i_in – : Internal index
val – : Value of the self-energy at this given point
-
void addself(int iK, int iv, int i_in, Q val)
Adds the given value at the specified location
- Template Parameters:
Q – : Type of values (usually comp)
- Parameters:
iK – : Keldysh index (either 0 or 1)
iv – : Frequency index
i_in – : Internal index
val – : Value of the self-energy at this given point
State
Instances of the State class are the high-level objects that are mainly used by the high-level algorithms
discussed in Algorithms. The State class combines a GeneralVertex and a SelfEnergy,
which together contain all non-trivial information that one might wish to compute.
-
template<typename Q, bool differentiated = false>
class State Define a struct object which includes the self-energy and the vertex which are needed to evaluate the RHS of the flow equations. Class used for the state Ψ = (Σ, Γ).
Define essential data types: comp : complex number (complex<double>) glb_i : imaginary unit vec : vector class with additional functionality such as element-wise operations, real/imag part etc.
VertexInput : auxiliary struct that contains all input variables of verticesFunctions to write/read a State object to/from an HDF5 file.
- Template Parameters:
Q – Type of the data.
differentiated – Determines whether the state is differentiated.
Public Functions
-
inline explicit State(double Lambda, const fRG_config &config_in, bool initialize = false)
Constructor which generates a state with frequency grids corresponding to the given value of Lambda.
- Parameters:
Lambda – Value of the regulator Λ.
config_in – Set of parameters.
initialize – Determines whether the state has to be initialized or not.
-
inline State(const State<Q, false> &state_in, const double Lambda_in)
Constructor which takes a State whose frequency grid will be copied. The State itself won’t be copied!
- Parameters:
state_in – Input State.
Lambda_in – Value of the regulator Λ.
-
inline State(const Vertex<Q, differentiated> &vertex_in, const SelfEnergy<Q> &selfenergy_in, const fRG_config &config_in, const double Lambda_in)
Constructor which takes a single vertex and a single self-energy and puts them together into a new state. Needed for the parquet checks.
- Parameters:
vertex_in – Input vertex.
selfenergy_in – Input self-energy.
config_in – Set of parameters.
Lambda_in – Value of the regulator Λ.
-
void initialize(bool checks = true)
Initializes a state by setting the asymptotic value of the self-energy and the bare interaction appropriately.
- Parameters:
checks – If true, a check of the Friedel sum rule of the Hartree term of the self-energy of the asymmetric SIAM is done. See the Hartree_Solver class.
Propagator
The Propagator class is special in the sense that it stores almost no data itself. Instead, it references
instances of the SelfEnergy class, which hold the non-trivial data from the computations. The Propagator
class is then used to combine the analytical form of the bare propagator \(G_0\) with the self-energy via the
Dyson equation, \(G = 1 / [(G_0)^{-1} - \Sigma]\).
-
template<typename Q>
class Propagator Propagator class used for G, S, and the Katanin extension.
- Template Parameters:
Q – Type of the data.
Public Functions
-
inline Propagator(double Lambda_in, char type_in, const fRG_config &config)
Free Propagator object. SelfEnergy and differentiated SelfEnergy are zero.
- Parameters:
Lambda_in – Value of the regulator Λ.
type_in – Type of the propagator:
‘g’ for a normal propagator
’s’ for a single-scale propagator
’e’ for the Katanin extension
’k’ for a fully differentiated propagator ‘s’ + ‘e’.
config – Set of parameters.
-
inline Propagator(double Lambda_in, const SelfEnergy<Q> &self_in, char type_in, const fRG_config &config)
Dressed propagator for non-flowing calculations, i,e, no differential SelfEnergy is needed and is set to the undifferentiated self-energy.
- Parameters:
Lambda_in – Value of the regulator Λ.
self_in – Input SelfEnergy.
type_in – Type of the propagator: ‘g’, ‘s’, ‘e’ or ‘k’
config – Set of parameters.
-
inline Propagator(double Lambda_in, const SelfEnergy<Q> &self_in, const SelfEnergy<Q> &diffSelf_in, char type_in, const fRG_config &config)
Dressed propagator for flows. Needs both a SelfEnergy and a Differential SelfEnergy
- Parameters:
Lambda_in – Value of the regulator Λ.
self_in – Input SelfEnergy.
diffSelf_in – Input differentiated SelfEnergy.
type_in – Type of the propagator: ‘g’, ‘s’, ‘e’ or ‘k’
config – Set of parameters.
-
auto valsmooth(int iK, freqType v, int i_in) const -> Q
Function to smoothly interpolate the propagator on the frequency grid of the underlying self-energy.
- Parameters:
iK – Keldysh index
v – fermionic frequency
i_in – internal structure index
- Returns:
Value of the propagator at the given input.
-
template<typename return_type>
auto valsmooth_vectorized(freqType v, int i_in) const -> return_type Version of the valsmooth function when vectorization over Keldysh indices is used
- Template Parameters:
return_type – Type of the result.
- Parameters:
v – fermionic frequency
i_in – internal structure index
- Returns:
Value of the propagator at the given input.
-
auto GR(double v, int i_in) const -> Q
Retarded component of the propagator.
- Parameters:
v – fermionic frequency
i_in – internal structure index
- Returns:
Value of the retarded component at the given input.
-
Q Katanin_R(double v, int i_in) const
Retarded component of the Katanin extension G^R \dot{Σ}^R G^R.
-
Q Katanin_K(double v, int i_in) const
Keldysh component of the Katanin extension G^R \dot{Σ}^R G^K + G^R \dot{Σ}^K G^A + G^K \dot{Σ}^A G^A.
Bubble
Lastly, the Bubble class combines two propagators to yield a bubble in one of the three two-particle channels
\(a\), \(p\) and \(t\).
For evaluating differentiated bubbles in the context of mfRG computations, one of the
propagators can be chosen to be the single-scale propagator \(S\) or the fully differentiated one \(\dot{G}\).
In that case, the bubble already takes care of the product rule, giving (symbolically)
\(\dot{\Pi}^S = G\cdot S + S \cdot G\) or \(\dot{\Pi} = G\cdot\dot{G} + \dot{G}\cdot G\).
Otherwise, it just yields \(\Pi = G\cdot G\).
-
template<typename Q>
class Bubble Class combining two propagators, either GG or GS+SG
- Template Parameters:
Q – Type of the data.
Public Functions
-
inline Bubble(const Propagator<Q> &propagatorG, const Propagator<Q> &propagatorS, const bool diff_in)
Constructor:
- Parameters:
propagatorG – : first propagator (always a standard one)
propagatorS – : second propagator (standard or single-scale/differentiated, depending on “diff_in”)
diff_in – : whether to compute standard (false) or differentiated (true) bubble
-
inline auto value(int iK, freqType v1, freqType v2, int i_in) const -> Q
Call operator:
- Parameters:
iK – : Keldysh index of combined bubble object (0 <= iK <= 15)
v1 – : frequency of first propagator
v2 – : frequency of second propagator
i_in – : internal structure index
- Returns:
: value of the bubble evaluated at (iK, v1, v2)
-
template<char ch_bubble>
inline Q value_Matsubara(const freqType w, const freqType vpp, int i_in) const Call operator in the Matsubara formalism:
- Template Parameters:
ch_bubble – channel index
- Parameters:
w – bosonic frequency ω of the corresponding channel
vpp – fermionic bubble integration frequency ν’’ of the corresponding channel
i_in – internal structure index
- Returns:
value of the bubble evaluated at (ω, ν’’).
-
inline auto value(int iK, freqType w, freqType vpp, int i_in, char channel) const -> Q
Wrapper for value function above, providing the natural arguments for evaluation of the bubble in each channel:
- Parameters:
iK – : Keldysh index of combined bubble object (0 <= iK <= 15)
w – : bubble transfer frequency of the corresponding channel
vpp – : bubble integration frequency of the corresponding channel
i_in – : internal structure index
channel – : channel to which the bubble belongs
- Returns:
Q : value of the bubble evaluated at the arguments described above (usually comp)
-
template<char ch_bubble>
inline auto value_vectorized(const freqType w, const freqType vpp, const int i_in) const Version of the value function used if vectorization over Keldysh indices is to be used.