-
Notifications
You must be signed in to change notification settings - Fork 4
/
gen_ae_orbitals.py
54 lines (40 loc) · 1.31 KB
/
gen_ae_orbitals.py
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
#!/usr/bin/env python
from pstudio import AE, set_output
from pstudio.all_electron import AEwfc
from pstudio.periodic_table import tuple_to_configuration, parse_configuration, Element
from pstudio.confinement import ConfinementPotential
import numpy as np
from math import pi
import os, os.path
set_output('-')
r0 = 4.0/0.52917
confinement = ConfinementPotential('woods-saxon', r0=r0, W=2.0, a=4.0)
try:
os.mkdir('BASIS')
except FileExistsError:
pass
for z in range(1,95):
el = Element(z)
print(el.name, el.configuration)
config = parse_configuration(el.configuration)
n_max = [0,1,2,3]
for (n,l,occ) in config:
if n > n_max[l]:
n_max[l] = n
for l in (0,1,2,3):
config.append((n_max[l]+1,l,0.0))
print(el.name, tuple_to_configuration(config))
try:
os.mkdir('BASIS/'+el.symbol)
except FileExistsError:
pass
ae = AE(el.symbol, config=tuple_to_configuration(config), xcname='LDA', relativity='SR', confinement=confinement)
try:
ae.run(verbose=True)
except RuntimeError as err:
print(err)
for orb in ae.orbitals:
label = '{0}{1}.dat'.format(orb.n,'SPDF'[orb.l])
with open(os.path.join('BASIS', el.symbol, label), 'wt') as f:
np.savetxt(f, np.column_stack((ae.rgd.r, orb.ur)))
quit()