-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathStackOperators.h
222 lines (196 loc) · 8.09 KB
/
StackOperators.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
#ifndef SPIN_STACKOPERATORS_HEADER
#define SPIN_STACKOPERATORS_HEADER
#include "StackBaseOperator.h"
#include <boost/function.hpp>
#include <boost/functional.hpp>
#include <boost/bind.hpp>
typedef boost::function<void (std::vector<boost::shared_ptr<SpinAdapted::StackSparseMatrix> >)> FUNCTOR;
typedef boost::function<void (boost::shared_ptr<SpinAdapted::StackSparseMatrix>)> FUNCTOR2;
typedef boost::function<void (boost::shared_ptr<SpinAdapted::StackSparseMatrix>, int)> FUNCTOR3;
namespace SpinAdapted{
class StackSpinBlock;
class StackCre: public SpinAdapted::StackSparseMatrix
{
public:
StackCre() { conj='n';fermion = true; build_pattern = "(C)";}
void build(const StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
virtual string opName() const {return "CRE";}
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackDes: public SpinAdapted::StackSparseMatrix
{
public:
StackDes() { conj='n'; fermion = true; build_pattern = "(D)";}
virtual string opName() const {return "DES";}
void build(const StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackCreDes: public SpinAdapted::StackSparseMatrix
{
public:
StackCreDes() { conj='n'; fermion = false; build_pattern = "(CD)";}
virtual string opName() const {return "CREDES";}
void build(const StackSpinBlock& block);
void buildUsingCre(const StackSpinBlock* b);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackDesCre: public SpinAdapted::StackSparseMatrix
{
public:
StackDesCre() { conj='n'; fermion = false; build_pattern = "(DC)";}
virtual string opName() const {return "DESCRE";}
void build(const StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackCreCre: public SpinAdapted::StackSparseMatrix
{
public:
StackCreCre() { conj='n'; fermion = false; build_pattern = "(CC)";}
virtual string opName() const {return "CRECRE";}
void build(const StackSpinBlock& block);
void buildUsingCre(const StackSpinBlock* b);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackDesDes: public SpinAdapted::StackSparseMatrix
{
public:
StackDesDes() { conj='n'; fermion = false; build_pattern = "(DD)";}
virtual string opName() const {return "DESDES";}
void build(const StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
//void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackCreDesComp: public SpinAdapted::StackSparseMatrix
{
public:
StackCreDesComp() { conj='n'; fermion = false;}
virtual string opName() const {return "CREDESCOMP";}
void build(const StackSpinBlock& block);
void buildfromCreDes(StackSpinBlock& block);
void buildUsingCre(const StackSpinBlock* b);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block);
};
class StackCreCreComp: public SpinAdapted::StackSparseMatrix
{
public:
StackCreCreComp() { conj='n'; fermion = false;}
virtual string opName() const {return "CRECRECOMP";}
void build(const StackSpinBlock& block);
void buildfromCreCre(StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
class StackDesDesComp: public SpinAdapted::StackSparseMatrix
{
public:
StackDesDesComp() { conj='n'; fermion = false;}
virtual string opName() const {return "DESDESCOMP";}
void build(const StackSpinBlock& block);
void buildfromDesDes(StackSpinBlock& block);
//void buildUsingCre(const StackSpinBlock* b);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackDesCreComp: public SpinAdapted::StackSparseMatrix
{
public:
StackDesCreComp() { conj='n'; fermion = false;}
virtual string opName() const {return "DESCRECOMP";}
void build(const StackSpinBlock& block);
void buildfromDesCre(StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
class StackCreDesDesComp: public SpinAdapted::StackSparseMatrix
{
public:
StackCreDesDesComp() { conj='n'; fermion = true;}
virtual string opName() const {return "CREDESDESCOMP";}
void build(const StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
class StackCreCreDesComp: public SpinAdapted::StackSparseMatrix
{
public:
StackCreCreDesComp() { conj='n'; fermion = true;}
virtual string opName() const {return "CRECREDESCOMP";}
void build(const StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackHam: public SpinAdapted::StackSparseMatrix
{
public:
StackHam() { conj='n'; fermion = false;}
virtual string opName() const {return "HAM";}
void build(const StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
class StackOverlap: public SpinAdapted::StackSparseMatrix
{
public:
StackOverlap() { conj='n'; fermion = false;}
void build(const StackSpinBlock& block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
virtual string opName() const {return "OVERLAP";}
void build(StackMatrix &m, int row, int col, const StackSpinBlock& block) ;
};
//CDD_sum is used in V_a subspace of nevpt2.
//It is the sum of perturber operator on one block.
class StackCDD_sum: public SpinAdapted::StackSparseMatrix
{
public:
StackCDD_sum() { fermion = true;}
void build(const StackSpinBlock& b) ;
boost::shared_ptr<StackSparseMatrix> getworkingrepresentation(const StackSpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
class StackCDD_CreDesComp: public SpinAdapted::StackSparseMatrix
{
public:
StackCDD_CreDesComp() { fermion = false;}
void build(const StackSpinBlock& b) ;
boost::shared_ptr<StackSparseMatrix> getworkingrepresentation(const StackSpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
class StackCDD_DesDesComp: public SpinAdapted::StackSparseMatrix
{
public:
StackCDD_DesDesComp() { fermion = false;}
void build(const StackSpinBlock& b) ;
boost::shared_ptr<StackSparseMatrix> getworkingrepresentation(const StackSpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
//CCD_sum is used in V_i subspace of nevpt2.
//It is the sum of perturber operator on one block.
class StackCCD_sum: public SpinAdapted::StackSparseMatrix
{
public:
StackCCD_sum() { fermion = true;}
void build(const StackSpinBlock& b) ;
boost::shared_ptr<StackSparseMatrix> getworkingrepresentation(const StackSpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
class StackCCD_CreDesComp: public SpinAdapted::StackSparseMatrix
{
public:
StackCCD_CreDesComp() { fermion = false;}
void build(const StackSpinBlock& b) ;
boost::shared_ptr<StackSparseMatrix> getworkingrepresentation(const StackSpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
class StackCCD_CreCreComp: public SpinAdapted::StackSparseMatrix
{
public:
StackCCD_CreCreComp() { fermion = false;}
void build(const StackSpinBlock& b) ;
boost::shared_ptr<StackSparseMatrix> getworkingrepresentation(const StackSpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const StackSpinBlock* b);
};
}
#endif