-
Notifications
You must be signed in to change notification settings - Fork 1
/
Hamiltonian.h
78 lines (69 loc) · 3.9 KB
/
Hamiltonian.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef HAMILTONIAN_H
#define HAMILTONIAN_H
#include "main.h"
struct effectiveHams // each site's effective block and bond Hamiltonians
{
int l, // site at the end of the block (i.e. block size - 1)
m; // number of states stored in block
rmMatrixX_t hS; // block Hamiltonian
std::vector<MatrixX_t> off0RhoBasisH2,
off1RhoBasisH2;
// density-matrix-basis coupling operators - "off" means the offset
// between this block, in which the operator is represented, and
// the site on which it acts
};
class TheBlock;
class Hamiltonian
{
public:
Hamiltonian();
void setParams(const std::vector<double>& couplingConstants, int lSys),
calcEffectiveH(const std::vector<double>& intSpins);
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
private:
int lSys; // current system length
std::vector<double> couplingConstants;
std::vector<MatrixD_t, Eigen::aligned_allocator<MatrixD_t>> siteBasisH2;
// site-basis coupling operators - the
// independent ones should be listed first
double h; // strength of externally applied magnetic field
std::vector<double> hFromIntSpins;
// effective field on chain spins induced
// by neighboring interstitial spins
rmMatrixX_t EDBASCoupling(int j,
const std::vector<MatrixX_t>& rhoBasisH2) const;
// exact-diagonalization stage block-adjacent-site coupling -
// j gives the (j-1)th coupling constant
MatrixD_t h1(int sitesFromWestEnd) const;
// returns the external magnetic field as a function of
// position, measured from the initially leftmost site
Eigen::Matrix<hamScalar, Eigen::Dynamic, 1>
act(const effectiveHams& blockParts,
const effectiveHams& compBlockParts, rmMatrixX_t x,
bool sweepingEast) const;
rmMatrixX_t sysBlockRSiteCoupling(const MatrixX_t& hSBond,
const MatrixD_t& hSiteBond,
const rmMatrixX_t& x, int mSIn,
int mEIn) const,
sysBlockLSiteCoupling(const MatrixX_t& hSBond,
const MatrixD_t& hSiteBond,
const rmMatrixX_t& cycledx, int mSIn,
int MEIn) const;
Eigen::Matrix<hamScalar, 1, Eigen::Dynamic>
freeSiteCouplingTerm(const MatrixD_t& lFreeSiteBond,
const MatrixD_t& rFreeSiteBond,
const rmMatrixX_t& RHS, int mEIn) const;
rmMatrixX_t envBlockLSiteCoupling(const MatrixX_t& hEBond,
const MatrixD_t& hSiteBond,
const rmMatrixX_t& cycledx, int mSIn,
int mEIn) const,
envBlockRSiteCoupling(const MatrixX_t& hEBond,
const MatrixD_t& hSiteBond,
const rmMatrixX_t& cycledx, int mSIn,
int MEIn) const,
projectedBASCouplings(TheBlock * block) const;
// specify the block-adjacent-free-site
// couplings to be projected into new basis
friend class TheBlock;
};
#endif