Template Class NrgData#
Defined in File nrgData.hpp
Class Documentation#
-
template<typename nrgcore_type>
class NrgData# This class provides a way to save the
nrgcore
internal data from the NRG calculation into a HDF5 file. The data is saved in a file and can be read back into the NRG calculation. This is useful for back-ward iteration of the of the nrg-iterations. Everything needed for NRG iteration can accessed from this this file. This class also provides functionality to read and writeqOperator
.- Template Parameters:
nrgcore_type – Type of the
nrgcore
object.- Param tfilename:
File name of the HDF5 file to save the data. If this is empty, a random file name is generated starting with the name
tempfile
.
Public Functions
-
inline explicit NrgData(const std::string &tfilename = "")#
This sets the
nrg_object
tonullptr
and you need to specify thenrg_object
by calling thesetNRGObject
function.- Parameters:
tfilename – File name of the HDF5 file to save the data.
-
inline void readFromFile(const std::string &tfile)#
Read the data from the file
tfile
into thenrg_object
. This function is used to read the data back into thenrg_object
for back-ward iteration of the NRG calculation.
-
inline void setFileName(const std::string &tfile)#
Set the file name of the HDF5 file to save the data.
-
inline explicit NrgData(nrgcore_type *t_nrg_object, const std::string &tfilename = "")#
-
inline void setNRGObject(nrgcore_type *t_nrg_object)#
Set the
nrg_object
tot_nrg_object
.
-
inline void saveFinalState()#
We should call this function after the last iteration of the Wilson Chain.
-
inline void close()#
We should always call this function after the last iteration of the Wilson Chain to close file.
-
inline void clear()#
This \f \textbf{deletes} \f the temp file and closes the file.
-
inline void saveCurrentData()#
This saves data for the the current iteration state of the Wilson Chain.
-
inline void saveqOperator(std::vector<qOperator> *opr, const std::string &hgroup)#
Saves the
qOperator
in the file. This function is called after theqOperator
is constructed and rotated in the eigenbasis after each iteration.
-
inline void loadqOperator(std::vector<qOperator> *opr, const std::string &hgroup)#
Reads the
qOperator
from the file. This function is called in the back-ward iteration of the Wilson Chain.
-
inline void loadCurrentData()#
-
inline void loadCurrentData(int in)#
Loads the data from the file. This function is called in the back-ward iteration of the Wilson Chain.
- Parameters:
in – The current iteration number or the Wilson number. We normally pass the
nrg_object->nrg_iterations_cnt
to this function. We set the impurity to the iteration number to be -1.