File: test_tdhf_dynamics.sh

package info (click to toggle)
ergo 3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 17,044 kB
  • ctags: 6,813
  • sloc: cpp: 91,488; ansic: 15,728; sh: 6,416; makefile: 1,287; yacc: 123; lex: 108
file content (284 lines) | stat: -rwxr-xr-x 5,842 bytes parent folder | download
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
#!/bin/sh

currtestdirname=tmpdir_test_tdhf_dynamics

if test "$top_builddir" = ""; then
    top_builddir=..
fi
if test "$top_srcdir" = ""; then
    top_srcdir=..
fi

. "$top_srcdir"/test/functions

# Run each test in a separate directory, to allow "make check -j" to work properly.
currdir=`pwd` ; cd $top_builddir ; top_builddir_pwd=`pwd` ; cd $currdir
rm -rf $currtestdirname ; mkdir $currtestdirname ; cd $currtestdirname
ln -s "$top_builddir_pwd"/source/ergo ./ergo

if test `./ergo -e precision` = 'single'; then
    echo SKIPPED
    exit 0
fi

errorfilename=ergoscf.out.error.tdhfdynamics

echo

echo Testing H2 HF/6-311++Gss followed by TDHF electron dynamics
rm -f ergoscf.out
./ergo <<EOINPUT 
use_simple_starting_guess = 1
scf.convergence_threshold = 1e-5
do_electron_dynamics_after_scf = 1
J_K.threshold_1el = 1e-13
J_K.threshold_2el_J = 1e-12
J_K.threshold_2el_K = 1e-10
basis = "6-311++Gss"
molecule_inline Angstrom
H  0.0   0.0   0.7354
H  0.0   0.0   0.0
EOF
run "HF"
EOINPUT
if 
check_final_energy -1.1325074 1e-5 ; 
then
echo Energy OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

# Check instantaneous dipole values. For values that are
# minima or maxima we use a tighter error tolerance since
# those values should be easier to reproduce, less
# dependent on small shifts in time.

if 
check_tdhf_dipole_at_time      0    -0.00000  1e-2  ;
then
echo Dipole value at time 0 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      14    0.10866  1e-2  ;
then
echo Dipole value at time 14 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      21    0.14173  1e-2  ;
then
echo Dipole value at time 21 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      28    0.08504  2e-2  ;
then
echo Dipole value at time 28 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      45    -0.34016  1e-2  ;
then
echo Dipole value at time 45 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      49    -0.37323  2e-2  ;
then
echo Dipole value at time 49 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      54    -0.34016  3e-2  ;
then
echo Dipole value at time 54 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      75    0.47717  2e-2  ;
then
echo Dipole value at time 75 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      79    0.50079  1e-2  ;
then
echo Dipole value at time 79 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      83    0.46299  2e-2  ;
then
echo Dipole value at time 83 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      105    -0.44409  3e-2  ;
then
echo Dipole value at time 105 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      107    -0.47717  1e-2  ;
then
echo Dipole value at time 107 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      110    -0.45354  1e-2  ;
then
echo Dipole value at time 110 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      114    -0.48189  1e-2  ;
then
echo Dipole value at time 114 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

if 
check_tdhf_dipole_at_time      116    -0.43465  2e-2  ;
then
echo Dipole value at time 116 OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi


# More data if needed:
# (this data is supposed to be (almost) from fig 4a 
# in Li et al Phys. Chem. Chem. Phys., 2005, 7, 233–239:
# "A time-dependent Hartree-Fock approach for studying the electronic optical response of molecules in intense fields"
#
# The values were produced by Elias pointing with the mouse
# and looking at pixel indexes in gimp, so they are only rough values.
#
#     0.00000    -0.00000
#    13.50932     0.10866
#    20.96273     0.14173
#    27.95031     0.08504
#    31.67702     0.00472
#    45.18634    -0.34016
#    49.37888    -0.37323
#    53.57143    -0.34016
#    64.75155     0.10394
#    75.46584     0.47717
#    78.72671     0.50079
#    82.91925     0.46299
#    88.97516     0.26457
#    93.63354     0.00472
#    99.68944    -0.20315
#   104.81366    -0.44409
#   106.67702    -0.47717
#   110.40373    -0.45354
#   114.13043    -0.48189
#   116.45963    -0.43465
#   123.44720    -0.05669
#   130.90062     0.20315
#   134.62733     0.35906
#   136.95652     0.39685
#   141.61491     0.30709
#   145.34161     0.35906
#   148.13665     0.29291
#   153.26087     0.04252
#   155.12422    -0.00000
#   158.85093     0.02835
#   160.71429    -0.00945
#   163.50932    -0.14173
#   166.30435    -0.21260
#   172.82609    -0.04252
#   177.95031    -0.11811
#   187.26708     0.04724
#   194.25466    -0.06142
#   200.77640     0.08504
#   207.29814    -0.08504
#   213.35404     0.08976
#   219.40994    -0.06614
#   225.00000     0.04724



cd ..
rm -r $currtestdirname

echo
echo TDHF-dynamics tests completed successfully!
echo