SyTen
syten::MPS::DMRG::LBOWorker Struct Reference

One worker in a MP-DMRG calculation. More...

#include <lbo_dmrg_worker.h>

+ Collaboration diagram for syten::MPS::DMRG::LBOWorker:

Public Member Functions

void adaptAlpha (SRDef const preTrunc, SRDef const postTrunc)
 Adapt the mixing factor alpha based on energy gain. More...
 
void calcContrLeft (Index const i)
 Calculate a new left-contraction on the specified site. More...
 
void calcContrRight (Index const i)
 Calculate a new right-contraction on the specified site. More...
 
void closeLog ()
 Helper to close our logfiles. More...
 
bool converged ()
 Return true if the conditions on convergence of the current stage are satisfied on this segment. More...
 
std::pair< SRDef, SRDefenergyM (Index const i, std::vector< Tensor< 4 > > const &trans_ops)
 Return the energy estimate from the specific site. More...
 
void initLog ()
 Helper to initialise our logfiles. More...
 
 LBOWorker ()=default
 Default ctor needed for serialisation. More...
 
 LBOWorker (LBOState &&psi_, std::vector< Operator > &&op_, DMRGConfig &&conf_, Tensor< 2 > &, Index const lbound_, const Index rbound_, std::vector< LBOState > &&ortho_)
 Standard ctor, use to set up a DMRG worker. More...
 
 LBOWorker (LBOWorker &&other)
 Move ctor, steals cache files from source. More...
 
template<class Archive >
void load (Archive &ar, const unsigned int in_version)
 Load a worker object from a boost archive. More...
 
template<typename Type1 , typename Type2 , typename Type3 , typename Type4 , typename Type5 >
void logIter (Type1 direction, Type2 stage, Type2 sweep, Type2 pos, Type5 type, 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) const
 Log some tracing information. More...
 
LBOWorkeroperator= (LBOWorker &&other)
 Move assignment operator, c.f. Worker(Worker&&) More...
 
void reportConvergence ()
 Gives output on the current convergence status when called. More...
 
template<class Archive >
void save (Archive &ar, const unsigned int v) const
 Overload to satisfy Boost. More...
 
template<class Archive >
void save (Archive &ar, const unsigned int)
 Save a worker object to a boost archive. More...
 
void setErrorTolerance (SRDef const err)
 Sets the error tolerance of the eigensolver according to the supplied truncation error of the last step. More...
 
void singleUpdate (Timer &timer)
 Updates a single site, measuring the time in timer. More...
 
IterativeExit solveLocalM (std::vector< Tensor< 4 > > &trans_ops)
 Solve the local eigenvalue problem at the current position on the MPS tensor. More...
 
IterativeExit solveLocalV ()
 Solve the local eigenvalue problem at the current position on the LBO matrix. More...
 
void sweep ()
 Do one sweep in the correct direction, initialise some data at beginning of sweep. More...
 
void sweepLeft ()
 Sweeps to the left through the chain, updating and expanding each site. More...
 
void sweepRight ()
 Sweeps to the right through the chain, updating and expanding each site. More...
 

Public Attributes

DMRGConfig conf
 our configuration object, also used to record some state More...
 
std::vector< Cached< std::vector< Tensor< 3 > > > > contrLeft
 Contractions of the Hamiltonians and the state to the left of the current site. More...
 
std::vector< Cached< std::vector< Tensor< 3 > > > > contrRight
 Contractions of the Hamiltonian and the state to the right of the current site. More...
 
SweepDirection dir
 current sweeping direction More...
 
std::ofstream iterLog
 output filestream for each iteration More...
 
Index lbound
 leftmost site to be updated by this worker More...
 
Index length
 the length of the full system, for convenience More...
 
std::vector< Operatorop
 the relevant operators, want to minimise \(\langle \psi | \hat \sum_i O_i | \psi \rangle / \langle \psi | \psi \rangle \) More...
 
std::vector< LBOStateortho
 Reference to vector of states against which we should orthogonalise. More...
 
std::vector< Cached< std::vector< Tensor< 2 > > > > orthoLeft
 Contraction of the vectors in ortho with the current state to the left of the current site. More...
 
std::vector< Cached< std::vector< Tensor< 2 > > > > orthoRight
 Contraction of the vectors in ortho with the current state to the right of the current site. More...
 
Index position
 the currently-active site in our system, 0-indexed; trailing site in multi-site DMRG; at edge when sweep completes. More...
 
LBOState psi
 the current state in our segment More...
 
Index rbound
 rightmost site to be updated by this worker More...
 
std::vector< Indexsite_positions
 Position of input sites, only changed when dynamical reordering is in use. More...
 
std::ofstream traceLog
 output filestream for the debug info More...
 

Static Public Attributes

static constexpr unsigned int version = 3
 Bump this if the data above changes. More...
 

Detailed Description

One worker in a MP-DMRG calculation.


The documentation for this struct was generated from the following files: