10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-22 05:02:15 +02:00

Working put_pseudo_in_ezfio

This commit is contained in:
Thomas Applencourt 2015-04-10 10:52:55 +02:00
parent 1cb79a58a4
commit 0ebbe6f820
3 changed files with 211 additions and 22 deletions

View File

@ -4,11 +4,8 @@
echo "name" $1
echo "mul" $2
echo "Zeff" $3
echo "\`get_basis.sh\` need to be changed"
rm -R $1.ezfio
qp_create_ezfio_from_xyz $1.xyz -b "cc-pvdz" -m $2
~/quantum_package/scripts/pseudo/put_pseudo_in_ezfio.py --ezfio $1.ezfio/ --atom $1 --zeff $3
qp_edit -c $1.ezfio
~/quantum_package/scripts/pseudo/put_pseudo_in_ezfio.py --ezfio $1.ezfio/ --atom $1

View File

@ -0,0 +1,118 @@
name_to_elec = {"H": 1,
"He": 2,
"Li": 3,
"Be": 4,
"B": 5,
"C": 6,
"N": 7,
"O": 8,
"F": 9,
"Ne": 10,
"Na": 11,
"Mg": 12,
"Al": 13,
"Si": 14,
"P": 15,
"S": 16,
"Cl": 17,
"Ar": 18,
"K": 19,
"Ca": 20,
"Sc": 21,
"Ti": 22,
"V": 23,
"Cr": 24,
"Mn": 25,
"Fe": 26,
"Co": 27,
"Ni": 28,
"Cu": 29,
"Zn": 30,
"Ga": 31,
"Ge": 32,
"As": 33,
"Se": 34,
"Br": 35,
"Kr": 36,
"Rb": 37,
"Sr": 38,
"Y": 39,
"Zr": 40,
"Nb": 41,
"Mo": 42,
"Tc": 43,
"Ru": 44,
"Rh": 45,
"Pd": 46,
"Ag": 47,
"Cd": 48,
"In": 49,
"Sn": 50,
"Sb": 51,
"Te": 52,
"I": 53,
"Xe": 54,
"Cs": 55,
"Ba": 56,
"La": 57,
"Ce": 58,
"Pr": 59,
"Nd": 60,
"Pm": 61,
"Sm": 62,
"Eu": 63,
"Gd": 64,
"Tb": 65,
"Dy": 66,
"Ho": 67,
"Er": 68,
"Tm": 69,
"Yb": 70,
"Lu": 71,
"Hf": 72,
"Ta": 73,
"W": 74,
"Re": 75,
"Os": 76,
"Ir": 77,
"Pt": 78,
"Au": 79,
"Hg": 80,
"Tl": 81,
"Pb": 82,
"Bi": 83,
"Po": 84,
"At": 85,
"Rn": 86,
"Fr": 87,
"Ra": 88,
"Ac": 89,
"Th": 90,
"Pa": 91,
"U": 92,
"Np": 93,
"Pu": 94,
"Am": 95,
"Cm": 96,
"Bk": 97,
"Cf": 98,
"Es": 99,
"Fm": 100,
"Md": 101,
"No": 102,
"Lr": 103,
"Rf": 104,
"Db": 105,
"Sg": 106,
"Bh": 107,
"Hs": 108,
"Mt": 109,
"Ds": 110,
"Rg": 111,
"Cn": 112,
"Uut": 113,
"Fl": 114,
"Uup": 115,
"Lv": 116,
"Uus": 117,
"Uuo": 118}

View File

