-
Notifications
You must be signed in to change notification settings - Fork 33
/
Operators.h
208 lines (175 loc) · 6.62 KB
/
Operators.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
#ifndef SPIN_OPERATORS_HEADER
#define SPIN_OPERATORS_HEADER
#include "BaseOperator.h"
#include <boost/function.hpp>
#include <boost/functional.hpp>
typedef boost::function<void (std::vector<boost::shared_ptr<SpinAdapted::SparseMatrix> >&)> Functor;
namespace SpinAdapted{
class Cre: public SpinAdapted::SparseMatrix
{
public:
Cre() { orbs.resize(1); fermion = true; build_pattern = "(C)"; }
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class Des: public SpinAdapted::SparseMatrix
{
public:
Des() { orbs.resize(1); fermion = true; build_pattern = "(D)"; }
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CreDes: public SpinAdapted::SparseMatrix
{
public:
CreDes() { orbs.resize(2); fermion = false; build_pattern = "(CD)"; }
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class DesCre: public SpinAdapted::SparseMatrix
{
public:
DesCre() { orbs.resize(2); fermion = false; build_pattern = "(DC)"; }
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CreCre: public SpinAdapted::SparseMatrix
{
public:
CreCre() { orbs.resize(2); fermion = false; build_pattern = "(CC)"; }
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class DesDes: public SpinAdapted::SparseMatrix
{
public:
DesDes() { orbs.resize(2); fermion = false; build_pattern = "(DD)"; }
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CreDesComp: public SpinAdapted::SparseMatrix
{
public:
CreDesComp() { orbs.resize(2); fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class DesCreComp: public SpinAdapted::SparseMatrix
{
public:
DesCreComp() { orbs.resize(2); fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class DesDesComp: public SpinAdapted::SparseMatrix
{
public:
DesDesComp() { orbs.resize(2); fermion = false;}
void build_fromcc(SpinBlock& b);
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CreCreComp: public SpinAdapted::SparseMatrix
{
public:
CreCreComp() { orbs.resize(2); fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CreCreDesComp: public SpinAdapted::SparseMatrix
{
public:
CreCreDesComp() { orbs.resize(1); fermion = true;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CreDesDesComp: public SpinAdapted::SparseMatrix
{
public:
CreDesDesComp() { orbs.resize(1); fermion = true;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class Ham: public SpinAdapted::SparseMatrix
{
public:
Ham() { fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class Overlap: public SpinAdapted::SparseMatrix
{
public:
Overlap() { fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
//CDD_sum is used in V_a subspace of nevpt2.
//It is the sum of perturber operator on one block.
class CDD_sum: public SpinAdapted::SparseMatrix
{
public:
CDD_sum() { fermion = true;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CDD_CreDesComp: public SpinAdapted::SparseMatrix
{
public:
CDD_CreDesComp() { fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CDD_DesDesComp: public SpinAdapted::SparseMatrix
{
public:
CDD_DesDesComp() { fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
//CCD_sum is used in V_i subspace of nevpt2.
//It is the sum of perturber operator on one block.
class CCD_sum: public SpinAdapted::SparseMatrix
{
public:
CCD_sum() { fermion = true;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CCD_CreDesComp: public SpinAdapted::SparseMatrix
{
public:
CCD_CreDesComp() { fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
class CCD_CreCreComp: public SpinAdapted::SparseMatrix
{
public:
CCD_CreCreComp() { fermion = false;}
void build(const SpinBlock& b) ;
boost::shared_ptr<SparseMatrix> getworkingrepresentation(const SpinBlock* block);
double redMatrixElement(Csf c1, vector<Csf>& ladder, const SpinBlock* b);
};
double vcccc_4idx_asymm(int i, int j, int k, int l);
}
#endif