Algorithms

Perturbation theory

Hartree-Fock

class Hartree_Solver

Class which determines the Hartree-term of the self-energy of the asymmetric Anderson model self-consistently in units of glb_U, given the system parameters.

Public Functions

inline Hartree_Solver(const double Lambda_in, const fRG_config &config_in)

Constructor used for obtaining the self-consistent solution of the Hartree-term.

Parameters:
  • Lambda_in – Value of the regulator Λ.

  • config_in – Set of parameters.

inline Hartree_Solver(const double Lambda_in, const SelfEnergy<comp> &Sigma_in, const fRG_config &config_in, const bool diff = false)

Constructor used for a one-shot calculation of the Hartree-term of the asymmetric Anderson model with a given self-energy, e.g. in parquet iterations or in the 1l fRG flow equation.

Parameters:
  • Lambda_in – Value of the regulator Λ.

  • Sigma_in – Self-energy used inside the propagator to be used for the one-shot calculation.

  • config_in – Set of parameters.

  • diff – Boolean specifying whether the propagator to be integrated over is differentiated or not. By default == false. Useful for testing purposes.

double compute_Hartree_term_bracketing(double convergence_threshold = 1e-12, bool Friedel_check = true, bool verbose = true)

Compute the Hartree-term self-consistently using a simple bracketing algorithm.

Parameters:
  • convergence_threshold – Convergence criterion for the algorithm.

  • Friedel_check – If true, a check of the Friedel sum rule is performed after the computation. Only really meaningful at T=0.

  • verbose – If true, additional information is printed into the log file.

Returns:

Self-consistently determined value of the Hartree term.

double compute_Hartree_term_Friedel(double convergence_threshold = 1e-12)

Solve the Friedel sum rule, Σ = 1./2. - 1./π * atan((ε + Σ)/Δ), self-consistently. Useful for benchmarks and checks at T=0, where it is supposed to hold.

Parameters:

convergence_threshold – Accuracy of the bracketing algorithm used.

Returns:

Hartree-term as determined by the Friedel sum rule.

double compute_Hartree_term_oneshot()

Evaluate the Hartree term using a previously provided self-energy.

Returns:

Value of the Hartree term.

void friedel_sum_rule_check() const

Evaluate the rhs of the Friedel sum rule, Σ = 1./2. - 1./π * atan((ε + Σ)/Δ), which holds at T=0, with the precomputed Hartree-term and check for consistency.

Second-order perturbation theory (PT2)

template<typename Q>
void sopt_state(State<Q> &Psi, const bool diff = false)

Wrapper of sopt_state_impl, in case no Bubble object has been initialized yet.

Template Parameters:

Q – Type of the data.

Parameters:
  • PsiState that shall store the result.

  • diff – If true, a differentiated bubble is initialized. Incorrect for PT2, but useful for testing purposes.

template<typename Q, class Bubble_Object>
void sopt_state_impl(State<Q> &Psi, const Bubble_Object &Pi, const State<Q> &bareState)

Function which calculates a state in PT2. Called by sopt_state.

Template Parameters:
  • Q – Data type of the state, usually comp.

  • Bubble_Object – Type of the previously initialized bubble object.

Parameters:
  • PsiState that shall store the result.

  • Pi – Previously initialized bubble object.

  • bareState – Bare state used for the computation. Should include only the bare vertex and the initialized Hartree self-energy.

template<typename Q, class Bubble_Object>
void vertexInSOPT(Vertex<Q, false> &PsiVertex, const State<Q> &bareState, const Bubble_Object &Pi)

Compute the vertex in PT2. Consists of the sum of the PT2 diagrams of each channel.

Template Parameters:
  • Q – Data type.

  • Bubble_Object – Type of bubble object

Parameters:
  • PsiVertex – Vertex that shall store the result.

  • bareState – Bare state used for the computation. Should include only the bare vertex and the initialized Hartree self-energy.

  • Pi – Previously initialized bubble

template<typename Q, class Bubble_Object>
void selfEnergyInSOPT(SelfEnergy<Q> &PsiSelfEnergy, const State<Q> &bareState, const Bubble_Object &Pi)

