-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmswavef.pro
595 lines (549 loc) · 24.6 KB
/
mswavef.pro
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
; routines for calculation of hydrogenic and non-hydrogenic QDT momentum space wavefunctions
;
; Paul Barklem
; Jan-March 2010 - written; original version only for neutral atoms
; September 2015 - testing and release
; December 2022 - extension to positive ions and testing
;
; notes: 1. QDT functions for l < 14 can be calculated easily with analytic functions,
; but higher l uses series expansions which are very slow to compute
; - if l > 13 needed, best to derive those Hankel transforms analytically
; 2. There may be phase differences of factor -1 between different calculations
; - irrelevant for me since I want the square
; 3. Note limited validity of Coulomb approximation for gwf
; - gwfsq derives the square of the wavefunction for all momenta by taking QDT
; where valid and interpolating in hydrogenic wfs outside
function Fnl, A, ION, n, l, p
; calculates the hydrogenic wavefunction in momentum space
; follows Bransden and Joachain, Physics of Atoms and Molecules, 2nd edition appendix 5
;
; where:
; A is the atomic mass in units of proton mass
; ION is the total charge on the atom (0 = neutral, 1=singly ionised)
; n, l are usual quantum numbers
; p is momentum in au
ZZ = ION + 1 ; charge on core (i.e atom minus Rydberg electron)
mu = A * 1836.15 / (A * 1836.15 + 1.) ; reduced mass of the core-electron system in au
pmu = mu ; p0 = 1 in au, multiply by mu/m to correct for reduced mass
ps = p/(ZZ*pmu) ; corrections for Z and mu
nd = double(n)
ld = double(l)
n2ps2 = nd*nd*ps*ps
normcorr = (ZZ*pmu)^(-1.5d0) ; normalisation correction for charged case
part1 = sqrt(2.d0*factorial(n-l-1)/!pi/factorial(n+l))
part2 = nd*nd*2.d0^(2*ld+2)*factorial(l)
part3 = nd^ld*ps^ld/((n2ps2+1.d0)^(ld+2))
x = (n2ps2-1.d0)/(n2ps2+1.d0)
part4 = Gegenbauer(x,l+1,n-l-1)
return, part1 * part2 * part3 * part4 * normcorr
end
function gegenbauer, x, alpha, n
; calculates the Gegenbauer polynomial
if n lt 0 or n ne fix(n) then begin
print, ' Gegenbauer: n<0 or non-integer not permitted'
stop
endif
case n of
0: C = 1.d0
1: C = 2.d0 * alpha * x
else: begin
Cm2 = 1.d0
Cm1 = 2.d0 * alpha * x
for m = 2, n do begin
C = (2.d0*x*(m+alpha-1.d0)*Cm1/m - (m+2.d0*alpha-2.d0)*Cm2/m)
Cm2 = Cm1
Cm1 = C
endfor
end
endcase
return, C
end
function hankel, q, nu, l, t
; the Hankel tranform we need by making appropriate substitutions to get
; eq 31 in Hoang Binh and van Regemorter
;
; for l < 14 we use analytic expressions calculated with Mathematica
case l of
0 : x = sqrt(2./!pi) * gamma(nu-t+1) * ((1./nu/nu + q*q)^((-nu+t-1)/2.))*sin((nu-t+1)*atan(q*nu))
1 : x = sqrt(2./!pi)/q * gamma(nu-t) * ((1./nu/nu + q*q)^((-nu+t)/2.))*sin((nu-t)*atan(q*nu)) $
-sqrt(2./!pi) * gamma(nu-t+1) * ((1./nu/nu + q*q)^((-nu+t-1)/2.))*cos((nu-t+1)*atan(q*nu))
2 : x = -((nu^(-1 + nu - t)*Sqrt(2/!Pi)* $
(1 + nu^2*q^2)^((-1 - nu + t)/2.)* $
Gamma(-1 + nu - t)* $
(3*nu*q*Sqrt(1 + nu^2*q^2)*(-1 + nu - t)* $
Cos((-nu + t)*atan(nu*q)) + $
nu^2*q^2*((-1 + nu)*nu + t - 2*nu*t + t^2)* $
Sin((1 + nu - t)*atan(nu*q)) + $
3*(1 + nu^2*q^2)*Sin((1 - nu + t)*atan(nu*q))))/ $
q^2)
3 : x = (nu^(-2 + nu - t)*Sqrt(2/!Pi)* $
(1 + nu^2*q^2)^((-1 - nu + t)/2.)* $
(-15*nu*q*(1 + nu^2*q^2)* $
Cos((1 - nu + t)*atan(nu*q))*Gamma(-1 + nu - t) + $
nu^3*q^3*Cos((1 + nu - t)*atan(nu*q))* $
Gamma(1 + nu - t) + $
3*Sqrt(1 + nu^2*q^2)* $
(2*nu^2*q^2*Gamma(nu - t)* $
Sin((-nu + t)*atan(nu*q)) - $
5*(1 + nu^2*q^2)*Gamma(-2 + nu - t)* $
Sin((2 - nu + t)*atan(nu*q)))))/q^3
4 : x = (nu^(-3 + nu - t)*Sqrt(2/!Pi)* $
(1 + nu^2*q^2)^((-1 - nu + t)/2.)* $
(-105*nu*q*(1 + nu^2*q^2)^1.5* $
Cos((2 - nu + t)*atan(nu*q))*Gamma(-2 + nu - t) + $
10*nu^3*q^3*Sqrt(1 + nu^2*q^2)* $
Cos((-nu + t)*atan(nu*q))*Gamma(nu - t) + $
nu^4*q^4*Gamma(1 + nu - t)* $
Sin((1 + nu - t)*atan(nu*q)) + $
45*nu^2*q^2*Gamma(-1 + nu - t)* $
Sin((1 - nu + t)*atan(nu*q)) + $
45*nu^4*q^4*Gamma(-1 + nu - t)* $
Sin((1 - nu + t)*atan(nu*q)) - $
105*Gamma(-3 + nu - t)* $
Sin((3 - nu + t)*atan(nu*q)) - $
210*nu^2*q^2*Gamma(-3 + nu - t)* $
Sin((3 - nu + t)*atan(nu*q)) - $
105*nu^4*q^4*Gamma(-3 + nu - t)* $
Sin((3 - nu + t)*atan(nu*q))))/q^4
5 : x = -((nu^(-4 + nu - t)*Sqrt(2/!Pi)* $
(1 + nu^2*q^2)^((-1 - nu + t)/2.)* $
(945*nu*q*(1 + nu^2*q^2)^2* $
Cos((3 - nu + t)*atan(nu*q))*Gamma(-3 + nu - t) - $
105*nu^3*q^3*(1 + nu^2*q^2)* $
Cos((1 - nu + t)*atan(nu*q))*Gamma(-1 + nu - t) + $
nu^5*q^5*Cos((1 + nu - t)*atan(nu*q))* $
Gamma(1 + nu - t) + $
15*nu^4*q^4*Sqrt(1 + nu^2*q^2)*Gamma(nu - t)* $
Sin((-nu + t)*atan(nu*q)) - $
420*nu^2*q^2*Sqrt(1 + nu^2*q^2)* $
Gamma(-2 + nu - t)*Sin((2 - nu + t)*atan(nu*q)) - $
420*nu^4*q^4*Sqrt(1 + nu^2*q^2)* $
Gamma(-2 + nu - t)*Sin((2 - nu + t)*atan(nu*q)) + $
945*Sqrt(1 + nu^2*q^2)*Gamma(-4 + nu - t)* $
Sin((4 - nu + t)*atan(nu*q)) + $
1890*nu^2*q^2*Sqrt(1 + nu^2*q^2)* $
Gamma(-4 + nu - t)*Sin((4 - nu + t)*atan(nu*q)) + $
945*nu^4*q^4*Sqrt(1 + nu^2*q^2)* $
Gamma(-4 + nu - t)*Sin((4 - nu + t)*atan(nu*q))))/ $
q^5)
6 : x = -((nu^(nu - t)*Sqrt(2/!Pi)* $
(1 + nu^2*q^2)^((-nu + t)/2.)*Gamma(-5 + nu - t)* $
(-21*q^5*(1 - nu + t)*(2 - nu + t)*(3 - nu + t)* $
(4 - nu + t)*(5 - nu + t)* $
Cos((-nu + t)*atan(nu*q)) + $
(1260*q^3*(1 + nu^2*q^2)*(3 - nu + t)* $
(4 - nu + t)*(5 - nu + t)* $
Cos((2 - nu + t)*atan(nu*q)))/nu^2 + $
(10395*q*(1 + nu^2*q^2)^2*(-5 + nu - t)* $
Cos((4 - nu + t)*atan(nu*q)))/nu^4 + $
(nu*q^6*(-5 + nu - t)*(-4 + nu - t)*(-3 + nu - t)* $
(-2 + nu - t)*(-1 + nu - t)*(nu - t)* $
Sin((1 + nu - t)*atan(nu*q)))/ $
Sqrt(1 + nu^2*q^2) + $
(210*q^4*Sqrt(1 + nu^2*q^2)*(-5 + nu - t)* $
(-4 + nu - t)*(-3 + nu - t)*(-2 + nu - t)* $
Sin((1 - nu + t)*atan(nu*q)))/nu - $
(4725*q^2*(1 + nu^2*q^2)^1.5*(-5 + nu - t)* $
(-4 + nu - t)*Sin((3 - nu + t)*atan(nu*q)))/ $
nu^3 + (10395*(1 + nu^2*q^2)^2.5* $
Sin((5 - nu + t)*atan(nu*q)))/nu^5))/q^6)
7 : x = (nu^(nu - t)*Sqrt(2/!Pi)*(1 + nu^2*q^2)^((-nu + t)/2.)*$
((-135135*q*(1 + nu^2*q^2)^2.5*$
Cos((5 - nu + t)*atan(nu*q))*Gamma(-5 + nu - t))/$
nu^5 + (17325*q^3*(1 + nu^2*q^2)^1.5*$
Cos((3 - nu + t)*atan(nu*q))*Gamma(-3 + nu - t))/$
nu^3 - (378*q^5*Sqrt(1 + nu^2*q^2)*$
Cos((1 - nu + t)*atan(nu*q))*Gamma(-1 + nu - t))/$
nu + (nu*q^7*Cos((1 + nu - t)*atan(nu*q))*$
Gamma(1 + nu - t))/Sqrt(1 + nu^2*q^2) + $
28*q^6*Gamma(nu - t)*Sin((-nu + t)*atan(nu*q)) - $
(3150*q^4*(1 + nu^2*q^2)*Gamma(-2 + nu - t)*$
Sin((2 - nu + t)*atan(nu*q)))/nu^2 + $
(62370*(q + nu^2*q^3)^2*Gamma(-4 + nu - t)*$
Sin((4 - nu + t)*atan(nu*q)))/nu^4 - $
(135135*(1 + nu^2*q^2)^3*Gamma(-6 + nu - t)*$
Sin((6 - nu + t)*atan(nu*q)))/nu^6))/q^7
8 : x = (nu^(nu - t)*Sqrt(2/!Pi)*(1 + nu^2*q^2)^((-nu + t)/2.)*$
((-2027025*q*(1 + nu^2*q^2)^3*$
Cos((6 - nu + t)*atan(nu*q))*Gamma(-6 + nu - t))/$
nu^6 + (270270*q^3*(1 + nu^2*q^2)^2*$
Cos((4 - nu + t)*atan(nu*q))*Gamma(-4 + nu - t))/$
nu^4 - (6930*q^5*(1 + nu^2*q^2)*$
Cos((2 - nu + t)*atan(nu*q))*Gamma(-2 + nu - t))/$
nu^2 + 36*q^7*Cos((-nu + t)*atan(nu*q))*$
Gamma(nu - t) + $
(nu*q^8*Gamma(1 + nu - t)*$
Sin((1 + nu - t)*atan(nu*q)))/Sqrt(1 + nu^2*q^2)$
+ (630*q^6*Sqrt(1 + nu^2*q^2)*Gamma(-1 + nu - t)*$
Sin((1 - nu + t)*atan(nu*q)))/nu - $
(51975*q^4*(1 + nu^2*q^2)^1.5*Gamma(-3 + nu - t)*$
Sin((3 - nu + t)*atan(nu*q)))/nu^3 + $
(945945*q^2*(1 + nu^2*q^2)^2.5*Gamma(-5 + nu - t)*$
Sin((5 - nu + t)*atan(nu*q)))/nu^5 - $
(2027025*(1 + nu^2*q^2)^3.5*Gamma(-7 + nu - t)*$
Sin((7 - nu + t)*atan(nu*q)))/nu^7))/q^8
9 : x = (nu^(nu - t)*Sqrt(2/!Pi)*(1 + nu^2*q^2)^((-nu + t)/2.)*$
((-34459425*q*(1 + nu^2*q^2)^3.5*$
Cos((7 - nu + t)*atan(nu*q))*Gamma(-7 + nu - t))/$
nu^7 + (4729725*q^3*(1 + nu^2*q^2)^2.5*$
Cos((5 - nu + t)*atan(nu*q))*Gamma(-5 + nu - t))/$
nu^5 - (135135*q^5*(1 + nu^2*q^2)^1.5*$
Cos((3 - nu + t)*atan(nu*q))*Gamma(-3 + nu - t))/$
nu^3 + (990*q^7*Sqrt(1 + nu^2*q^2)*$
Cos((1 - nu + t)*atan(nu*q))*Gamma(-1 + nu - t))/$
nu - (nu*q^9*Cos((1 + nu - t)*atan(nu*q))*$
Gamma(1 + nu - t))/Sqrt(1 + nu^2*q^2) - $
45*q^8*Gamma(nu - t)*Sin((-nu + t)*atan(nu*q)) + $
(13860*q^6*(1 + nu^2*q^2)*Gamma(-2 + nu - t)*$
Sin((2 - nu + t)*atan(nu*q)))/nu^2 - $
(945945*q^4*(1 + nu^2*q^2)^2*Gamma(-4 + nu - t)*$
Sin((4 - nu + t)*atan(nu*q)))/nu^4 + $
(16216200*q^2*(1 + nu^2*q^2)^3*Gamma(-6 + nu - t)*$
Sin((6 - nu + t)*atan(nu*q)))/nu^6 - $
(34459425*(1 + nu^2*q^2)^4*Gamma(-8 + nu - t)*$
Sin((8 - nu + t)*atan(nu*q)))/nu^8))/q^9
10 :x = -((nu^(nu - t)*Sqrt(2/!Pi)* $
(1 + nu^2*q^2)^((-nu + t)/2.)*$
((654729075*q*(1 + nu^2*q^2)^4*$
Cos((8 - nu + t)*atan(nu*q))*Gamma(-8 + nu - t))$
/nu^8 - (91891800*(q + nu^2*q^3)^3*$
Cos((6 - nu + t)*atan(nu*q))*Gamma(-6 + nu - t))$
/nu^6 + (2837835*q^5*(1 + nu^2*q^2)^2*$
Cos((4 - nu + t)*atan(nu*q))*Gamma(-4 + nu - t))$
/nu^4 - (25740*q^7*(1 + nu^2*q^2)*$
Cos((2 - nu + t)*atan(nu*q))*Gamma(-2 + nu - t))$
/nu^2 + 55*q^9*Cos((-nu + t)*atan(nu*q))*$
Gamma(nu - t) + $
(nu*q^10*Gamma(1 + nu - t)*$
Sin((1 + nu - t)*atan(nu*q)))/$
Sqrt(1 + nu^2*q^2) + $
(1485*q^8*Sqrt(1 + nu^2*q^2)*Gamma(-1 + nu - t)*$
Sin((1 - nu + t)*atan(nu*q)))/nu - $
(315315*q^6*(1 + nu^2*q^2)^1.5*$
Gamma(-3 + nu - t)*Sin((3 - nu + t)*atan(nu*q)))$
/nu^3 + (18918900*q^4*(1 + nu^2*q^2)^2.5*$
Gamma(-5 + nu - t)*Sin((5 - nu + t)*atan(nu*q)))$
/nu^5 - (310134825*q^2*(1 + nu^2*q^2)^3.5*$
Gamma(-7 + nu - t)*Sin((7 - nu + t)*atan(nu*q)))$
/nu^7 + (654729075*(1 + nu^2*q^2)^4.5*$
Gamma(-9 + nu - t)*Sin((9 - nu + t)*atan(nu*q)))$
/nu^9))/q^10)
11 :x = (nu^(nu - t)*Sqrt(2/!Pi)*(1 + nu^2*q^2)^((-nu + t)/2.)*$
((-13749310575*q*(1 + nu^2*q^2)^4.5*$
Cos((9 - nu + t)*atan(nu*q))*Gamma(-9 + nu - t))/$
nu^9 + (1964187225*q^3*(1 + nu^2*q^2)^3.5*$
Cos((7 - nu + t)*atan(nu*q))*Gamma(-7 + nu - t))/$
nu^7 - (64324260*q^5*(1 + nu^2*q^2)^2.5*$
Cos((5 - nu + t)*atan(nu*q))*Gamma(-5 + nu - t))/$
nu^5 + (675675*q^7*(1 + nu^2*q^2)^1.5*$
Cos((3 - nu + t)*atan(nu*q))*Gamma(-3 + nu - t))/$
nu^3 - (2145*q^9*Sqrt(1 + nu^2*q^2)*$
Cos((1 - nu + t)*atan(nu*q))*Gamma(-1 + nu - t))/$
nu + (nu*q^11*Cos((1 + nu - t)*atan(nu*q))*$
Gamma(1 + nu - t))/Sqrt(1 + nu^2*q^2) + $
66*q^10*Gamma(nu - t)*Sin((-nu + t)*atan(nu*q)) - $
(45045*q^8*(1 + nu^2*q^2)*Gamma(-2 + nu - t)*$
Sin((2 - nu + t)*atan(nu*q)))/nu^2 + $
(7567560*q^6*(1 + nu^2*q^2)^2*Gamma(-4 + nu - t)*$
Sin((4 - nu + t)*atan(nu*q)))/nu^4 - $
(413513100*q^4*(1 + nu^2*q^2)^3*Gamma(-6 + nu - t)*$
Sin((6 - nu + t)*atan(nu*q)))/nu^6 + $
(6547290750*q^2*(1 + nu^2*q^2)^4*$
Gamma(-8 + nu - t)*Sin((8 - nu + t)*atan(nu*q)))/$
nu^8 - (13749310575*(1 + nu^2*q^2)^5*$
Gamma(-10 + nu - t)*Sin((10 - nu + t)*atan(nu*q)))$
/nu^10))/q^11
12 :x = (Sqrt(2/!Pi)*(-316234143225*(1/nu)^(-nu + t)*q*$
(nu^(-2) + q^2)^5*(1 + nu^2*q^2)^((-nu + t)/2.)*$
Cos(10*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-10 + nu - t) + $
45831035250*(1/nu)^(-nu + t)*q^3*$
(nu^(-2) + q^2)^4*(1 + nu^2*q^2)^((-nu + t)/2.)*$
Cos(8*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-8 + nu - t) - $
1571349780*(1/nu)^(-nu + t)*q^5*(nu^(-2) + q^2)^3*$
(1 + nu^2*q^2)^((-nu + t)/2.)*$
Cos(6*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-6 + nu - t) + $
18378360*(1/nu)^(-nu + t)*q^7*(nu^(-2) + q^2)^2*$
(1 + nu^2*q^2)^((-nu + t)/2.)*$
Cos(4*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-4 + nu - t) - $
75075*(1/nu)^(-nu + t)*q^9*(nu^(-2) + q^2)*$
(1 + nu^2*q^2)^((-nu + t)/2.)*$
Cos(2*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-2 + nu - t) + $
78*(1/nu)^(-nu + t)*q^11*$
(1 + nu^2*q^2)^((-nu + t)/2.)*$
Cos(nu*atan(nu*q) - t*atan(nu*q))*Gamma(nu - t) + $
(1/nu)^(-1 - nu + t)*q^12*$
(1 + nu^2*q^2)^((-1 - nu + t)/2.)*$
Gamma(1 + nu - t)*$
Sin(atan(nu*q) + nu*atan(nu*q) - t*atan(nu*q)) $
+ 3003*(1/nu)^(1 - nu + t)*q^10*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Gamma(-1 + nu - t)*$
Sin(atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q)) $
- 1351350*(1/nu)^(1 - nu + t)*q^8*(nu^(-2) + q^2)*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Gamma(-3 + nu - t)*$
Sin(3*atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))$
+ 192972780*(1/nu)^(1 - nu + t)*q^6*$
(nu^(-2) + q^2)^2*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Gamma(-5 + nu - t)*$
Sin(5*atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))$
- 9820936125*(1/nu)^(1 - nu + t)*q^4*$
(nu^(-2) + q^2)^3*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Gamma(-7 + nu - t)*$
Sin(7*atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))$
+ 151242416325*(1/nu)^(1 - nu + t)*q^2*$
(nu^(-2) + q^2)^4*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Gamma(-9 + nu - t)*$
Sin(9*atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))$
- 316234143225*(1/nu)^(1 - nu + t)*$
(nu^(-2) + q^2)^5*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Gamma(-11 + nu - t)*$
Sin(11*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))))/q^12
13: x = (Sqrt(2/!Pi)*(-7905853580625*(1/nu)^(1 - nu + t)*q*$
(nu^(-2) + q^2)^5*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Cos(11*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-11 + nu - t) + $
1159525191825*(1/nu)^(1 - nu + t)*q^3*$
(nu^(-2) + q^2)^4*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Cos(9*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-9 + nu - t) - $
41247931725*(1/nu)^(1 - nu + t)*q^5*$
(nu^(-2) + q^2)^3*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Cos(7*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-7 + nu - t) + $
523783260*(1/nu)^(1 - nu + t)*q^7*$
(nu^(-2) + q^2)^2*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Cos(5*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-5 + nu - t) - $
2552550*(1/nu)^(1 - nu + t)*q^9*(nu^(-2) + q^2)*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Cos(3*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))*Gamma(-3 + nu - t) + $
4095*(1/nu)^(1 - nu + t)*q^11*$
(1 + nu^2*q^2)^((1 - nu + t)/2.)*$
Cos(atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))*$
Gamma(-1 + nu - t) - $
(1/nu)^(-1 - nu + t)*q^13*$
(1 + nu^2*q^2)^((-1 - nu + t)/2.)*$
Cos(atan(nu*q) + nu*atan(nu*q) - t*atan(nu*q))*$
Gamma(1 + nu - t) + $
91*(1/nu)^(-nu + t)*q^12*$
(1 + nu^2*q^2)^((-nu + t)/2.)*Gamma(nu - t)*$
Sin(nu*atan(nu*q) - t*atan(nu*q)) + $
120120*(1/nu)^(-nu + t)*q^10*(nu^(-2) + q^2)*$
(1 + nu^2*q^2)^((-nu + t)/2.)*Gamma(-2 + nu - t)*$
Sin(2*atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))$
- 41351310*(1/nu)^(-nu + t)*q^8*$
(nu^(-2) + q^2)^2*(1 + nu^2*q^2)^((-nu + t)/2.)*$
Gamma(-4 + nu - t)*$
Sin(4*atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))$
+ 5237832600*(1/nu)^(-nu + t)*q^6*$
(nu^(-2) + q^2)^3*(1 + nu^2*q^2)^((-nu + t)/2.)*$
Gamma(-6 + nu - t)*$
Sin(6*atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))$
- 252070693875*(1/nu)^(-nu + t)*q^4*$
(nu^(-2) + q^2)^4*(1 + nu^2*q^2)^((-nu + t)/2.)*$
Gamma(-8 + nu - t)*$
Sin(8*atan(nu*q) - nu*atan(nu*q) + t*atan(nu*q))$
+ 3794809718700*(1/nu)^(-nu + t)*q^2*$
(nu^(-2) + q^2)^5*(1 + nu^2*q^2)^((-nu + t)/2.)*$
Gamma(-10 + nu - t)*$
Sin(10*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q)) - $
7905853580625*(1/nu)^(-nu + t)*(nu^(-2) + q^2)^6*$
(1 + nu^2*q^2)^((-nu + t)/2.)*Gamma(-12 + nu - t)*$
Sin(12*atan(nu*q) - nu*atan(nu*q) + $
t*atan(nu*q))))/q^13
else: begin
print, 'llow > 13: slow calculation - not recommended!'
a = 1./double(nu)
b = double(q)
nup = l+0.5
mu = double(nu) - t + 1.5
x = watson(a,b,nup,mu) * sqrt(b)
end
endcase
return, x
end
function hyper2F1, a, b, c, z
; calculates the 2F1 hypergeometric series
if (a eq 0.) or (b eq 0.) or (c eq 0.) then return, 0.d0
errlim = 1d-16
err = 1d10
sum = 0.d0
n = 0l
np = fix(6000*z)>100 ; number of terms per iteration, some tests showed this quite good
prodlast = 1.d0
while (err gt errlim) do begin
nn = n + indgen(np)
prod = nn * 0.d0 + 1.d0
iarr = [0.d0, dindgen(nn[np-1])]
iarr = iarr[nn[0]:nn[np-1]]
; term by term evaluation of product for numerical precision
; product is accumulated for speed
parr = (a+iarr) / (c+iarr) * (b+iarr) / (iarr+1.)
prod[0] = prodlast
if nn[0] ge 1 then prod[0] = prodlast*parr[0]
for i = 1, np-1 do prod[i] = prod[i-1]*parr[i]
term = prod * double(z)^nn
if n gt 1000 then err = abs(total(term))/abs(sum) else err = min(abs(term))/abs(sum)
sum = sum + total(term)
n = n + np
prodlast = prod[np-1]
endwhile
return, sum
end
function watson, a, b, nu, mu
; general Hankel transform int(exp(-at) J_nu(bt) t^(mu-1) dt, 0, infinity)
; pg 385, Watson - Theory of Bessel functions
;
; there are alternate expressions for this given by Watson
; this expression is chosen since z < 1 always.
; This means the 2F1 should converge
ad = double(a)
bd = double(b)
nud= double(nu)
mud = double(mu)
asqbsq = ad*ad+bd*bd
nuplmu = nud + mud
term1 = (0.5*bd)^nud * gamma(nuplmu) / (asqbsq)^(0.5*(nuplmu)) / gamma(nud+1)
term2 = hyper2F1((nuplmu)/2., (1.-mud+nud)/2., nud+1, bd*bd/(asqbsq))
return, term1*term2
end
function Knorm, nu, l
; normalisation factor from Hoang Binh and van Regemorter, eq 15
; assuming eta = 1, true if nu is not small
nud = double(nu)
return, 1.d0/(nud*sqrt(gamma(nud+l+1)*gamma(nud-l)))
end
function bfunc, nu, l, t
; calculate the b coefficients
; the expressions of Bates and Damgaard 1949 are used since they work everywhere (even at integer nu values)
; if one doesn't have small, integer nu values then one could use:
; b = (-1.d0)^td * gamma(-nu+l+1+td)*gamma(-nu-l+td)/gamma(-nu+l+1)/gamma(-nu-l)/factorial(td) *(nu/2.d0)^td
; from Hoang Binh and van Regemorter, but note (nu/2)^t term is missing from paper
;
; The two methods seem to be equivalent to very good precision even at large nu and l
td = double(t)
if t eq 0 then begin
b = 1.
endif
if t ge 1 then begin
blast = 1.
for i = 1, t do begin
b = -nu/2./i * (nu-l-i)*(nu+l+1.-i) * blast
blast = b
endfor
endif
return, b
end
function gwf_neutral, nu, l, q
; the QDT non-hydrogenic wavefunction in momentum space,
; for a valence electron in a neutral atom (core Z=1)
; following Hoang Binh and van Regemorter (1997)
; where:
; nu is the effective principal quantum number
; l is angular momentum quantum number
; q is momentum in atomic units
; normalisation is Integral |g|^2 q^2 dq = 1
;
; note due to machine numerical precision limits, if nu > 24, we use the nearest hydrogenic wavefunction
; presently doesn't account for reduced mass effects, i.e. assumes infinite mass, but effects small even for hydrogen
nud = double(nu)
nq = n_elements(q)
wf = dblarr(nq)
if (nu gt 20.) or (abs(nu mod 1) lt 0.001) then begin ; numerical precision limits QDT wf calc to about n*~25
; also use exact analytic expression if integer nu value (n*)
wf = Fnl(1000., 0, round(nu), l, q) ; large mass to approximate infinite
endif else begin
t0 = fix(nud + l + 1.)
for i = 0, nq-1 do begin
if q[i] le 0.d0 then begin
wf[i] = 0.d0
endif else begin
term1 = Knorm(nud, l)/q[i] * (2.d0/nud)^nud
sum = 0.d0
for t = 0, t0 do begin
term2 = bfunc(nud, l, t) * hankel(q[i], nud, l, t)
sum = sum + term2
endfor
wf[i] = sum * term1
endelse
endfor
endelse
return, wf
end
function gwf, ion, nu, l, q
; the QDT non-hydrogenic wavefunction in momentum space,
; for ion through rescaling of neutral case
; following Bransden and Joachain, Physics of Atoms and Molecules, 2nd edition appendix 5
;
; where:
; ion is the total charge on the atom (0 = neutral, 1=singly ionised)
; nu is the effective principal quantum number
; l is angular momentum quantum number
; q is momentum in atomic units (can be an array)
; normalisation is Integral |g|^2 q^2 dq = 1
Z = ion+1 ; core charge
wf = gwf_neutral(nu, l, q/Z) / (Z^1.5d0)
return, wf
end
function gwfsq_neutral, nu, l, q
; generate a best estimate of square of wavefunction
; for the neutral atom case
nud = double(nu)
nq = n_elements(q)
wf = dblarr(nq)
; set bound for using Coulomb approx QDT functions based on empirical study accounting for
; breakdown of Coulomb approx, loss of numerical precision, and where wf has smooth behaviour
; and can be interpolated
; these cutoffs have been tested for 2.5 < nu < 20.5 and l <= 13
qbar = 2/!pi/nud
qmin = qbar
if nu le 11. then qmin = qbar / 2.
if nu le 8. then qmin = qbar / 4.
qmax = (nu - l + 1) * qbar ; this seems to work ok.
if nu ge 8.5 then qmax = ((nu - l)>2) * qbar
if nu ge 11.5 then qmax = ((nu - l - 1)/2.>2) * qbar
nup = fix(nud+1) ; nearest integers n
num = fix(nud)
if num eq l then begin
num = num+1
nup = nup+1
endif
for i = 0, nq-1 do begin
if q[i] le 0.d0 then begin
wf[i] = 0.d0
endif else begin
if (q[i] lt qmax) and (q[i] gt qmin) then begin ; use QDT
wf[i] = gwf_neutral(nud, l, q[i])^2.
endif else begin ; linear interpolation between integer values for nu
ym = Fnl(1000., 0, num, l, q[i])^2. ; large mass to approximate infinite
yp = Fnl(1000., 0, nup, l, q[i])^2.
h = (nu - num)/(nup - num)
wf[i] = 10^(alog10(ym) + h*(alog10(yp) - alog10(ym)))
endelse
endelse
endfor
return, wf
end
function gwfsq, ion, nu, l, q
; generate a best estimate of square of wavefunction
Z = ion+1 ; core charge
wf = gwfsq_neutral(nu, l, q/Z) / (Z^3.d0)
return, wf
end