-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTheBlock.h
57 lines (50 loc) · 2.63 KB
/
TheBlock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef THEBLOCK_H
#define THEBLOCK_H
#include "Hamiltonian.h"
#define Id_d Matrix<double, d, d>::Identity() // one-site identity matrix
class FinalSuperblock;
struct stepData
{
Hamiltonian ham; // model Hamiltonian paramters
bool exactDiag; // close enough to edge to skip DMRG trucation?
TheBlock* compBlock; // complementary block on other side of system
bool infiniteStage;
double lancTolerance; // max deviation from 1 of dot product of successive
// Lanczos iterations' ground state vectors
int mMax; // max size of effective Hamiltonian
TheBlock* beforeCompBlock; // next smaller block than complementary one
};
class TheBlock
{
public:
effectiveHams blockParts; // stores effective Hamiltonians for this site
rmMatrixX_t primeToRhoBasis; // change-of-basis matrix
TheBlock() {};
TheBlock(const Hamiltonian& ham);
TheBlock(const effectiveHams& blockParts);
TheBlock nextBlock(const stepData& data, rmMatrixX_t& psiGround,
double& cumulativeTruncationError);
// performs each DMRG step
rmMatrixX_t projectNNCoupling(const rmMatrixX_t& blockOp,
const rmMatrixX_t& siteOp);
// projects term coupling system block to left-hand free site
FinalSuperblock createHSuperFinal(const stepData& data,
rmMatrixX_t& psiGround,
int lSys, int skips) const;
obsMatrixX_t obsProjectBlockOp(const obsMatrixX_t& sysOp),
// projects any block op except for (the one at the inner
// end IF there is an op at the adjacent free site)
#ifdef differentScalars
obsProjectNNCoupling(const obsMatrixX_t& blockOp,
const obsMatrixX_t& siteOp),
// identical to member function above except for return type
#endif
obsProjectFreeSiteOp(const obsMatrixD_t& lFreeSite);
// projects op at free site that isn't next to a block op
private:
double lanczos(const Hamiltonian& ham,
const effectiveHams& compBlockParts,
rmMatrixX_t& seed, double lancTolerance) const;
// changes input seed to ground eigenvector - make sure seed is normalized
};
#endif