Template Class nrgcore#
Defined in File nrgcore.hpp
Class Documentation#
-
template<typename im_type, typename bath_type>
class nrgcore# Solves the NRG problem for a bath and an impurity.
This class takes two template parameters for the impurity and bath models. It diagonalizes the Hamiltonian in the block basis of quantum numbers and performs iterative NRG calculations.
- Template Parameters:
im_type – Type of the impurity model.
bath_type – Type of the bath model.
Public Functions
-
inline nrgcore(im_type &im_hamilt, bath_type &bt_hamilt)#
Constructs the
nrgcore
object.Initializes the impurity and bath models and sets default parameters.
- Parameters:
im_hamilt – Reference to the impurity Hamiltonian.
bt_hamilt – Reference to the bath Hamiltonian.
-
inline void add_bath_site(const std::vector<double> &thopping, double rescale)#
Adds a bath site for the current iteration.
This function constructs the full Hamiltonian, diagonalizes it, and updates the internal state.
- Parameters:
thopping – Array of hopping parameters.
rescale – Rescaling factor for the energy.
-
inline void update_internal_state()#
Updates the internal state of the
nrgcore
object.This function discards higher energy states and updates the basis for the next iteration.
-
inline void test()#
Performs basic tests for the impurity and bath models.
Ensures that the quantum numbers and operator sizes are consistent between the impurity and bath models.
-
inline void create_next_hamiltonians(const std::vector<double> &t_hopping, double rescale)#
-
inline void create_next_basis()#
-
inline void discard_higher_energies()#
-
inline void set_parameters(size_t n = 1024)#
Set the maximum numbers of states to be kept states. The actual number of states is determined by adding few more degenarete states.
- Parameters:
n – maximum number of states to be kept
-
inline std::vector<std::vector<int>> get_basis_nQ()#
Get the current Basis vector.
- Returns:
std::vector<std::vector<int>>
-
inline std::vector<std::vector<double>> get_eigenvaluesQ()#
This function returns the eigenvalues of the Hamiltonian in the current basis.
- Returns:
std::vector<std::vector<double>>
-
inline auto get_f_dag_operator()#
Returns the \f f^{\dagger} \f operator in the current basis current wilson site. This
qOperator
is used to construct the Hamiltonian for the next iteration.- Returns:
std::vector<qOperator>
-
inline bool checkHigherEnergyDiscarded()#
Check whether any states are discarded in the current iteration.
- Returns:
bool
Public Members
-
std::vector<double> all_eigenvalue#
-
std::vector<double> relativeGroundStateEnergy#
-
std::vector<std::vector<size_t>> eigenvaluesQ_kept_indices#
-
std::vector<std::vector<int>> current_sysmQ#
-
std::vector<std::vector<int>> pre_sysmQ#
-
std::vector<std::vector<double>> eigenvaluesQ#
-
std::vector<std::vector<size_t>> coupled_nQ_index#
-
int nrg_iterations_cnt = {}#
-
int nrg_iterations_min = {}#
-
std::vector<std::vector<double>> bath_eigenvaluesQ#
-
std::vector<std::vector<int>> nq_bath#