Template Class fdmSpectrum#
Defined in File fdmSpectrum.hpp
Class Documentation#
-
template<typename nrgcore_type>
class fdmSpectrum# Computes FDM spectral weights from a full density matrix.
This helper accumulates the operator-weighted spectral contributions for each frequency bin and keeps track of the kept/discarded state structure needed to propagate the reduced density matrix across NRG iterations.
- Template Parameters:
nrgcore_type – Type of the underlying NRG core object.
Public Functions
-
inline explicit fdmSpectrum(nrgcore_type *t_nrg_object)#
Construct a spectral evaluator bound to an NRG core object.
- Parameters:
t_nrg_object – Pointer to the NRG core whose eigenstates and operators will be used to build the FDM spectral weights.
-
inline void setup(nrgcore_type *t_nrg_object)#
Store the NRG core pointer and initialize the iteration state.
- Parameters:
t_nrg_object – Pointer to the current NRG model object.
-
inline void calcSpectrum(double energyScale)#
Compute one spectral step for the current Wilson shell.
The routine updates the kept-state index set, initializes the density matrix, evaluates the operator contraction, and reduces the result to the impurity sector.
- Parameters:
energyScale – Rescaling factor applied to the energy grid.
-
inline void setReduceDensityMatrix()#
Build the reduced density matrix from the current full density matrix.
This traces out the bath degrees of freedom after rotating
rhoZerointo the current eigenbasis, leaving the reduced matrix for the impurity or kept subspace inreducedRho.
-
inline void setLocalPartitionFunction()#
Compute the local partition function and Boltzmann weights.
The routine identifies the ground-state energy for the current shell and assigns a unit weight to states within the degeneracy tolerance defined by
energyErrorBar.
-
inline void setRhoZero()#
Build the full density matrix for the current shell.
At the final iteration the density matrix is initialized from the local partition function; otherwise it is overwritten with the previously reduced density matrix on the kept states.
-
inline void rhoDotOperators()#
Accumulate the spectral weight contributions for the current shell.
The routine evaluates \(\rho B\) and \(B \rho\) contractions and accumulates the resulting positive and negative frequency contributions in the internal weight arrays.
-
inline void setTemperature(double at)#
Set the temperature used by the FDM evaluation.
- Parameters:
at – Temperature value in the same units as the NRG eigenvalues.
-
inline void setCurrentIndex()#
Update the current kept-state indices for the active shell.
-
inline void setOperator(std::vector<qOperator> *bopr, std::vector<qOperator> *aopr = nullptr)#
Register the creation and annihilation operators used in the spectral weight calculation.
- Parameters:
bopr – Pointer to the creation-like operator set.
aopr – Optional pointer to the annihilation-like operator set. If null, the same operator set is used for both directions.
- Throws:
std::invalid_argument – If the input operator pointer is null or the operator counts mismatch.
Public Members
-
std::vector<std::vector<double>> BoltzmannFactor#
Boltzmann weights for the states in the current shell.
-
std::vector<std::vector<size_t>> currentKeptIndex#
Kept-state indices used to reduce the density matrix on the current shell.
-
std::vector<qmatrix<>> rhoZero#
Full density matrix for the current shell in the current eigenbasis.
-
bool lastiteration = {true}#
True when processing the final shell of the current backward pass.
-
double energyRescale = {1}#
Energy rescaling applied when constructing the spectral grid.
-
double energyErrorBar = {1e-5}#
Numerical tolerance used to identify near-degenerate shell states.