One run of BTT-DMRG. More...
#include <dmrg.h>
Public Types | |
typedef BinaryTree::Tree< Cached< Tensor< 3 > > > | Ctrs |
Data type used to store contractions of the Hamiltonian with the state. More... | |
Public Member Functions | |
void | adaptAlpha (SRDef preTrunc, SRDef postTrunc) |
Adapt the mixing factor alpha based on energy gain. More... | |
bool | converged () |
Returns true if the current stage is complete. More... | |
void | saveState () |
Saves the currently-stored state. More... | |
Default ctors and assignment operators | |
Run ()=default | |
Default ctor needed for Boost serialisation. More... | |
Run & | operator= (Run &&other) |
Move assignment operator. More... | |
Run & | operator= (Run const &)=delete |
Delete copy assignment operator. More... | |
Run (Run const &)=delete | |
Delete copy ctor. More... | |
Run (Run &&other) | |
Delete move ctor. More... | |
Logging infrastructure | |
void | initLog () |
Helper to initialise our logfiles. More... | |
void | closeLog () |
Helper to close our logfiles. More... | |
template<typename Type1 , typename Type2 , typename Type3 , typename Type4 > | |
void | logIter (Type1 direction, Type2 stage, Type2 sweep, Type2 pos, Type3 esEnergy, Type2 esIter, Type3 esResidual, Type3 energy, Type3 truncation, Type3 alpha, Type2 n, Type2 s, Type2 r, Type2 t, Type2 b, Type4 esReason) |
Log the data for a single iteration, potentially to both std::cout and the iteration logfile. More... | |
template<typename... Args> | |
void | logTrace (int level, Args &&... data) |
Log some tracing information. More... | |
Primary external interface: Construction and running | |
Run (State &&psi_, Operator &&op_, DMRGConfig &&conf_) | |
Standard ctor, constructs and initialises DMRG calculation. More... | |
void | run () |
template<typename TypePtr , typename TypeVal > | |
void | setConfig (TypePtr ptr, TypeVal value) |
Use to set configuration for all workers. More... | |
void | initArg (int argc_, char **argv_) |
Use to set command line argument variables. More... | |
Internal functions to organise sweeping, updating and saving | |
void | sweep () |
do one sweep over the whole system. More... | |
void | update_rec (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr, Index &count, Timer &timer) |
Updates a subtree recursively. More... | |
void | update (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr, BinaryTree::NodeType const dir, Index &count, Timer &timer) |
IterativeExit | solve (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr) |
void | expand (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr, BinaryTree::NodeType const dir) |
SRDef | normalise (State::Ptr pptr, BinaryTree::NodeType const dir) |
Normalises the state on node pptr in direction dir . More... | |
void | contract (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr, BinaryTree::NodeType const dir) |
Forwarder to build the contraction on node cptr from the neighbours of cptr , pptr and optr in direction dir . More... | |
SRDef | energy (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr) |
Calculates the energy on the specified node, assuming that all neighbouring contractions exist and point in the correct direction. More... | |
SRDef | energy (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr, BinaryTree::NodeType const dir) |
Forwarder to calculate the energy on the neighbouring node of that pointed to be the arguments in the given direction. More... | |
Contraction of operator and state | |
void | build_actr (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr) |
void | build_bctr (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr) |
void | build_rctr (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr) |
Build a local root-pointing contraction of the operator with the state (based on) the nodes given as arguments. More... | |
void | build_rctr_rec (Operator::Ptr optr, State::Ptr pptr, Ctrs::Ptr cptr) |
Recursively build an entire tree of root-pointing contractions. More... | |
Boost serialisation | |
template<typename Archive > | |
void | save_node (Archive &ar, Ctrs::Ptr ptr, const unsigned int in_version) |
Boost serialisation helper for the contractions network. More... | |
template<typename Archive > | |
void | load_node (Archive &ar, Ctrs::Ptr ptr, const unsigned int in_version) |
Boost deserialisation helper for the contractions network. More... | |
template<class Archive > | |
void | save (Archive &ar, const unsigned int in_version) |
Save a worker object to a boost archive. More... | |
template<class Archive > | |
void | save (Archive &ar, const unsigned int in_version) const |
Overload to satisfy Boost. More... | |
template<class Archive > | |
void | load (Archive &ar, const unsigned int in_version) |
Load a worker object from a boost archive. More... | |
Public Attributes | |
int | argc |
command line argument storage More... | |
char ** | argv |
command line argument storage More... | |
DMRGConfig | conf |
our configuration object More... | |
Ctrs | ctr |
contractions of op and psi More... | |
std::ofstream | iterLog |
output filestream for each iteration More... | |
Index | numWorkers |
number of DMRG workers More... | |
Ctrs::Ptr | obj_cptr |
pointer to the current node in ctr More... | |
Operator::Ptr | obj_optr |
pointer to the current node in op More... | |
State::Ptr | obj_pptr |
pointer to the current node in pptr More... | |
Operator | op |
operator of which to calculate the ground state More... | |
State | psi |
our current best guess for the ground state of op More... | |
std::ofstream | traceLog |
output filestream for the debug info More... | |
One run of BTT-DMRG.