Compute the self-energy in PT2 by calculating a bubble between bare vertices in the a-channel and closing the loop on top.

Template Parameters:
  • Q – Data type.

  • Bubble_Object – Type of bubble object.

Parameters:
  • PsiSelfEnergy – Self-energy that shall store the result.

  • bareState – Bare state used for the computation.

  • Pi – Previously initialized bubble object.

Parquet equations

void run_parquet(const fRG_config &config, const std::vector<double> &U_NRG_list, const int version, const bool overwrite_old_results)

Run the parquet solver for a list of interaction values.

Parameters:
  • config – Config struct which holds all necessary parameters

  • U_NRG_list – List of values for U/Δ for which to run a calculation.

  • version – Version of the implementation of the Schwinger-Dyson equation to be used. Recommendation: 1

  • overwrite_old_results – Determines whether existing results for the given parameters shall be overwritten or not.

template<typename Q>
bool parquet_solver(const std::string filename, State<Q> &state_in, const double Lambda, const int version, const double accuracy = 1e-6, const int Nmax = 50, const bool overwrite_old_results = true, const double mixing_ratio = 1.0, const bool use_last_state_anyway = false)

Iterate the parquet equations for a given input state until convergence.

Parameters:
  • filename – : File name for result.

  • state_in – : Input state used as initial input to the parquet equations (e.g. PT2).

  • Lambda – : Lambda value at which to iterate the parquet equations.

  • accuracy – : Desired relative accuracy used as convergence criterion for both vertex and self-energy (default: 1e-6)

  • Nmax – : Maximal number of parquet iterations, used as a break condition in case convergence cannot be reached (default: 50)

  • mixing_ratio – mixing ratio in [recommended: 0.1 - 0.5] for stabilizing the parquet iterations.

  • use_last_state_anyway – If true, the last state of a previous calculation for the same parameters is read in and returned, even if that calculation was not converged.

template<typename Q>
void parquet_iteration(State<Q> &state_out, const State<Q> &state_in, const double Lambda, const int it_Lambda, const int version)

One iteration of the parquet solver: Compute both the Bethe-Salpeter and the Schwinger-Dyson equation for given input.

Template Parameters:

Q – Type of the data.

Parameters:
  • state_out – Output of the parquet iteration, i.e. the LHS of the BSE and the SDE.

  • state_in – Input into the RHS of the BSE and the SDE.

  • Lambda – Λ value at which to compute the parquet equations.

  • it_Lambda – Number of the parquet iteration. Used, when intermediate results of the calculation are stored in hdf files.

  • version – Version of the implementation of the Schwinger-Dyson equation to be used. Recommendation: 1

template<typename Q>
void compute_BSE(Vertex<Q, false> &Gamma_BSE, Vertex<Q, false> &Gamma_BSE_L, Vertex<Q, false> &Gamma_BSE_R, const State<Q> &state_in, const double Lambda)

Insert the vertex of input state into the RHS of the (symmetrized) Bethe-Salpeter equation and compute the LHS.

Parameters:
  • Gamma_BSE – : Vertex computed as the lhs of the BSE.

  • Gamma_BSE_L – : Vertex computed as the lhs of the BSE, with Ir on the left and full Γ on the right.

  • Gamma_BSE_R – : Vertex computed as the lhs of the BSE, with Ir on the right and full Γ on the left.

  • state_in – : Input state which to input into the BSE.

  • Lambda – : Flow parameter Λ at which input state was computed.

template<typename Q>
void compute_SDE(SelfEnergy<Q> &Sigma_SDE, const State<Q> &state_in, const double Lambda, int version)

Evaluate the second term of the SDE,

      /----<----\
     /           \
    |  /->-|-----|
    \ /    |  Γ  |
--<--o--<--|-----|--<--
given an input state, at a given value of the flow parameter Λ.

Template Parameters:

Q – Type of the data.

Parameters:
  • Sigma_SDE – Self-energy to store the result of the computation.

  • state_in – Input state used to evaluate the RHS of the SDE.

  • Lambda – Value of the flow parameter Λ.

  • version – Version of the implementation of the SDE. Recommended: 1.

mfRG

State<state_datatype> n_loop_flow(const std::string &outputFileName, const fRG_config &config)

