SyTen
syten::MPS::DMRG::Worker Struct Reference

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

#include <dmrg_worker.h>

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

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, SRDefenergy (Index const i)
 Return the energy estimate from the specific site. More...
 
void eval_observables (Index const i)
 Evaluate local observables, assuming overall left/right normalisation. More...
 
void expand_to_left ()
 Expands on the current site to the left. More...
 
void expand_to_right ()
 Expands on the current site to the right. More...
 
void finaliseStage ()
 Gives the worker the chance to print some information about the current, completed stage. More...
 
syten::Vec< Stategse_build_krylov_vectors (Timer &timer)
 Builds Krylov vectors for subspace expansion. More...
 
Tensor< 3 > gse_create_expanded (syten::Vec< State >const &ancillary_states, Index const site)
 Create expanded right-normalized tensor for GSE method. More...
 
void gse_enrich_state (Timer &timer)
 Performs global subspace expansion for GSE method. More...
 
void gse_shift_orth_center (State &state, Tensor< 3 >const &expanded, Index const site)
 Shifts orthogonality center for GSE method. More...
 
void initLog ()
 Helper to initialise our logfiles. 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 >
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) const
 Log some tracing information. More...
 
Workeroperator= (Worker &&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...
 
IterativeExit solveLocal ()
 Solve the local eigenvalue problem at the current position. More...
 
IterativeExit solveLocalTwoSite (Tensor< 4 > &contrPsi, std::vector< Tensor< 3 > > &orthoCmp)
 Solve the local eigenvalue problem at the current position using two site algorithm. 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 sweepLeft2sVar ()
 Sweeps to the left calculating the 2-site variance on each site. More...
 
void sweepLeftTwoSite ()
 Sweeps to the left through the chain, updating each site. More...
 
void sweepRight ()
 Sweeps to the right through the chain, updating and expanding each site. More...
 
void sweepRight2sVar ()
 Sweeps to the right calculating the 2-site variance on each site. More...
 
void sweepRightTwoSite ()
 Sweeps to the right through the chain, updating each site. More...
 
void sync (Tensor< 2 > &connector, Tensor< 3 > &rPsi, Tensor< 3 > const &rrPsi, std::vector< Tensor< 3 > > const &rContr, std::vector< Tensor< 3 > > &lContr, std::vector< Tensor< 2 > > const &rOrtho, std::vector< Tensor< 2 > > &lOrtho, SRDef &lastEnergy, SRDef &lastAlpha)
 Synchronises with the right neighbour. More...
 
 Worker ()=default
 Default ctor needed for serialisation. More...
 
 Worker (State &&psi_, std::vector< Operator > &&op_, DMRGConfig &&conf_, Tensor< 2 > &connector, Index const lbound_, const Index rbound_, std::vector< State > &&ortho_, std::vector< std::pair< Lattice, std::string > > &&exps_)
 Standard ctor, use to set up a DMRG worker. More...
 
 Worker (Worker &&other)
 Move ctor, steals cache files from source. More...
 

Public Attributes

DMRGConfig conf
 our configuration object, also used to record some state More...
 
std::vector< AsyncCached< std::vector< Tensor< 3 > > > > contrLeft
 Contractions of the Hamiltonians and the state to the left of the current site. More...
 
std::vector< AsyncCached< 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::vector< std::pair< Lattice, std::string > > exps
 Pairs of lattices and strings which denote local operators to calculate. More...
 
std::vector< std::ofstreamexpsLog
 output filestream for logs 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< Stateortho
 Reference to vector of states against which we should orthogonalise. More...
 
std::vector< AsyncCached< 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< AsyncCached< 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...
 
State 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 = 4
 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: