-
Notifications
You must be signed in to change notification settings - Fork 0
/
qmcSysDescription.h
175 lines (149 loc) · 6.16 KB
/
qmcSysDescription.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
#ifndef QMC_SYS_DESCRIPTION
#define QMC_SYS_DESCRIPTION
#include <map>
#include <vector>
#include <string>
#include "types.h"
#include "xmlRep.h"
class jastrow;
class observable;
class atomTypeDescriptions {
private:
std::vector<std::string> atNames; // list of the atom types (will be ntyp of these)
std::map<std::string, std::vector<location> > atNameToPosVec; // from each atom type a vector of that atom's positions
std::map<std::string, std::string> atNameToPPFile; // list from type to pp file name (will say AE if treated as AE)
std::map<std::string, int> atNameToCharge;
std::map<std::string, int> atNameToValence;
std::map<std::string, int> atNameToAtomicNumber;
std::map<std::string, double> atNameToMass;
// need these only if using hybrid representation
std::map<std::string, double> atNameToCutoffRadius;
std::map<std::string, double> atNameToSplineRadius;
std::map<std::string, int> atNameToSplinePts;
std::map<std::string, int> atNameToLmax;
public:
atomTypeDescriptions();
void addAtomType(const std::string& name, const std::string& ppFile, int charge,
int valence, int atomicNumber, double mass, const std::vector<location>& pos,
double cutoffRadius = 0, double splineRadius = 0, int splinePts = 0, int lmax = 0) {
atNames.push_back(name);
atNameToPosVec[name] = pos;
atNameToPPFile[name] = ppFile;
atNameToCharge[name] = charge;
atNameToValence[name] = valence;
atNameToAtomicNumber[name] = atomicNumber;
atNameToMass[name] = mass;
atNameToCutoffRadius[name] = cutoffRadius;
atNameToSplineRadius[name] = splineRadius;
atNameToSplinePts[name] = splinePts;
atNameToLmax[name] = lmax;
}
int getNumTypes() const { return atNames.size(); }
std::string getAtName(int i) const { return atNames[i]; }
std::string getPPFile(const std::string& atName) const {
std::map<std::string, std::string>::const_iterator it = atNameToPPFile.find(atName);
return it->second;
}
int getCharge(const std::string& atName) const {
std::map<std::string, int>::const_iterator it = atNameToCharge.find(atName);
return it->second;
}
int getValence(const std::string& atName) const {
std::map<std::string, int>::const_iterator it = atNameToValence.find(atName);
return it->second;
}
int getAtomicNumber(const std::string& atName) const {
std::map<std::string, int>::const_iterator it = atNameToAtomicNumber.find(atName);
return it->second;
}
double getMass(const std::string& atName) const {
std::map<std::string, double>::const_iterator it = atNameToMass.find(atName);
return it->second;
}
double getCutoffRadius(const std::string& atName) const {
std::map<std::string, double>::const_iterator it = atNameToCutoffRadius.find(atName);
return it->second;
}
double getSplineRadius(const std::string& atName) const {
std::map<std::string, double>::const_iterator it = atNameToSplineRadius.find(atName);
return it->second;
}
int getSplinePts(const std::string& atName) const {
std::map<std::string, int>::const_iterator it = atNameToSplinePts.find(atName);
return it->second;
}
int getLmax(const std::string& atName) const {
std::map<std::string, int>::const_iterator it = atNameToLmax.find(atName);
return it->second;
}
const std::vector<location>& getPosVec(const std::string& atName) const {
std::map<std::string, std::vector<location> >::const_iterator it = atNameToPosVec.find(atName);
return it->second;
}
};
// still need to add a --jastrowperion option (will affect both jastrows and particleset)
// Main task now is to write the constructor!!!
class qmcSysDescription {
private:
double lr_dim_cutoff;
// variables to store ptv, atom types and positions and ppnames
int numAt;
int nelup;
int neldn;
atomTypeDescriptions atd;
int getNumTypes() const { return atd.getNumTypes(); }
std::string getAtName(int i) const { return atd.getAtName(i); }
std::string getPPFile(const std::string& atName) const { return atd.getPPFile(atName); }
int getCharge(const std::string& atName) const { return atd.getCharge(atName); }
int getValence(const std::string& atName) const { return atd.getValence(atName); }
int getAtomicNumber(const std::string& atName) const { return atd.getAtomicNumber(atName); }
double getMass(const std::string& atName) const { return atd.getMass(atName); }
// need these only if using hybrid representation
double getCutoffRadius(const std::string& atName) const { return atd.getCutoffRadius(atName); }
double getSplineRadius(const std::string& atName) const { return atd.getSplineRadius(atName); }
int getSplinePts(const std::string& atName) const { return atd.getSplinePts(atName); }
int getLmax(const std::string& atName) const { return atd.getLmax(atName); }
const std::vector<location>& getPosVec(const std::string& atName) const { return atd.getPosVec(atName); }
threeThreeMat<double> ptv;
std::vector<int> bconds;
// variables to store info about detset type
int isHybrid;
int isTiled;
std::string h5name;
threeThreeMat<int> tilemat;
double meshfactor;
int useTruncate;
double bufferSize;
int useDpCoeffs;
int useGPU;
int isSpinDependent;
// variables to store names of sections
std::string hamname;
std::string wfnname;
std::string epsetname;
std::string ipsetname;
// variables to store info about wfntype
std::vector<jastrow*> jastrows;
// variables to store info about hamiltonianType
std::vector<observable*> observables;
// map to store excitations (from band to be depopulated to one to be populated)
std::map<int, int> upExcit;
std::map<int, int> downExcit;
public:
void createJastrows(int argc, char* argv[]);
void createJastrows(const std::string& optDirName);
void createObservables(int argc, char* argv[]);
void addExcit(int spin, int depopulate, int populate) {
if (spin == 0) {
upExcit[depopulate] = populate;
} else {
downExcit[depopulate] = populate;
}
}
xmlNode getHamiltonianNode() const;
xmlNode getIonPtclSetNode() const;
xmlNode getElectronPtclSetNode() const;
xmlNode getWfnNode(int twistnum = 0, const location tw = location()) const;
xmlNode getSimulationCellNode() const;
};
#endif