Compute an mfRG flow up to loop order n, as specified by the runtime-parameter n_loops. The flow is initialized with the parquet result at the initial value of the regulator Lambda_ini and from there solved with a fourth-order Runge-Kutta solver up to the final value Lambda_fin.

Parameters:
  • outputFileName – Name of the output file used to store the results of the mfRG flow computation.

  • config – fRGconfig struct used to hold all relevant parameters

Returns:

The final state of the flow at Lambda_fin.

State<state_datatype> n_loop_flow(const std::string &inputFileName, const fRG_config &config, unsigned int it_start)

Version of the mfRG flow used for checkpointing: Continue to compute an n-loop flow that has been canceled before, e.g. due to running into the wall time. For given iteration it_start, read the state at this iteration from previously computed results, then continue to compute the flow up to Lambda_fin.

Usage: Check the number <Nmax> of the last Lambda layer of a given file <inputFileName> that has been successfully computed. (See log file: “Successfully saved in hdf5 file: <inputFileName> in Lambda layer <Nmax>.) Use this number <Nmax> as input <it_start> for this function.

template<typename Y, typename FlowGrid = flowgrid::sqrt_parametrization, typename System>
void ode_solver(Y &result, const Y &state_ini, const System &rhs, const ODE_solver_config &config = ODE_solver_config(), const bool verbose = true)

ODE solver, by default implementing a fourth-order Runge-Kutta (Cash-Karp) algorithm. (Other options are possible but not recommended!)

Template Parameters:
  • Y – Type of the data to be handled by the solver. Can be double, comp, State, …

  • FlowGrid – Suggests a set of step sizes:

    • for non-adaptive rules, these are used directly –> lambdas_try

    • for adaptive rules, FlowGrid only approximately “guides” the step sizes; e.g. for FlowGrid::exp_parametrization we have Lambda(t) = exp(-t) such that equal step sizes in t lead to exponentially decaying step sizes. Adaptive rules can grow or shrink the step sizes in terms of t!

  • System

Parameters:
  • result – Final state.

  • state_ini – Initial state of type Y.

  • rhs – Callable instance of a class used to implement the RHS of the differential equation.

  • config – Config struct holding all relevant parameters for the ODE.

  • verbose – If true, additional information is printed into the log file. Recommendation: true.

template<typename Q>
auto rhs_n_loop_flow(const State<Q> &Psi, const double Lambda, const int nloops_max, const vec<size_t> opt, const fRG_config &config, mfRG_stats &stats) -> State<Q>

Function which implements the rhs of an n-loop flow.

Template Parameters:

Q – Type of the data

Parameters:
  • Psi – Known State at the flow parameter Λ, used to evaluate the RHS.

  • Lambda – flow parameter Λ.

  • nloops_max – maximal number of loops

  • opt – Options specifying the iteration number and the Runge-Kutta step of that specific iteration.

  • config – Set of parameters

  • stats – Struct to hold some statistics from the flow, such as the number of self-energy iterations required for convergence.

Returns:

A new state from the evaluation of the RHS of the flow equation.

template<typename Q>
void selfEnergyOneLoopFlow(SelfEnergy<Q> &dPsiSelfEnergy, const Vertex<Q, false> &PsiVertex, const Propagator<Q> &S)

Implements the rhs of the one-loop flow equation for the self-energy,

  |----|<-----|
  |           |
  |--|-----|--|
     |  Γ  |
--<--|-----|--<--

Template Parameters:

Q – Type of the data

Parameters:
  • dPsiSelfEnergy – Differentiated self-energy that results.

  • PsiVertex – Input vertex used.

  • S – Single-scale propagator used.

template<typename Q, class Bubble_Object>
void vertexOneLoopFlow(Vertex<Q, true> &dPsiVertex, const Vertex<Q, false> &Psi, const Bubble_Object &dPi, const fRG_config &config)

Implements the rhs of the one-loop flow equation for the vertex, adding up the results for each channel.

Template Parameters:
  • Q – Type of the data.

  • Bubble_Object – Type of the bubble object to be used.

Parameters:
  • dPsiVertex – Differentiated vertex that results.

  • PsiVertex – Input vertex used.

  • dPi – Differentiated bubble object.

  • config – Set of parameters.

