Template Class fdmSpectrum#

Class Documentation#

template<typename nrgcore_type>
class fdmSpectrum#

Calculates the spectral function using the FDM (Full Density Matrix) approach.

This class computes the spectral weights and reduced density matrices for a given NRG core object.

Template Parameters:

nrgcore_type – The type of the NRG core object.

Public Functions

inline explicit fdmSpectrum(nrgcore_type *t_nrg_object)#

Constructs the fdmSpectrum object.

Parameters:

t_nrg_object – Pointer to the NRG core object.

inline void setup(nrgcore_type *t_nrg_object)#

Sets up the FDM spectrum calculation.

Parameters:

t_nrg_object – Pointer to the NRG core object.

inline void calcSpectrum(double energyScale)#

Calculates the spectral function.

Parameters:

energyScale – The energy scale for rescaling.

inline void setReduceDensityMatrix()#

Sets the reduced density matrix.

This function calculates the reduced density matrix from the full density matrix rhoZero. It traces out the bath degrees of freedom to obtain the density matrix for the impurity part.

inline void setLocalPartitionFunction()#

Sets the local partition function and Boltzmann factors.

This function calculates the ground state energy and the partition function for the current shell. It then computes the Boltzmann factors which are used to initialize the density matrix at the last iteration.

inline void setRhoZero()#

Sets the initial density matrix rhoZero.

At the last iteration (T=0), the density matrix is initialized with the ground state projection. For other iterations, it is constructed using the reduced density matrix from the previous step.

inline void rhoDotOperators()#

Calculates the contribution to the spectral function.

This function calculates the spectral weights by computing traces of operator products with the density matrix. It computes both positive and negative frequency contributions.

inline void setTemperature(double at)#

Sets the temperature for the calculation.

Parameters:

at – The temperature value.

inline void setCurrentIndex()#

Sets the indices of the kept states for the current iteration.

inline void setOperator(std::vector<qOperator> *bopr, std::vector<qOperator> *aopr = nullptr)#

Sets the operators for the spectral function calculation.

Parameters:
  • bopr – Pointer to the vector of creation-like operators.

  • aopr – Pointer to the vector of annihilation-like operators (optional, if not provided, bopr is used for both).

template<typename filetype>
inline void saveFinalData(filetype *pfile)#

Saves the final spectral data to a file.

Template Parameters:

filetype – The type of the file object.

Parameters:

pfile – Pointer to the file object.

Public Members

std::vector<std::vector<double>> BoltzmannFactor#
std::vector<std::vector<size_t>> currentKeptIndex#
std::vector<qmatrix<>> rhoZero#
std::vector<qOperator> *aOperator = {}#
std::vector<qOperator> *bOperator = {}#
bool lastiteration = {true}#
double energyRescale = {1}#
double energyErrorBar = {1e-5}#