QMCPACK
test_cartesian_tensor.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Mark Dewing, markdewing@gmail.com, University of Illinois at Urbana-Champaign
8 //
9 // File created by: Mark Dewing, markdewing@gmail.com, University of Illinois at Urbana-Champaign
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "catch.hpp"
15 
16 #include <stdio.h>
17 #include <string>
18 
19 using std::string;
20 
21 namespace qmcplusplus
22 {
24 
25 
26 // Use gen_gto.py to generate the checks
27 
28 TEST_CASE("Cartesian Tensor", "[numerics]")
29 {
31 
32  TinyVector<double, 3> pt(1.3, 1.2, -0.5);
33  //TinyVector<double, 3> pt(1.3, 0.0, 0.0);
34 
35  ct.evaluate(pt);
36 
37  //for (int i = 0; i < 35; i++) {
38  //std::cout << "XYZ = " << i << " " << ct.getYlm(i) << std::endl;
39  //}
40  CHECK(ct.getYlm(0) == Approx(0.282094791774));
41  CHECK(ct.getYlm(1) == Approx(0.635183265474));
42  CHECK(ct.getYlm(2) == Approx(0.586323014284));
43  CHECK(ct.getYlm(3) == Approx(-0.244301255951));
44  CHECK(ct.getYlm(4) == Approx(1.06602349055));
45  CHECK(ct.getYlm(5) == Approx(0.908327707927));
46  CHECK(ct.getYlm(6) == Approx(0.157695782626));
47  CHECK(ct.getYlm(7) == Approx(1.70437555172));
48  CHECK(ct.getYlm(8) == Approx(-0.710156479885));
49  CHECK(ct.getYlm(9) == Approx(-0.655529058355));
50  CHECK(ct.getYlm(10) == Approx(1.6397368054));
51  CHECK(ct.getYlm(11) == Approx(1.28969740543));
52  CHECK(ct.getYlm(12) == Approx(-0.0932940831475));
53  CHECK(ct.getYlm(13) == Approx(3.38451965731));
54  CHECK(ct.getYlm(14) == Approx(-1.41021652388));
55  CHECK(ct.getYlm(15) == Approx(3.12417199136));
56  CHECK(ct.getYlm(16) == Approx(-1.20160461206));
57  CHECK(ct.getYlm(17) == Approx(0.542390970723));
58  CHECK(ct.getYlm(18) == Approx(0.500668588359));
59  CHECK(ct.getYlm(19) == Approx(-2.25467692526));
60  CHECK(ct.getYlm(20) == Approx(2.41707280436));
61  CHECK(ct.getYlm(21) == Approx(1.75485528067));
62  CHECK(ct.getYlm(22) == Approx(0.0528927734576));
63  CHECK(ct.getYlm(23) == Approx(5.90305249944));
64  CHECK(ct.getYlm(24) == Approx(-2.4596052081));
65  CHECK(ct.getYlm(25) == Approx(5.02981988118));
66  CHECK(ct.getYlm(26) == Approx(-1.93454610815));
67  CHECK(ct.getYlm(27) == Approx(-0.363846924275));
68  CHECK(ct.getYlm(28) == Approx(-0.335858699331));
69  CHECK(ct.getYlm(29) == Approx(7.03459200681));
70  CHECK(ct.getYlm(30) == Approx(1.22128333452));
71  CHECK(ct.getYlm(31) == Approx(1.04062011935));
72  CHECK(ct.getYlm(32) == Approx(-5.07677948596));
73  CHECK(ct.getYlm(33) == Approx(-4.68625798704));
74  CHECK(ct.getYlm(34) == Approx(1.9526074946));
75  CHECK(ct.getYlm(35) == Approx(3.47382688598));
76  CHECK(ct.getYlm(36) == Approx(2.32807861094));
77  CHECK(ct.getYlm(37) == Approx(-0.0292375806134));
78  CHECK(ct.getYlm(38) == Approx(9.61982829963));
79  CHECK(ct.getYlm(39) == Approx(-4.00826179151));
80  CHECK(ct.getYlm(40) == Approx(7.56625548555));
81  CHECK(ct.getYlm(41) == Approx(-2.91009826367));
82  CHECK(ct.getYlm(42) == Approx(0.228053128784));
83  CHECK(ct.getYlm(43) == Approx(0.210510580416));
84  CHECK(ct.getYlm(44) == Approx(13.5641819555));
85  CHECK(ct.getYlm(45) == Approx(2.35489270061));
86  CHECK(ct.getYlm(46) == Approx(12.5207833436));
87  CHECK(ct.getYlm(47) == Approx(1.85218688514));
88  CHECK(ct.getYlm(48) == Approx(-0.905727961775));
89  CHECK(ct.getYlm(49) == Approx(-0.771744535477));
90  CHECK(ct.getYlm(50) == Approx(-9.78910512921));
91  CHECK(ct.getYlm(51) == Approx(-8.34101265448));
92  CHECK(ct.getYlm(52) == Approx(-1.44809247474));
93  CHECK(ct.getYlm(53) == Approx(-11.6655511199));
94  CHECK(ct.getYlm(54) == Approx(4.86064629996));
95  CHECK(ct.getYlm(55) == Approx(4.48675043074));
96  CHECK(ct.getYlm(56) == Approx(4.90938236205));
97  CHECK(ct.getYlm(57) == Approx(3.03706593382));
98  CHECK(ct.getYlm(58) == Approx(0.0158923005669));
99  CHECK(ct.getYlm(59) == Approx(15.0300731514));
100  CHECK(ct.getYlm(60) == Approx(-6.26253047974));
101  CHECK(ct.getYlm(61) == Approx(10.9122088466));
102  CHECK(ct.getYlm(62) == Approx(-4.19700340252));
103  CHECK(ct.getYlm(63) == Approx(-0.137042874894));
104  CHECK(ct.getYlm(64) == Approx(-0.126501115286));
105  CHECK(ct.getYlm(65) == Approx(24.0303233904));
106  CHECK(ct.getYlm(66) == Approx(4.17193114417));
107  CHECK(ct.getYlm(67) == Approx(20.4755418238));
108  CHECK(ct.getYlm(68) == Approx(3.0289263053));
109  CHECK(ct.getYlm(69) == Approx(0.61714957754));
110  CHECK(ct.getYlm(70) == Approx(0.525855261336));
111  CHECK(ct.getYlm(71) == Approx(-17.3423920977));
112  CHECK(ct.getYlm(72) == Approx(-13.6402610582));
113  CHECK(ct.getYlm(73) == Approx(0.986708699234));
114  CHECK(ct.getYlm(74) == Approx(26.2459034569));
115  CHECK(ct.getYlm(75) == Approx(-1.89857519219));
116  CHECK(ct.getYlm(76) == Approx(-1.49328080661));
117  CHECK(ct.getYlm(77) == Approx(-24.4531767752));
118  CHECK(ct.getYlm(78) == Approx(10.1888236563));
119  CHECK(ct.getYlm(79) == Approx(-22.5721631771));
120  CHECK(ct.getYlm(80) == Approx(8.68160122197));
121  CHECK(ct.getYlm(81) == Approx(-3.91877832936));
122  CHECK(ct.getYlm(82) == Approx(-3.61733384249));
123  CHECK(ct.getYlm(83) == Approx(12.1418905657));
124 }
125 
126 TEST_CASE("Cartesian Tensor evaluateAll subset", "[numerics]")
127 {
129 
130  TinyVector<double, 3> pt(1.3, 1.2, -0.5);
131  ct.evaluateAll(pt);
132 
133  //for (int i = 0; i < 35; i++) {
134  // std::cout << "XYZ = " << i << " " << ct.getYlm(i) << " " << ct.getGradYlm(i) << " " << ct.getLaplYlm(i) << std::endl;
135  //}
136 
137  CHECK(ct.getYlm(0) == Approx(0.282094791774));
138  CHECK(ct.getGradYlm(0)[0] == Approx(0));
139  CHECK(ct.getGradYlm(0)[1] == Approx(0));
140  CHECK(ct.getGradYlm(0)[2] == Approx(0));
141  CHECK(ct.getLaplYlm(0) == Approx(0));
142 
143  CHECK(ct.getYlm(1) == Approx(0.635183265474));
144  CHECK(ct.getGradYlm(1)[0] == Approx(0.488602511903));
145  CHECK(ct.getGradYlm(1)[1] == Approx(0));
146  CHECK(ct.getGradYlm(1)[2] == Approx(0));
147  CHECK(ct.getLaplYlm(1) == Approx(0));
148 
149  CHECK(ct.getYlm(8) == Approx(-0.710156479885));
150  CHECK(ct.getGradYlm(8)[0] == Approx(-0.546274215296));
151  CHECK(ct.getGradYlm(8)[1] == Approx(0));
152  CHECK(ct.getGradYlm(8)[2] == Approx(1.42031295977));
153  CHECK(ct.getLaplYlm(8) == Approx(0));
154 
155  CHECK(ct.getYlm(23) == Approx(5.90305249944));
156  CHECK(ct.getGradYlm(23)[0] == Approx(13.6224288449));
157  CHECK(ct.getGradYlm(23)[1] == Approx(4.9192104162));
158  CHECK(ct.getGradYlm(23)[2] == Approx(0));
159  CHECK(ct.getLaplYlm(23) == Approx(20.9575828383));
160 
161  CHECK(ct.getYlm(34) == Approx(1.9526074946));
162  CHECK(ct.getGradYlm(34)[0] == Approx(1.50200576508));
163  CHECK(ct.getGradYlm(34)[1] == Approx(1.62717291217));
164  CHECK(ct.getGradYlm(34)[2] == Approx(-7.81042997841));
165  CHECK(ct.getLaplYlm(34) == Approx(15.6208599568));
166 
167  CHECK(ct.getYlm(50) == Approx(-9.78910512921));
168  CHECK(ct.getGradYlm(50)[0] == Approx(-22.5902426059));
169  CHECK(ct.getGradYlm(50)[1] == Approx(-8.15758760768));
170  CHECK(ct.getGradYlm(50)[2] == Approx(19.5782102584));
171  CHECK(ct.getLaplYlm(50) == Approx(-34.7542193937));
172 
173  CHECK(ct.getYlm(83) == Approx(12.1418905657));
174  CHECK(ct.getGradYlm(83)[0] == Approx(18.6798316395));
175  CHECK(ct.getGradYlm(83)[1] == Approx(20.2364842761));
176  CHECK(ct.getGradYlm(83)[2] == Approx(-48.5675622627));
177  CHECK(ct.getLaplYlm(83) == Approx(128.367962683));
178 }
179 
180 TEST_CASE("Cartesian Tensor evaluateWithHessian subset", "[numerics]")
181 {
183 
184  TinyVector<double, 3> pt(1.3, 1.2, -0.5);
185  ct.evaluateWithHessian(pt);
186 
187  //for (int i = 0; i < 35; i++) {
188  // std::cout << "XYZ = " << i << " " << ct.getYlm(i) << " " << ct.getHessYlm(i) << std::endl;
189  //}
190 
191  CHECK(ct.getYlm(0) == Approx(0.282094791774));
192  CHECK(ct.getGradYlm(0)[0] == Approx(0));
193  CHECK(ct.getGradYlm(0)[1] == Approx(0));
194  CHECK(ct.getGradYlm(0)[2] == Approx(0));
195 
196  CHECK(ct.getHessYlm(0)(0, 0) == Approx(0));
197  CHECK(ct.getHessYlm(0)(0, 1) == Approx(0));
198  CHECK(ct.getHessYlm(0)(0, 2) == Approx(0));
199  CHECK(ct.getHessYlm(0)(1, 0) == Approx(0));
200  CHECK(ct.getHessYlm(0)(1, 1) == Approx(0));
201  CHECK(ct.getHessYlm(0)(1, 2) == Approx(0));
202  CHECK(ct.getHessYlm(0)(2, 0) == Approx(0));
203  CHECK(ct.getHessYlm(0)(2, 1) == Approx(0));
204  CHECK(ct.getHessYlm(0)(2, 2) == Approx(0));
205 
206 
207  CHECK(ct.getYlm(1) == Approx(0.635183265474));
208  CHECK(ct.getGradYlm(1)[0] == Approx(0.488602511903));
209  CHECK(ct.getGradYlm(1)[1] == Approx(0));
210  CHECK(ct.getGradYlm(1)[2] == Approx(0));
211 
212  CHECK(ct.getHessYlm(1)(0, 0) == Approx(0));
213  CHECK(ct.getHessYlm(1)(0, 1) == Approx(0));
214  CHECK(ct.getHessYlm(1)(0, 2) == Approx(0));
215  CHECK(ct.getHessYlm(1)(1, 0) == Approx(0));
216  CHECK(ct.getHessYlm(1)(1, 1) == Approx(0));
217  CHECK(ct.getHessYlm(1)(1, 2) == Approx(0));
218  CHECK(ct.getHessYlm(1)(2, 0) == Approx(0));
219  CHECK(ct.getHessYlm(1)(2, 1) == Approx(0));
220  CHECK(ct.getHessYlm(1)(2, 2) == Approx(0));
221 
222 
223  CHECK(ct.getYlm(15) == Approx(3.12417199136));
224  CHECK(ct.getGradYlm(15)[0] == Approx(2.40320922412));
225  CHECK(ct.getGradYlm(15)[1] == Approx(5.20695331894));
226  CHECK(ct.getGradYlm(15)[2] == Approx(0));
227 
228  CHECK(ct.getHessYlm(15)(0, 0) == Approx(0));
229  CHECK(ct.getHessYlm(15)(0, 1) == Approx(4.00534870687));
230  CHECK(ct.getHessYlm(15)(0, 2) == Approx(0));
231  CHECK(ct.getHessYlm(15)(1, 0) == Approx(4.00534870687));
232  CHECK(ct.getHessYlm(15)(1, 1) == Approx(4.33912776578));
233  CHECK(ct.getHessYlm(15)(1, 2) == Approx(0));
234  CHECK(ct.getHessYlm(15)(2, 0) == Approx(0));
235  CHECK(ct.getHessYlm(15)(2, 1) == Approx(0));
236  CHECK(ct.getHessYlm(15)(2, 2) == Approx(0));
237 
238 
239  CHECK(ct.getYlm(32) == Approx(-5.07677948596));
240  CHECK(ct.getGradYlm(32)[0] == Approx(-7.81042997841));
241  CHECK(ct.getGradYlm(32)[1] == Approx(-4.23064957164));
242  CHECK(ct.getGradYlm(32)[2] == Approx(10.1535589719));
243 
244  CHECK(ct.getHessYlm(32)(0, 0) == Approx(-6.00802306031));
245  CHECK(ct.getHessYlm(32)(0, 1) == Approx(-6.50869164867));
246  CHECK(ct.getHessYlm(32)(0, 2) == Approx(15.6208599568));
247  CHECK(ct.getHessYlm(32)(1, 0) == Approx(-6.50869164867));
248  CHECK(ct.getHessYlm(32)(1, 1) == Approx(0));
249  CHECK(ct.getHessYlm(32)(1, 2) == Approx(8.46129914327));
250  CHECK(ct.getHessYlm(32)(2, 0) == Approx(15.6208599568));
251  CHECK(ct.getHessYlm(32)(2, 1) == Approx(8.46129914327));
252  CHECK(ct.getHessYlm(32)(2, 2) == Approx(0));
253 
254 
255  CHECK(ct.getYlm(52) == Approx(-1.44809247474));
256  CHECK(ct.getGradYlm(52)[0] == Approx(-1.11391728826));
257  CHECK(ct.getGradYlm(52)[1] == Approx(-1.20674372895));
258  CHECK(ct.getGradYlm(52)[2] == Approx(8.68855484841));
259 
260  CHECK(ct.getHessYlm(52)(0, 0) == Approx(0));
261  CHECK(ct.getHessYlm(52)(0, 1) == Approx(-0.928264406882));
262  CHECK(ct.getHessYlm(52)(0, 2) == Approx(6.68350372955));
263  CHECK(ct.getHessYlm(52)(1, 0) == Approx(-0.928264406882));
264  CHECK(ct.getHessYlm(52)(1, 1) == Approx(0));
265  CHECK(ct.getHessYlm(52)(1, 2) == Approx(7.24046237368));
266  CHECK(ct.getHessYlm(52)(2, 0) == Approx(6.68350372955));
267  CHECK(ct.getHessYlm(52)(2, 1) == Approx(7.24046237368));
268  CHECK(ct.getHessYlm(52)(2, 2) == Approx(-34.7542193937));
269 
270 
271  CHECK(ct.getYlm(71) == Approx(-17.3423920977));
272  CHECK(ct.getGradYlm(71)[0] == Approx(-53.3612064546));
273  CHECK(ct.getGradYlm(71)[1] == Approx(-14.4519934148));
274  CHECK(ct.getGradYlm(71)[2] == Approx(34.6847841955));
275 
276  CHECK(ct.getHessYlm(71)(0, 0) == Approx(-123.141245664));
277  CHECK(ct.getHessYlm(71)(0, 1) == Approx(-44.4676720455));
278  CHECK(ct.getHessYlm(71)(0, 2) == Approx(106.722412909));
279  CHECK(ct.getHessYlm(71)(1, 0) == Approx(-44.4676720455));
280  CHECK(ct.getHessYlm(71)(1, 1) == Approx(0));
281  CHECK(ct.getHessYlm(71)(1, 2) == Approx(28.9039868295));
282  CHECK(ct.getHessYlm(71)(2, 0) == Approx(106.722412909));
283  CHECK(ct.getHessYlm(71)(2, 1) == Approx(28.9039868295));
284  CHECK(ct.getHessYlm(71)(2, 2) == Approx(0));
285 }
286 
287 TEST_CASE("Cartesian Tensor evaluateWithThirdDeriv subset", "[numerics]")
288 {
290 
291  TinyVector<double, 3> pt(1.3, 1.2, -0.5);
292  ct.evaluateWithThirdDeriv(pt);
293 
294  //for (int i = 0; i < 35; i++) {
295  // std::cout << "XYZ = " << i << " " << ct.getYlm(i) << " " << ct.getGGGYlm(i) << std::endl;
296  //}
297 
298 
299  CHECK(ct.getYlm(0) == Approx(0.282094791774));
300 
301 
302  CHECK(ct.getYlm(27) == Approx(-0.363846924275));
303  CHECK(ct.getGradYlm(27)[0] == Approx(-0.279882249443));
304  CHECK(ct.getGradYlm(27)[1] == Approx(0));
305  CHECK(ct.getGradYlm(27)[2] == Approx(2.18308154565));
306 
307  CHECK(ct.getHessYlm(27)(0, 0) == Approx(0));
308  CHECK(ct.getHessYlm(27)(0, 1) == Approx(0));
309  CHECK(ct.getHessYlm(27)(0, 2) == Approx(1.67929349666));
310  CHECK(ct.getHessYlm(27)(1, 0) == Approx(0));
311  CHECK(ct.getHessYlm(27)(1, 1) == Approx(0));
312  CHECK(ct.getHessYlm(27)(1, 2) == Approx(0));
313  CHECK(ct.getHessYlm(27)(2, 0) == Approx(1.67929349666));
314  CHECK(ct.getHessYlm(27)(2, 1) == Approx(0));
315  CHECK(ct.getHessYlm(27)(2, 2) == Approx(-8.73232618261));
316 
317 
318  CHECK(ct.getGGGYlm(27)[0](0, 0) == Approx(0));
319  CHECK(ct.getGGGYlm(27)[0](0, 1) == Approx(0));
320  CHECK(ct.getGGGYlm(27)[0](0, 2) == Approx(0));
321  CHECK(ct.getGGGYlm(27)[0](1, 0) == Approx(0));
322  CHECK(ct.getGGGYlm(27)[0](1, 1) == Approx(0));
323  CHECK(ct.getGGGYlm(27)[0](1, 2) == Approx(0));
324  CHECK(ct.getGGGYlm(27)[0](2, 0) == Approx(0));
325  CHECK(ct.getGGGYlm(27)[0](2, 1) == Approx(0));
326  CHECK(ct.getGGGYlm(27)[0](2, 2) == Approx(-6.71717398662));
327  CHECK(ct.getGGGYlm(27)[1](0, 0) == Approx(0));
328  CHECK(ct.getGGGYlm(27)[1](0, 1) == Approx(0));
329  CHECK(ct.getGGGYlm(27)[1](0, 2) == Approx(0));
330  CHECK(ct.getGGGYlm(27)[1](1, 0) == Approx(0));
331  CHECK(ct.getGGGYlm(27)[1](1, 1) == Approx(0));
332  CHECK(ct.getGGGYlm(27)[1](1, 2) == Approx(0));
333  CHECK(ct.getGGGYlm(27)[1](2, 0) == Approx(0));
334  CHECK(ct.getGGGYlm(27)[1](2, 1) == Approx(0));
335  CHECK(ct.getGGGYlm(27)[1](2, 2) == Approx(0));
336  CHECK(ct.getGGGYlm(27)[2](0, 0) == Approx(0));
337  CHECK(ct.getGGGYlm(27)[2](0, 1) == Approx(0));
338  CHECK(ct.getGGGYlm(27)[2](0, 2) == Approx(-6.71717398662));
339  CHECK(ct.getGGGYlm(27)[2](1, 0) == Approx(0));
340  CHECK(ct.getGGGYlm(27)[2](1, 1) == Approx(0));
341  CHECK(ct.getGGGYlm(27)[2](1, 2) == Approx(0));
342  CHECK(ct.getGGGYlm(27)[2](2, 0) == Approx(-6.71717398662));
343  CHECK(ct.getGGGYlm(27)[2](2, 1) == Approx(0));
344  CHECK(ct.getGGGYlm(27)[2](2, 2) == Approx(17.4646523652));
345 
346 
347  CHECK(ct.getYlm(62) == Approx(-4.19700340252));
348  CHECK(ct.getGradYlm(62)[0] == Approx(0));
349  CHECK(ct.getGradYlm(62)[1] == Approx(-17.4875141772));
350  CHECK(ct.getGradYlm(62)[2] == Approx(8.39400680505));
351 
352  CHECK(ct.getHessYlm(62)(0, 0) == Approx(0));
353  CHECK(ct.getHessYlm(62)(0, 1) == Approx(0));
354  CHECK(ct.getHessYlm(62)(0, 2) == Approx(0));
355  CHECK(ct.getHessYlm(62)(1, 0) == Approx(0));
356  CHECK(ct.getHessYlm(62)(1, 1) == Approx(-58.291713924));
357  CHECK(ct.getHessYlm(62)(1, 2) == Approx(34.9750283544));
358  CHECK(ct.getHessYlm(62)(2, 0) == Approx(0));
359  CHECK(ct.getHessYlm(62)(2, 1) == Approx(34.9750283544));
360  CHECK(ct.getHessYlm(62)(2, 2) == Approx(0));
361  CHECK(ct.getGGGYlm(62)[0](0, 0) == Approx(0));
362  CHECK(ct.getGGGYlm(62)[0](0, 1) == Approx(0));
363  CHECK(ct.getGGGYlm(62)[0](0, 2) == Approx(0));
364  CHECK(ct.getGGGYlm(62)[0](1, 0) == Approx(0));
365  CHECK(ct.getGGGYlm(62)[0](1, 1) == Approx(0));
366  CHECK(ct.getGGGYlm(62)[0](1, 2) == Approx(0));
367  CHECK(ct.getGGGYlm(62)[0](2, 0) == Approx(0));
368  CHECK(ct.getGGGYlm(62)[0](2, 1) == Approx(0));
369  CHECK(ct.getGGGYlm(62)[0](2, 2) == Approx(0));
370  CHECK(ct.getGGGYlm(62)[1](0, 0) == Approx(0));
371  CHECK(ct.getGGGYlm(62)[1](0, 1) == Approx(0));
372  CHECK(ct.getGGGYlm(62)[1](0, 2) == Approx(0));
373  CHECK(ct.getGGGYlm(62)[1](1, 0) == Approx(0));
374  CHECK(ct.getGGGYlm(62)[1](1, 1) == Approx(-145.72928481));
375  CHECK(ct.getGGGYlm(62)[1](1, 2) == Approx(116.583427848));
376  CHECK(ct.getGGGYlm(62)[1](2, 0) == Approx(0));
377  CHECK(ct.getGGGYlm(62)[1](2, 1) == Approx(116.583427848));
378  CHECK(ct.getGGGYlm(62)[1](2, 2) == Approx(0));
379  CHECK(ct.getGGGYlm(62)[2](0, 0) == Approx(0));
380  CHECK(ct.getGGGYlm(62)[2](0, 1) == Approx(0));
381  CHECK(ct.getGGGYlm(62)[2](0, 2) == Approx(0));
382  CHECK(ct.getGGGYlm(62)[2](1, 0) == Approx(0));
383  CHECK(ct.getGGGYlm(62)[2](1, 1) == Approx(116.583427848));
384  CHECK(ct.getGGGYlm(62)[2](1, 2) == Approx(0));
385  CHECK(ct.getGGGYlm(62)[2](2, 0) == Approx(0));
386  CHECK(ct.getGGGYlm(62)[2](2, 1) == Approx(0));
387  CHECK(ct.getGGGYlm(62)[2](2, 2) == Approx(0));
388 }
389 
390 
391 TEST_CASE("Cartesian Tensor evaluateThirdDerivOnly subset", "[numerics]")
392 {
394 
395  TinyVector<double, 3> pt(1.3, 1.2, -0.5);
396  ct.evaluateThirdDerivOnly(pt);
397 
398  CHECK(ct.getGGGYlm(14)[0](0, 0) == Approx(0));
399  CHECK(ct.getGGGYlm(14)[0](0, 1) == Approx(0));
400  CHECK(ct.getGGGYlm(14)[0](0, 2) == Approx(3.33779058906));
401  CHECK(ct.getGGGYlm(14)[0](1, 0) == Approx(0));
402  CHECK(ct.getGGGYlm(14)[0](1, 1) == Approx(0));
403  CHECK(ct.getGGGYlm(14)[0](1, 2) == Approx(0));
404  CHECK(ct.getGGGYlm(14)[0](2, 0) == Approx(3.33779058906));
405  CHECK(ct.getGGGYlm(14)[0](2, 1) == Approx(0));
406  CHECK(ct.getGGGYlm(14)[0](2, 2) == Approx(0));
407  CHECK(ct.getGGGYlm(14)[1](0, 0) == Approx(0));
408  CHECK(ct.getGGGYlm(14)[1](0, 1) == Approx(0));
409  CHECK(ct.getGGGYlm(14)[1](0, 2) == Approx(0));
410  CHECK(ct.getGGGYlm(14)[1](1, 0) == Approx(0));
411  CHECK(ct.getGGGYlm(14)[1](1, 1) == Approx(0));
412  CHECK(ct.getGGGYlm(14)[1](1, 2) == Approx(0));
413  CHECK(ct.getGGGYlm(14)[1](2, 0) == Approx(0));
414  CHECK(ct.getGGGYlm(14)[1](2, 1) == Approx(0));
415  CHECK(ct.getGGGYlm(14)[1](2, 2) == Approx(0));
416  CHECK(ct.getGGGYlm(14)[2](0, 0) == Approx(3.33779058906));
417  CHECK(ct.getGGGYlm(14)[2](0, 1) == Approx(0));
418  CHECK(ct.getGGGYlm(14)[2](0, 2) == Approx(0));
419  CHECK(ct.getGGGYlm(14)[2](1, 0) == Approx(0));
420  CHECK(ct.getGGGYlm(14)[2](1, 1) == Approx(0));
421  CHECK(ct.getGGGYlm(14)[2](1, 2) == Approx(0));
422  CHECK(ct.getGGGYlm(14)[2](2, 0) == Approx(0));
423  CHECK(ct.getGGGYlm(14)[2](2, 1) == Approx(0));
424  CHECK(ct.getGGGYlm(14)[2](2, 2) == Approx(0));
425 
426 
427  CHECK(ct.getGGGYlm(33)[0](0, 0) == Approx(0));
428  CHECK(ct.getGGGYlm(33)[0](0, 1) == Approx(0));
429  CHECK(ct.getGGGYlm(33)[0](0, 2) == Approx(0));
430  CHECK(ct.getGGGYlm(33)[0](1, 0) == Approx(0));
431  CHECK(ct.getGGGYlm(33)[0](1, 1) == Approx(-5.00668588359));
432  CHECK(ct.getGGGYlm(33)[0](1, 2) == Approx(12.0160461206));
433  CHECK(ct.getGGGYlm(33)[0](2, 0) == Approx(0));
434  CHECK(ct.getGGGYlm(33)[0](2, 1) == Approx(12.0160461206));
435  CHECK(ct.getGGGYlm(33)[0](2, 2) == Approx(0));
436  CHECK(ct.getGGGYlm(33)[1](0, 0) == Approx(0));
437  CHECK(ct.getGGGYlm(33)[1](0, 1) == Approx(-5.00668588359));
438  CHECK(ct.getGGGYlm(33)[1](0, 2) == Approx(12.0160461206));
439  CHECK(ct.getGGGYlm(33)[1](1, 0) == Approx(-5.00668588359));
440  CHECK(ct.getGGGYlm(33)[1](1, 1) == Approx(0));
441  CHECK(ct.getGGGYlm(33)[1](1, 2) == Approx(13.0173832973));
442  CHECK(ct.getGGGYlm(33)[1](2, 0) == Approx(12.0160461206));
443  CHECK(ct.getGGGYlm(33)[1](2, 1) == Approx(13.0173832973));
444  CHECK(ct.getGGGYlm(33)[1](2, 2) == Approx(0));
445  CHECK(ct.getGGGYlm(33)[2](0, 0) == Approx(0));
446  CHECK(ct.getGGGYlm(33)[2](0, 1) == Approx(12.0160461206));
447  CHECK(ct.getGGGYlm(33)[2](0, 2) == Approx(0));
448  CHECK(ct.getGGGYlm(33)[2](1, 0) == Approx(12.0160461206));
449  CHECK(ct.getGGGYlm(33)[2](1, 1) == Approx(13.0173832973));
450  CHECK(ct.getGGGYlm(33)[2](1, 2) == Approx(0));
451  CHECK(ct.getGGGYlm(33)[2](2, 0) == Approx(0));
452  CHECK(ct.getGGGYlm(33)[2](2, 1) == Approx(0));
453  CHECK(ct.getGGGYlm(33)[2](2, 2) == Approx(0));
454 
455 
456  CHECK(ct.getGGGYlm(80)[0](0, 0) == Approx(0));
457  CHECK(ct.getGGGYlm(80)[0](0, 1) == Approx(0));
458  CHECK(ct.getGGGYlm(80)[0](0, 2) == Approx(0));
459  CHECK(ct.getGGGYlm(80)[0](1, 0) == Approx(0));
460  CHECK(ct.getGGGYlm(80)[0](1, 1) == Approx(27.8256449422));
461  CHECK(ct.getGGGYlm(80)[0](1, 2) == Approx(-66.7815478613));
462  CHECK(ct.getGGGYlm(80)[0](2, 0) == Approx(0));
463  CHECK(ct.getGGGYlm(80)[0](2, 1) == Approx(-66.7815478613));
464  CHECK(ct.getGGGYlm(80)[0](2, 2) == Approx(53.425238289));
465  CHECK(ct.getGGGYlm(80)[1](0, 0) == Approx(0));
466  CHECK(ct.getGGGYlm(80)[1](0, 1) == Approx(27.8256449422));
467  CHECK(ct.getGGGYlm(80)[1](0, 2) == Approx(-66.7815478613));
468  CHECK(ct.getGGGYlm(80)[1](1, 0) == Approx(27.8256449422));
469  CHECK(ct.getGGGYlm(80)[1](1, 1) == Approx(30.1444486874));
470  CHECK(ct.getGGGYlm(80)[1](1, 2) == Approx(-144.6933537));
471  CHECK(ct.getGGGYlm(80)[1](2, 0) == Approx(-66.7815478613));
472  CHECK(ct.getGGGYlm(80)[1](2, 1) == Approx(-144.6933537));
473  CHECK(ct.getGGGYlm(80)[1](2, 2) == Approx(173.632024439));
474  CHECK(ct.getGGGYlm(80)[2](0, 0) == Approx(0));
475  CHECK(ct.getGGGYlm(80)[2](0, 1) == Approx(-66.7815478613));
476  CHECK(ct.getGGGYlm(80)[2](0, 2) == Approx(53.425238289));
477  CHECK(ct.getGGGYlm(80)[2](1, 0) == Approx(-66.7815478613));
478  CHECK(ct.getGGGYlm(80)[2](1, 1) == Approx(-144.6933537));
479  CHECK(ct.getGGGYlm(80)[2](1, 2) == Approx(173.632024439));
480  CHECK(ct.getGGGYlm(80)[2](2, 0) == Approx(53.425238289));
481  CHECK(ct.getGGGYlm(80)[2](2, 1) == Approx(173.632024439));
482  CHECK(ct.getGGGYlm(80)[2](2, 2) == Approx(0));
483 }
484 } // namespace qmcplusplus
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
#define OHMMS_PRECISION
Definition: config.h:70
GGG_t getGGGYlm(int lm) const
TEST_CASE("complex_helper", "[type_traits]")
void evaluateAll(const Point_t &p)
makes a table of and their gradients up to Lmax.
The template parameters.
void evaluateWithHessian(const Point_t &p)
makes a table of and their gradients and hessians up to Lmax.
OHMMS_PRECISION real_type
Point_t getGradYlm(int lm) const
void evaluateThirdDerivOnly(const Point_t &p)
makes a table of Third derivatives of
Tensor_t getHessYlm(int lm) const
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
void evaluateWithThirdDeriv(const Point_t &p)
makes a table of and their gradients and hessians and third derivatives up to Lmax.
void evaluate(const Point_t &p)
makes a table of and their gradients up to Lmax.
value_type getYlm(int lm) const
value_type getLaplYlm(int lm) const