Template Class NrgData#
Defined in File nrgData.hpp
Class Documentation#
-
template<typename nrgcore_type>
class NrgData# Persist NRG iteration state and operators in an HDF5 file.
This class stores the snapshot of a Wilson-chain iteration needed for later backward iteration, including the current Hamiltonians, symmetry sectors, eigenvalues, kept indices, and any
qOperatorblocks. The data can be saved to disk, reloaded, and reused when reconstructing the chain state.- Template Parameters:
nrgcore_type – Type of the underlying NRG core object.
Public Functions
-
inline explicit NrgData(const std::string &tfilename = "")#
Construct a data container without attaching an NRG object yet.
The object may be associated with a concrete NRG core later using
setNRGObject.- Parameters:
tfilename – Optional path to the HDF5 file to be used for persistence. If empty, a temporary file name is generated automatically.
-
inline void readFromFile(const std::string &tfile)#
Read previously saved iteration data from disk into the active NRG object.
This is typically used during backward iteration to restore a stored shell state from the HDF5 archive.
- Parameters:
tfile – Path to the HDF5 file containing the saved data.
-
inline void setFileName(const std::string &tfile)#
Update the HDF5 file name used for persistence.
- Parameters:
tfile – New output file path.
-
inline explicit NrgData(nrgcore_type *t_nrg_object, const std::string &tfilename = "")#
Construct a data container bound to a specific NRG core object.
- Parameters:
t_nrg_object – Pointer to the active NRG model state.
tfilename – Optional HDF5 file path. If empty, a temporary file is created automatically.
-
inline void setNRGObject(nrgcore_type *t_nrg_object)#
Attach an NRG core instance to this data container.
- Parameters:
t_nrg_object – Pointer to the NRG object whose state will be stored and restored.
-
inline void saveFinalState()#
Save the final accumulated state metadata after the last iteration.
This stores the iteration index list and the final relative ground-state energy for later reconstruction steps.
-
inline void close()#
Close the HDF5 file associated with this object.
-
inline void clear()#
Delete the temporary HDF5 file and close the stream.
This removes the persistent snapshot associated with the current run.
-
inline void saveCurrentData()#
Save the full state of the current Wilson-chain iteration.
The function serializes the current shell Hamiltonians, symmetry sectors, eigenvalues, coupling metadata, and kept-state indices into the output HDF5 file under a unique iteration group.
-
inline void saveqOperator(std::vector<qOperator> *opr, const std::string &hgroup)#
Save a
qOperatorblock into the HDF5 archive.- Parameters:
opr – Pointer to the operator list to write.
hgroup – Name of the HDF5 group under which the operator data is stored.
-
inline void loadqOperator(std::vector<qOperator> *opr, const std::string &hgroup)#
Restore a
qOperatorblock from the HDF5 archive.- Parameters:
opr – Pointer to the operator list to populate.
hgroup – Name of the HDF5 group containing the saved operator data.
-
inline void loadCurrentData()#
Load the currently active iteration from the file.
This convenience wrapper calls
loadCurrentData(nrg_object->nrg_iterations_cnt).
-
inline void loadCurrentData(int in)#
Restore a saved shell state from the HDF5 archive.
- Parameters:
in – Iteration index to load from the stored data set.