@ -4,7 +4,10 @@
Create the pseudo potential for a given atom
Usage:
put_pseudo_in_ezfio.py --ezfio=<path> --atom=<atom>... --zeff=<charge>...
put_pseudo_in_ezfio.py --ezfio=<path> --atom=<atom>...
Help:
atom is the Abreviation of the atom
"""
@ -28,6 +31,24 @@ p = re.compile(ur'\|(\d+)><\d+\|')
def get_pseudo_str(l_atom):
"""
Run EMSL_local for geting the str of the speudo potential
str_ele :
Element Symbol: Na
Number of replaced protons: 10
Number of projectors: 2
Pseudopotential data:
Local component:
Coeff. r^n Exp.
1.00000000 -1 5.35838717
5.35838717 1 3.67918975
-2.07764789 0 1.60507673
Non-local component:
Coeff. r^n Exp. Proj.
10.69640234 0 1.32389367 |0><0|
10.11238853 0 1.14052020 |1><1|
"""
EMSL_root = "{0}/EMSL_Basis/".format(qpackage_root)
@ -101,13 +122,63 @@ def get_v_n_dz_l_nonlocal(str_ele):
l_dz_kl.append([dz])
if not l_v_kl:
l_v_kl.append([0.])
l_n_kl.append([0])
l_dz_kl.append([0.])
l_v_kl.append([0.])
l_n_kl.append([0])
l_dz_kl.append([0.])
return l_v_kl, l_n_kl, l_dz_kl
def get_zeff_alpha_beta(str_ele):
"""
Return the the zeff, alpha num elec and beta num elec
Assert ezfio_set_file alredy defined
"""
import re
# ___
# | ._ o _|_
# _|_ | | | |_
#
# ~#~#~#~#~#~#~ #
# s t r _ e l e #
# ~#~#~#~#~#~#~ #
m = re.search('Element Symbol: ([a-zA-Z]+)', str_ele)
name = m.group(1).capitalize()
m = re.search('Number of replaced protons: (\d+)', str_ele)
z_remove = int(m.group(1))
# ~#~#~#~#~#~#~#~#~#~ #
# F r o m _ e z f i o #
# ~#~#~#~#~#~#~#~#~#~ #
alpha = ezfio.get_electrons_elec_alpha_num()
beta = ezfio.get_electrons_elec_beta_num()
# _
# |_) _. ._ _ _
# | (_| | _> (/_
#
from elts_num_ele import name_to_elec
z = name_to_elec[name]
z_eff = z - z_remove
alpha = alpha - (z_remove / 2)
beta = beta - (z_remove / 2)
# _
# |_) _ _|_ ._ ._
# | \ (/_ |_ |_| | | |
#
return [z_eff, alpha, beta]
if __name__ == "__main__":
arguments = docopt(__doc__)
@ -142,6 +213,10 @@ if __name__ == "__main__":
l_str_ele = [str_ele for str_ele in str_.split("Element Symbol: ")
if str_ele]
l_zeff = []
alpha_tot = 0
beta_tot = 0
for str_ele in l_str_ele:
# ~#~#~#~#~ #
@ -155,14 +230,8 @@ if __name__ == "__main__":
# L o c a l #
# ~#~#~#~#~ #
print "local"
l_v, l_n, l_dz = get_v_n_dz_local(str_ele[l:nl])
print l_v
print l_n
print l_dz
ezfio.pseudo_klocmax = len(l_v)
ezfio.pseudo_v_k = l_v
ezfio.pseudo_n_k = l_n
@ -172,19 +241,24 @@ if __name__ == "__main__":
# N o n _ L o c a l #
# ~#~#~#~#~#~#~#~#~ #
print "non local"
l_v_kl, l_n_kl, l_dz_kl = get_v_n_dz_l_nonlocal(str_ele[nl:])
print l_v_kl
print l_n_kl
print l_dz_kl
ezfio.pseudo_lmaxpo = len(l_v_kl)
ezfio.pseudo_kmax = len(l_v_kl[0])
ezfio.pseudo_v_kl = l_v_kl
ezfio.pseudo_n_kl = l_n_kl
ezfio.pseudo_dz_kl = l_dz_kl
if arguments["--zeff"]:
ezfio.nuclei_nucl_charge = map(int, arguments["--zeff"])
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
# Z _ e f f , a l p h a / b e t a _ e l e c #
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
zeff, alpha, beta = get_zeff_alpha_beta(str_)
alpha_tot += alpha
beta_tot += beta
l_zeff.append(zeff)
ezfio.electrons_elec_alpha_num = alpha_tot
ezfio.electrons_elec_beta_num = beta_tot
ezfio.nuclei_nucl_charge = l_zeff