MADNESS  version 0.9
TDA_exops.h
Go to the documentation of this file.
1 /*
2  * TDA_exops.h
3  *
4  * Created on: Sep 2, 2014
5  * Author: kottmanj
6  */
7 
8 #ifndef TDA_EXOPS_H_
9 #define TDA_EXOPS_H_
10 
11 namespace madness{
12 struct exoperators{
13 
14 public:
16 
17  vecfuncT get_exops(World &world,const std::string exop){
18  vecfuncT xoperators;
19  if(exop == "dipole"){
20  real_function_3d fx = real_factory_3d(world).f(x_function);
21  xoperators.push_back(fx);
22  real_function_3d fy = real_factory_3d(world).f(y_function);
23  xoperators.push_back(fy);
24  real_function_3d fz = real_factory_3d(world).f(z_function);
25  xoperators.push_back(fz);
26  }
27  else if(exop == "dipole+"){
28  real_function_3d fr = real_factory_3d(world).f(r_function);
29  xoperators.push_back(fr);
30  real_function_3d fx = real_factory_3d(world).f(x_function);
31  xoperators.push_back(fx);
32  real_function_3d fy = real_factory_3d(world).f(y_function);
33  xoperators.push_back(fy);
34  real_function_3d fz = real_factory_3d(world).f(z_function);
35  xoperators.push_back(fz);
36  }
37  else if(exop == "quadrupole"){
38  real_function_3d fx = real_factory_3d(world).f(x_function);
39  xoperators.push_back(fx);
40  real_function_3d fy = real_factory_3d(world).f(y_function);
41  xoperators.push_back(fy);
42  real_function_3d fz = real_factory_3d(world).f(z_function);
43  xoperators.push_back(fz);
44  real_function_3d fxy = real_factory_3d(world).f(xy_function);
45  xoperators.push_back(fxy);
46  real_function_3d fyz = real_factory_3d(world).f(yz_function);
47  xoperators.push_back(fyz);
48  real_function_3d fzz = real_factory_3d(world).f(zz_function);
49  xoperators.push_back(fzz);
50  real_function_3d fyy = real_factory_3d(world).f(yy_function);
51  xoperators.push_back(fyy);
52  real_function_3d fxx = real_factory_3d(world).f(xx_function);
53  xoperators.push_back(fxx);
54  real_function_3d fxz = real_factory_3d(world).f(xz_function);
55  xoperators.push_back(fxz);
56  }
57  else if(exop == "quadrupole"){
58  real_function_3d fr = real_factory_3d(world).f(r_function);
59  xoperators.push_back(fr);
60  real_function_3d fx = real_factory_3d(world).f(x_function);
61  xoperators.push_back(fx);
62  real_function_3d fy = real_factory_3d(world).f(y_function);
63  xoperators.push_back(fy);
64  real_function_3d fz = real_factory_3d(world).f(z_function);
65  xoperators.push_back(fz);
66  real_function_3d fxy = real_factory_3d(world).f(xy_function);
67  xoperators.push_back(fxy);
68  real_function_3d fyz = real_factory_3d(world).f(yz_function);
69  xoperators.push_back(fyz);
70  real_function_3d fxz = real_factory_3d(world).f(xz_function);
71  xoperators.push_back(fxz);
72  }
73  else if(exop == "C2v"){
74  real_function_3d A1=real_factory_3d(world).f(c2v_A1);xoperators.push_back(A1);
75  real_function_3d A2=real_factory_3d(world).f(c2v_A2);xoperators.push_back(A2);
76  real_function_3d B1=real_factory_3d(world).f(c2v_B1);xoperators.push_back(B1);
77  real_function_3d B2=real_factory_3d(world).f(c2v_B2);xoperators.push_back(B2);
78  }
79  else if(exop == "C2h"){
80  real_function_3d tmp0 =real_factory_3d(world).f(c2v_Ag); xoperators.push_back(tmp0);
81  real_function_3d tmp1 =real_factory_3d(world).f(c2v_Bg); xoperators.push_back(tmp1);
82  real_function_3d tmp2 =real_factory_3d(world).f(c2v_Au); xoperators.push_back(tmp2);
83  real_function_3d tmp3 =real_factory_3d(world).f(c2v_Bu); xoperators.push_back(tmp3);
84 
85  }
86  else if(exop == "D2h"){
87  real_function_3d tmp0 = real_factory_3d(world).f(d2h_Ag );xoperators.push_back(tmp0);
88  real_function_3d tmp1 = real_factory_3d(world).f(d2h_B1g);xoperators.push_back(tmp1);
89  real_function_3d tmp2 = real_factory_3d(world).f(d2h_B2g);xoperators.push_back(tmp2);
90  real_function_3d tmp3 = real_factory_3d(world).f(d2h_B3g);xoperators.push_back(tmp3);
91  real_function_3d tmp4 = real_factory_3d(world).f(d2h_Au );xoperators.push_back(tmp4);
92  real_function_3d tmp5 = real_factory_3d(world).f(d2h_B1u);xoperators.push_back(tmp5);
93  real_function_3d tmp6 = real_factory_3d(world).f(d2h_B2u);xoperators.push_back(tmp6);
94  real_function_3d tmp7 = real_factory_3d(world).f(d2h_B3u);xoperators.push_back(tmp7);
95 
96  }
97  else if(exop == "C2"){
98  real_function_3d tmp0 = real_factory_3d(world).f(c2_A );xoperators.push_back(tmp0);
99  real_function_3d tmp1 = real_factory_3d(world).f(c2_B) ;xoperators.push_back(tmp1);
100  }
101  else if(exop == "D3"){
102  real_function_3d tmp0 = real_factory_3d(world).f(d3_A1);xoperators.push_back(tmp0);
103  real_function_3d tmp1 = real_factory_3d(world).f(d3_A2);xoperators.push_back(tmp1);
104  real_function_3d tmp2 = real_factory_3d(world).f(d3_E1);xoperators.push_back(tmp2);
105  real_function_3d tmp3 = real_factory_3d(world).f(d3_E2);xoperators.push_back(tmp3);
106  }
107  else if(exop=="C3v"){
108  real_function_3d tmp0 = real_factory_3d(world).f(c3v_A1);xoperators.push_back(tmp0);
109  real_function_3d tmp1 = real_factory_3d(world).f(c3v_A2);xoperators.push_back(tmp1);
110  real_function_3d tmp2 = real_factory_3d(world).f(c3v_E11);xoperators.push_back(tmp2);
111  real_function_3d tmp3 = real_factory_3d(world).f(c3v_E12);xoperators.push_back(tmp3);
112  }
113  else if(exop=="benzene"){
114  real_function_3d tmp0 = real_factory_3d(world).f(benzene_0);xoperators.push_back(tmp0);
115  real_function_3d tmp1 = real_factory_3d(world).f(benzene_1);xoperators.push_back(tmp1);
116  real_function_3d tmp2 = real_factory_3d(world).f(benzene_2);xoperators.push_back(tmp2);
117  real_function_3d tmp3 = real_factory_3d(world).f(benzene_3);xoperators.push_back(tmp3);
118  real_function_3d tmp4 = real_factory_3d(world).f(benzene_4);xoperators.push_back(tmp4);
119  real_function_3d tmp5 = real_factory_3d(world).f(benzene_5);xoperators.push_back(tmp5);
120  real_function_3d tmp6 = real_factory_3d(world).f(benzene_6);xoperators.push_back(tmp6);
121  }
122  else if(exop=="D2d"){
123  real_function_3d tmp0 = real_factory_3d(world).f(d2d_A1); xoperators.push_back(tmp0);
124  real_function_3d tmp1 = real_factory_3d(world).f(d2d_A2); xoperators.push_back(tmp1);
125  real_function_3d tmp2 = real_factory_3d(world).f(d2d_B1); xoperators.push_back(tmp2);
126  real_function_3d tmp3 = real_factory_3d(world).f(d2d_B2); xoperators.push_back(tmp3);
127  real_function_3d tmp4 = real_factory_3d(world).f(d2d_E1); xoperators.push_back(tmp4);
128  real_function_3d tmp5 = real_factory_3d(world).f(d2d_E2); xoperators.push_back(tmp5);
129  }
130  else {
131  std::cout << "exop keyword " << exop << "is not known" << std::endl;
132  MADNESS_EXCEPTION("Unknown keyword in exop struct",1);
133  }
134 
135  return xoperators;
136 
137  }
138 
139 
140 private:
141  // Dipole operators
142  static double x_function(const coord_3d &r){return r[0];}
143  static double y_function(const coord_3d &r){return r[1];}
144  static double z_function(const coord_3d &r){return r[2];}
145  // quadrupole operators
146  static double xy_function(const coord_3d &r){return r[0]*r[1];}
147  static double xz_function(const coord_3d &r){return r[0]*r[2];}
148  static double yz_function(const coord_3d &r){return r[1]*r[2];}
149  static double xx_yy_function(const coord_3d &r){return r[0]*r[0]-r[1]*r[1];}
150  static double xx_yy_2zz_function(const coord_3d &r){return r[0]*r[0]+r[1]*r[1]-2.0*r[3]*r[3];}
151  static double zz_function(const coord_3d &r){return r[2]*r[2];}
152  static double xx_function(const coord_3d &r){return r[0]*r[0];}
153  static double yy_function(const coord_3d &r){return r[1]*r[1];}
154  // dark states
155  static double r_function(const coord_3d &r){return sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);}
156  static double rr_function(const coord_3d &r){return r[0]*r[0]+r[1]*r[1]+r[2]*r[2];}
157  // Hybrids (just for testing)
158  static double sp30(const coord_3d &r){return r_function(r)+r[0]+r[1]+r[2];}
159  static double sp31(const coord_3d &r){return r_function(r)+r[0]-r[1]-r[2];}
160  static double sp32(const coord_3d &r){return r_function(r)-r[0]+r[1]-r[2];}
161  static double sp33(const coord_3d &r){return r_function(r)-r[0]-r[1]+r[2];}
162  // Excitation operator for sequential guess as linear combination of x y z r
163  static double f_seqop(const coord_3d &r) {return (x_function(r)+y_function(r)+z_function(r)+r_function(r));}
164  // cubic excitations
165  static double xxx_function(const coord_3d &r){ return r[0]*r[0]*r[0]; }
166  static double yyy_function(const coord_3d &r){ return r[1]*r[1]*r[1]; }
167  static double zzz_function(const coord_3d &r){ return r[2]*r[2]*r[2]; }
168  static double xyy_function(const coord_3d &r){ return r[0]*r[1]*r[1]; }
169  static double xxy_function(const coord_3d &r){ return r[0]*r[0]*r[1]; }
170  static double xzz_function(const coord_3d &r){ return r[0]*r[2]*r[2]; }
171  static double xxz_function(const coord_3d &r){ return r[0]*r[0]*r[2]; }
172  static double yzz_function(const coord_3d &r){ return r[1]*r[2]*r[2]; }
173  static double yyz_function(const coord_3d &r){ return r[1]*r[1]*r[2]; }
174  static double xyz_function(const coord_3d &r){ return r[0]*r[1]*r[2]; }
175 
176 
177 
179 
181  static double c2v_Ag(const coord_3d &r){return rr_function(r)+xy_function(r);}
182  static double c2v_Bg(const coord_3d &r){return xy_function(r)+yz_function(r);}
183  static double c2v_Au(const coord_3d &r){return z_function(r)+zzz_function(r)+xyz_function(r)+xxz_function(r)+yyz_function(r);}
184  static double c2v_Bu(const coord_3d &r){return x_function(r)+y_function(r)+xzz_function(r)+yzz_function(r)+xxy_function(r)+xyy_function(r)+xxx_function(r)+yyy_function(r);}
185 
186 
188  static double d2h_Ag (const coord_3d &r){return rr_function(r) ;}
189  static double d2h_B1g (const coord_3d &r){return xy_function(r) ;}
190  static double d2h_B2g (const coord_3d &r){return xz_function(r) ;}
191  static double d2h_B3g (const coord_3d &r){return yz_function(r) ;}
192  static double d2h_Au (const coord_3d &r){return xyz_function(r);}
193  static double d2h_B1u (const coord_3d &r){return x_function(r)+zzz_function(r)+yyz_function(r)+xzz_function(r) ;}
194  static double d2h_B2u (const coord_3d &r){return y_function(r)+yzz_function(r)+xxy_function(r)+yyy_function(r) ;}
195  static double d2h_B3u (const coord_3d &r){return z_function(r)+xzz_function(r)+xyy_function(r)+xxx_function(r) ;}
197 
199 
201  static double c2_A(const coord_3d &r){return z_function(r)+rr_function(r)+xy_function(r)+zzz_function(r)+xyz_function(r)+yyz_function(r)+xxz_function(r);}
202  static double c2_B(const coord_3d &r){return x_function(r)+y_function(r)+yz_function(r)+xz_function(r)+xzz_function(r)+yzz_function(r)+xxy_function(r)+xyy_function(r)+xxx_function(r)+yyy_function(r);}
203 
205  static double c2v_A1(const coord_3d &r){return z_function(r)+xx_function(r)+yy_function(r)+zz_function(r)+xxz_function(r)+yyz_function(r)+zzz_function(r) ;}
206  static double c2v_A2(const coord_3d &r){return xy_function(r)+xyz_function(r) ;}
207  static double c2v_B1(const coord_3d &r){return x_function(r)+xz_function(r)+xzz_function(r)+xxx_function(r)+xyy_function(r);}
208  static double c2v_B2(const coord_3d &r){return y_function(r)+yz_function(r)+yzz_function(r)+yyy_function(r)+xxy_function(r);}
209 
211 
213  static double d3_A1(const coord_3d &r){return rr_function(r)+xxx_function(r)-3.0*xyy_function(r);}
214  static double d3_A2(const coord_3d &r){return z_function(r)+zzz_function(r)+3.0*xxy_function(r)-yyy_function(r)+xxz_function(r)+yyz_function(r);}
215  static double d3_E1(const coord_3d &r){return x_function(r)+xx_function(r)-yy_function(r)+xz_function(r)+xzz_function(r)+xyz_function(r)+xxx_function(r)+xyy_function(r);}
216  static double d3_E2(const coord_3d &r){return y_function(r)+xy_function(r)+yz_function(r)+yzz_function(r)+xxz_function(r)-yyz_function(r)+xxy_function(r)+yyy_function(r);}
217 
219  static double c3v_A1 (const coord_3d &r){return z_function(r)+rr_function(r)+zzz_function(r)+xxx_function(r)-3.0*xyy_function(r)+xxz_function(r)+yyz_function(r) ;}
220  static double c3v_A2 (const coord_3d &r){return 3.0*xxy_function(r)-yyy_function(r) ;}
221  static double c3v_E11(const coord_3d &r){return x_function(r)+xx_function(r)-yy_function(r)+xz_function(r)+xzz_function(r)+xyz_function(r)+xxx_function(r)+xyy_function(r);}
222  static double c3v_E12(const coord_3d &r){return y_function(r)+xy_function(r)+yz_function(r)+xxz_function(r)-yyz_function(r)+xxy_function(r)+yyy_function(r);}
223 
225  static double benzene_0(const coord_3d &r){return xxx_function(r) -3.0*xyy_function(r) ;}
226  static double benzene_1(const coord_3d &r){return 3.0*xxy_function(r) -yyy_function(r);}
227  static double benzene_2(const coord_3d &r){return xz_function(r);}
228  static double benzene_3(const coord_3d &r){return yz_function(r);}
229  static double benzene_4(const coord_3d &r){return z_function(r);}
230  static double benzene_5(const coord_3d &r){return xyz_function(r);}
231  static double benzene_6(const coord_3d &r){return xxz_function(r) - yyz_function(r);}
232 
234  static double d2d_A1(const coord_3d &r){return rr_function(r) +xyz_function(r) ;}
235  static double d2d_A2(const coord_3d &r){return xxz_function(r) - yyz_function(r) ;}
236  static double d2d_B1(const coord_3d &r){return xx_function(r) -yy_function(r) ;}
237  static double d2d_B2(const coord_3d &r){return z_function(r) +xy_function(r) +zzz_function(r) + xxz_function(r) +yyz_function(r) ;}
238  static double d2d_E1(const coord_3d &r){x_function(r)+xz_function(r)+xzz_function(r)+xyy_function(r)+xxx_function(r);}
239  static double d2d_E2(const coord_3d &r){y_function(r)+yz_function(r)+yzz_function(r)+xxy_function(r)+yyy_function(r);}
240 
241 };
242 }
243 
244 
245 
246 #endif /* TDA_EXOPS_H_ */
::std::string string
Definition: gtest-port.h:872
Definition: TDA_exops.h:12
Vector< double, 3 > coord_3d
Definition: funcplot.h:634
exoperators()
Definition: TDA_exops.h:15
vector< functionT > vecfuncT
Definition: chem/corepotential.cc:61
tensorT sqrt(const tensorT &s, double tol=1e-8)
Computes matrix square root (not used any more?)
Definition: DFcode/moldft.cc:446
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
FunctionFactory< double, 3 > real_factory_3d
Definition: functypedefs.h:93
#define MADNESS_EXCEPTION(msg, value)
Definition: worldexc.h:88
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
vecfuncT get_exops(World &world, const std::string exop)
Definition: TDA_exops.h:17