template<typename Q, class Bubble_Object>
auto calculate_dGammaL(const GeneralVertex<Q, symmetric_r_irred, true> &dPsiVertex, const Vertex<Q, false> &PsiVertex, const Bubble_Object &Pi, const fRG_config &config) -> Vertex<Q, true>

Compute the first term of the higher-order flow equations, combining dgammaL_r = dgamma_rbar ◯ Pi_r ◯ Gamma, where dgamma_rbar only returns values of the r-irreducible sector.

Parameters as for vertexOneLoopFlow, except

Parameters:

PiBubble to connect the vertices on the rhs. Not differentiated!

template<typename Q, class Bubble_Object>
auto calculate_dGammaR(const GeneralVertex<Q, symmetric_r_irred, true> &dPsiVertex, const Vertex<Q, false> &PsiVertex, const Bubble_Object &Pi, const fRG_config &config) -> Vertex<Q, true>

Compute the final term of the higher-order flow equations, combining dgammaR_r = Gamma ◯ Pi_r ◯ dgamma_rbar, where dgamma_rbar only returns values of the r-irreducible sector.

Parameters as for calculate_dGammaL.

template<typename Q, class Bubble_Object>
auto calculate_dGammaC_right_insertion(const Vertex<Q, false> &PsiVertex, const GeneralVertex<Q, non_symmetric_diffleft, true> &nonsymVertex, const Bubble_Object &Pi, const fRG_config &config) -> Vertex<Q, true>

Calculate the central term of the higher-loop flow equations (starting at 3l), using the result form a previous computation using calculate_dGammaL, i.e. combining dgammaC_r = Gamma ◯ Pi_r ◯ dGammaL_r.

Parameters as for calculate_dGammaL, except

Parameters:

nonsymVertex – Non-symmetric vertex obtained from calculate_dGammaL before, ie.e dGammaL_r.

template<typename Q, class Bubble_Object>
auto calculate_dGammaC_left_insertion(const GeneralVertex<Q, non_symmetric_diffright, true> &nonsymVertex, const Vertex<Q, false> &PsiVertex, const Bubble_Object &Pi, const fRG_config &config) -> Vertex<Q, true>

Calculate the central term of the higher-loop flow equations (starting at 3l), using the result form a previous computation using calculate_dGammaR, i.e. combining dgammaC_r = dGammaR_r ◯ Pi_r ◯ Gamma.

Parameters as for calculate_dGammaC_right_insertion.

template<typename Q>
void selfEnergyFlowCorrections(SelfEnergy<Q> &dPsiSelfEnergy, const GeneralVertex<Q, symmetric_r_irred, true> &dGammaC_tbar, const State<Q> &Psi, const Propagator<Q> &G)

Compute the two terms of the multi-loop corrections to the self-energy:

  • dSigma_tbar = G * dGamma_tbar, where dGamma_tbar has to be irreducible in the t-channel

  • dSigma_t = (G dSigma_tbar G) * Gamma

Template Parameters:

Q – Type of the data

Parameters:
  • dPsiSelfEnergy – Differentiated self-energy that results from the multi-loop corrections to be computed.

  • dGammaC_tbar – Central term used for the first term of the correction.

  • PsiState to be used

  • GPropagator to be used.

template<typename Y, typename System>
void postRKstep_stuff(Y &y_run, System &rhs, double x_run, const vec<double> &x_vals, int iteration, const std::string &filename, const ODE_solver_config &config, bool verbose)

Implementation of things that can be done after a completed Runge-Kutta iteration of the ODE-solver, such as consistency checks, updates of frequency grids, output of intermediate results, …

Template Parameters:
  • Y – Type of the data handled by the ODE solver.

  • System – Type of the callable class that can return the RHS of the ODE.

Parameters:
  • y_run – Object to be computed by the ODE solver

  • rhs – Callable class that can return the RHS of the ODE.

  • x_run – Flowing variable defining the ODE.

  • x_vals – Values of the flowing variable.

  • iteration – Iteration number.

  • filename – Filename to be used for potential output.

  • config – Set of parameters for the ODE solver.

  • verbose – If true, additional information is printed into the log file.