diff --git a/src/pymatgen/command_line/OxideTersoffPotentials b/src/pymatgen/command_line/OxideTersoffPotentials deleted file mode 100644 index 8f3b1522751..00000000000 --- a/src/pymatgen/command_line/OxideTersoffPotentials +++ /dev/null @@ -1,132 +0,0 @@ -H(1) O H 1.8858 2.188184 1.12768 10.0000 -Li(1) O Li 0.98816 1.937984 1.94001 10.0000 -Be(2) O Be 2.76882 1.848429 1.52217 10.0000 -B(3) O B 2.38924 2.597403 1.34003 10.0000 -C(4) O C 4.79187 2.237136 1.20089 10.0000 -C(2) O C 2.40553 2.409639 1.03098 10.0000 -N(5) O N 6.27677 2.222222 1.16142 10.0000 -N(3) O N 3.81089 2.232143 1.13758 10.0000 -NH4(1) O NH4 0.40537 2.262443 2.45364 10.0000 -Na(1) O Na 0.57523 2.074689 2.37433 10.0000 -Mg(2) O Mg 1.57554 1.953125 1.95627 10.0000 -Al(3) O Al 1.80346 2.358491 1.75806 10.0000 -Si(4) O Si 2.8572 2.314815 1.53594 10.0000 -P(5) O P 3.89635 2.28833 1.44066 10.0000 -P(3) O P 2.02062 2.487562 1.41051 10.0000 -S(6) O S 4.96726 2.267574 1.38102 10.0000 -S(4) O S 3.03672 2.34192 1.41188 10.0000 -Cl(7) O Cl 5.991 2.257336 1.34801 10.0000 -Cl(5) O Cl 4.29089 2.247191 1.35653 10.0000 -Cl(3) O Cl 3.07119 2.03666 1.38441 10.0000 -K(1) O K 0.34985 2.293578 2.76636 10.0000 -Ca(2) O Ca 0.99429 2.10084 2.32032 10.0000 -Sc(3) O Sc 2.1561 2.024291 1.99615 10.0000 -Ti(4) O Ti 2.81333 1.988072 1.83144 10.0000 -Ti(3) O Ti 1.97851 2.173913 1.88619 10.0000 -V(5) O V 3.69533 1.960784 1.60258 10.0000 -V(4) O V 2.08047 2.347418 1.77638 10.0000 -V(3) O V 1.82936 2.277904 1.85797 10.0000 -Cr(6) O Cr 3.68751 2.10084 1.53251 10.0000 -Cr(5) O Cr 2.36551 2.487562 1.55546 10.0000 -Cr(4) O Cr 1.93329 2.444988 1.76209 10.0000 -Cr(3) O Cr 1.77335 2.325581 1.83887 10.0000 -Mn(7) O Mn 4.9163 1.923077 1.48171 10.0000 -Mn(6) O Mn 2.82236 2.403846 1.52931 10.0000 -Mn(5) O Mn 2.46456 2.421308 1.57577 10.0000 -Mn(4) O Mn 1.85886 2.487562 1.77045 10.0000 -Mn(3) O Mn 1.81283 2.28833 1.85786 10.0000 -Mn(2) O Mn 1.64143 2.079002 2.02969 10.0000 -Fe(4) O Fe 1.87285 2.439024 1.82786 10.0000 -Fe(3) O Fe 1.66681 2.380952 1.86647 10.0000 -Fe(2) O Fe 1.69269 2.083333 1.96005 10.0000 -Ni(3) O Ni 1.66191 2.415459 1.81887 10.0000 -Ni(2) O Ni 1.46841 2.257336 1.92452 10.0000 -Co(3) O Co 1.87024 2.304147 1.7762 10.0000 -Co(2) O Co 1.51476 2.217295 1.93362 10.0000 -Cu(3) O Cu 1.88242 2.34192 1.70823 10.0000 -Cu(2) O Cu 1.85341 2.227171 1.56633 10.0000 -Cu(1) O Cu 0.66417 2.932551 1.78269 10.0000 -Zn(2) O Zn 1.24031 2.48139 1.88557 10.0000 -Ga(3) O Ga 1.18456 2.680965 1.79391 10.0000 -Ge(4) O Ge 1.91375 2.525253 1.66872 10.0000 -As(5) O As 2.71934 2.43309 1.58127 10.0000 -As(3) O As 1.51493 2.475248 1.64554 10.0000 -Se(6) O Se 3.44865 2.403846 1.53287 10.0000 -Se(4) O Se 2.38082 2.34192 1.55957 10.0000 -Br(7) O Br 4.24339 2.364066 1.50274 10.0000 -Rb(1) O Rb 0.26813 2.421308 2.89683 10.0000 -Sr(2) O Sr 0.74351 2.197802 2.53589 10.0000 -Y(3) O Y 1.62701 2.09205 2.21523 10.0000 -Zr(4) O Zr 2.19103 2.040816 1.99602 10.0000 -Nb(5) O Nb 2.72326 2.008032 1.85459 10.0000 -Nb(4) O Nb 2.7096 1.901141 1.85989 10.0000 -Nb(3) O Nb 2.02848 1.996008 1.9519 10.0000 -Mo(6) O Mo 1.9915 2.557545 1.71254 10.0000 -Mo(5) O Mo 2.64802 2.074689 1.7867 10.0000 -Mo(4) O Mo 3.10807 1.779359 1.85099 10.0000 -Mo(3) O Mo 1.42826 2.392344 1.92974 10.0000 -Ru(6) O Ru 2.42109 2.352941 1.66431 10.0000 -Ru(5) O Ru 2.13208 2.293578 1.81571 10.0000 -Ru(4) O Ru 1.99513 2.227171 1.84053 10.0000 -Rh(4) O Rh 1.62725 2.48139 1.81793 10.0000 -Rh(3) O Rh 1.92826 2.09205 1.86915 10.0000 -Pd(4) O Pd 2.04218 2.227171 1.79813 10.0000 -Pd(2) O Pd 1.7391 2.008032 1.83671 10.0000 -Ag(1) O Ag 0.63519 2.538071 2.22578 10.0000 -Cd(2) O Cd 0.98346 2.457002 2.1694 10.0000 -Ta(4) O Ta 2.75655 1.831502 1.79826 10.0000 -In(3) O In 0.84076 2.832861 2.02471 10.0000 -Sn(4) O Sn 1.35268 2.638522 1.93422 10.0000 -Sn(2) O Sn 0.97261 2.183406 1.9642 10.0000 -Sb(5) O Sb 1.95523 2.5 1.86318 10.0000 -Sb(3) O Sb 1.17786 2.364066 2.07526 10.0000 -I(7) O I 3.21424 2.386635 1.74105 10.0000 -I(5) O I 2.48947 2.358491 1.64421 10.0000 -Te(6) O Te 2.56406 2.427184 1.80876 10.0000 -Te(4) O Te 1.67169 2.493766 1.75208 10.0000 -Cs(1) O Cs 0.23307 2.386635 3.13121 10.0000 -Ba(2) O Ba 0.57994 2.28833 2.73769 10.0000 -La(3) O La 1.18587 2.217295 2.46989 10.0000 -Ce(4) O Ce 1.48412 2.257336 2.19872 10.0000 -Ce(3) O Ce 1.22048 2.227171 2.37861 10.0000 -Pr(3) O Pr 1.17041 2.277904 2.37113 10.0000 -Nd(3) O Nd 1.13205 2.336449 2.33016 10.0000 -Sm(3) O Sm 1.17622 2.309469 2.29536 10.0000 -Eu(3) O Eu 1.19545 2.304147 2.26888 10.0000 -Eu(2) O Eu 1.13032 2.024291 2.53846 10.0000 -Gd(3) O Gd 1.09161 2.409639 2.2719 10.0000 -Tb(4) O Tb 1.70132 2.024291 2.38506 10.0000 -Tb(3) O Tb 1.20764 2.309469 2.23563 10.0000 -Dy(3) O Dy 1.1735 2.347418 2.22689 10.0000 -Ho(3) O Ho 1.12157 2.409639 2.21122 10.0000 -Er(3) O Er 1.12394 2.427184 2.17477 10.0000 -Tm(3) O Tm 1.18138 2.375297 2.16042 10.0000 -Yb(3) O Yb 1.21989 2.347418 2.1422 10.0000 -Lu(3) O Lu 1.19488 2.375297 2.136 10.0000 -Hf(4) O Hf 1.89992 2.09205 1.99964 10.0000 -Ta(5) O Ta 2.36669 2.057613 1.85532 10.0000 -W(6) O W 1.84267 2.493766 1.77713 10.0000 -W(5) O W 2.6157 2.008032 1.76261 10.0000 -W(4) O W 2.47114 1.923077 1.81945 10.0000 -Re(7) O Re 3.55593 1.968504 1.59634 10.0000 -Re(6) O Re 2.95099 2.008032 1.71147 10.0000 -Re(5) O Re 2.41099 2.087683 1.76914 10.0000 -Re(3) O Re 0.81067 2.493766 2.33218 10.0000 -Os(8) O Os 3.71019 1.953125 1.66146 10.0000 -Os(7) O Os 2.91948 2.087683 1.72869 10.0000 -Os(6) O Os 2.44871 2.159827 1.7828 10.0000 -Os(4) O Os 2.27524 2.008032 1.81244 10.0000 -Ir(5) O Ir 2.32476 2.087683 1.83476 10.0000 -Ir(4) O Ir 1.68667 2.293578 1.87402 10.0000 -Pt(4) O Pt 2.03825 2.087683 1.87174 10.0000 -Pt(2) O Pt 2.14999 1.74216 1.80179 10.0000 -Au(3) O Au 1.96967 2.008032 1.81312 10.0000 -Au(1) O Au 0.85304 2.267574 1.89543 10.0000 -Hg(2) O Hg 1.12852 2.150538 2.25275 10.0000 -Hg(1) O Hg 0.73931 2.150538 2.43155 10.0000 -Tl(3) O Tl 0.67637 2.95858 2.10642 10.0000 -Tl(1) O Tl 0.34999 2.070393 2.77086 10.0000 -Pb(4) O Pb 1.02719 2.824859 2.02857 10.0000 -Pb(2) O Pb 0.63833 2.309469 2.44191 10.0000 -Bi(5) O Bi 1.4405 2.695418 1.98599 10.0000 -Bi(3) O Bi 0.97904 2.415459 2.18321 10.0000 diff --git a/src/pymatgen/command_line/bush.lib b/src/pymatgen/command_line/bush.lib deleted file mode 100644 index 1d9ef873bc8..00000000000 --- a/src/pymatgen/command_line/bush.lib +++ /dev/null @@ -1,79 +0,0 @@ -# -# BUSH -library of potentials for GULP -# -# from T.S.Bush, J.D.Gale, C.R.A.Catlow and P.D. Battle -# J. Mater Chem., 4, 831-837 (1994) -# -species -Li core 1.000 -Na core 1.000 -K core 1.000 -Mg core 1.580 -Mg shel 0.420 -Ca core 0.719 -Ca shel 1.281 -Sr core 0.169 -Sr shel 1.831 -Ba core 0.169 -Ba shel 1.831 -Fe core 1.971 -Fe shel 1.029 -Ti core 2.332 -Ti shel 1.668 -Al core 0.043 -Al shel 2.957 -Ga core 3.000 -Y core 3.000 -La core 5.149 -La shel -2.149 -Pr core 1.678 -Pr shel 1.322 -Nd core 1.678 -Nd shel 1.322 -Gd core -0.973 -Gd shel 3.973 -Eu core -0.991 -Eu shel 3.991 -Tb core -0.972 -Tb shel 3.972 -Yb core -0.278 -Yb shel 3.278 -O core 0.513 -O shel -2.513 -buckingham -Li core O shel 426.480 0.3000 0.00 0.0 10.0 -Na core O shel 1271.504 0.3000 0.00 0.0 10.0 -K core O shel 3587.570 0.3000 0.00 0.0 10.0 -Mg shel O shel 2457.243 0.2610 0.00 0.0 10.0 -Ca shel O shel 2272.741 0.2986 0.00 0.0 10.0 -Sr shel O shel 1956.702 0.3252 0.00 0.0 10.0 -Ba shel O shel 4818.416 0.3067 0.00 0.0 10.0 -Fe shel O shel 3219.335 0.2641 0.00 0.0 10.0 -Ti shel O shel 2088.107 0.2888 0.00 0.0 10.0 -Al shel O shel 2409.505 0.2649 0.00 0.0 10.0 -Ga core O shel 2339.776 0.2742 0.00 0.0 10.0 -Y core O shel 1519.279 0.3291 0.00 0.0 10.0 -La shel O shel 5436.827 0.2939 0.00 0.0 10.0 -Pr shel O shel 13431.118 0.2557 0.00 0.0 10.0 -Nd shel O shel 13084.217 0.2550 0.00 0.0 10.0 -Gd shel O shel 866.339 0.3770 0.00 0.0 10.0 -Eu shel O shel 847.868 0.3791 0.00 0.0 10.0 -Tb shel O shel 845.137 0.3750 0.00 0.0 10.0 -Yb shel O shel 991.029 0.3515 0.00 0.0 10.0 -O shel O shel 25.410 0.6937 32.32 0.0 12.0 -spring -Mg 349.95 -Ca 34.05 -Sr 21.53 -Ba 34.05 -Fe 179.58 -Ti 253.60 -Al 403.98 -La 173.90 -Pr 302.36 -Nd 302.35 -Gd 299.96 -Eu 304.92 -Tb 299.98 -Yb 308.91 -O 20.53 diff --git a/src/pymatgen/command_line/gulp_caller.py b/src/pymatgen/command_line/gulp_caller.py index 4d7bb3b17e0..eeeed9b0bc2 100644 --- a/src/pymatgen/command_line/gulp_caller.py +++ b/src/pymatgen/command_line/gulp_caller.py @@ -23,10 +23,8 @@ __status__ = "Production" __date__ = "Jun 22, 2013M" -MODULE_DIR = os.path.dirname(os.path.abspath(__file__)) - -_anions = set(map(Element, ["O", "S", "F", "Cl", "Br", "N", "P"])) -_cations = set( +_ANIONS = set(map(Element, ["O", "S", "F", "Cl", "Br", "N", "P"])) +_CATIONS = set( map( Element, [ @@ -92,144 +90,6 @@ ], ) ) -_gulp_kw = { - # Control of calculation type - "angle", - "bond", - "cosmo", - "cosmic", - "cost", - "defect", - "distance", - "eem", - "efg", - "fit", - "free_energy", - "gasteiger", - "genetic", - "gradients", - "md", - "montecarlo", - "noautobond", - "noenergy", - "optimise", - "pot", - "predict", - "preserve_Q", - "property", - "phonon", - "qeq", - "qbond", - "single", - "sm", - "static_first", - "torsion", - "transition_state", - # Geometric variable specification - "breathe", - "bulk_noopt", - "cellonly", - "conp", - "conv", - "isotropic", - "orthorhombic", - "nobreathe", - "noflgs", - "shell", - "unfix", - # Algorithm - "c6", - "dipole", - "fbfgs", - "fix_molecule", - "full", - "hill", - "kfull", - "marvinSE", - "madelung", - "minimum_image", - "molecule", - "molmec", - "molq", - "newda", - "noanisotropic_2b", - "nod2sym", - "nodsymmetry", - "noelectrostatics", - "noexclude", - "nofcentral", - "nofirst_point", - "noksymmetry", - "nolist_md", - "nomcediff", - "nonanal", - "noquicksearch", - "noreal", - "norecip", - "norepulsive", - "nosasinitevery", - "nosderv", - "nozeropt", - "numerical", - "qiter", - "qok", - "spatial", - "storevectors", - "nomolecularinternalke", - "voigt", - "zsisa", - # Optimization method - "conjugate", - "dfp", - "lbfgs", - "numdiag", - "positive", - "rfo", - "unit", - # Output control - "average", - "broaden_dos", - "cartesian", - "compare", - "conserved", - "dcharge", - "dynamical_matrix", - "eigenvectors", - "global", - "hessian", - "hexagonal", - "intensity", - "linmin", - "meanke", - "nodensity_out", - "nodpsym", - "nofrequency", - "nokpoints", - "operators", - "outcon", - "prt_eam", - "prt_two", - "prt_regi_before", - "qsas", - "restore", - "save", - "terse", - # Structure control - "lower_symmetry", - "nosymmetry", - # PDF control - "PDF", - "PDFcut", - "PDFbelow", - "PDFkeep", - "coreinfo", - "nowidth", - "nopartial", - # Miscellaneous - "nomodcoord", - "oldunits", - "zero_potential", -} class GulpIO: @@ -243,8 +103,6 @@ def keyword_line(*args): Args: args: 1st line keywords """ - # if len(list(filter(lambda x: x in _gulp_kw, args))) != len(args): - # raise GulpError("Wrong keywords given") gin = " ".join(args) gin += "\n" return gin @@ -300,7 +158,7 @@ def structure_lines( specie = site.specie core_site_desc = f"{specie.symbol} core {' '.join(coord)}\n" gin += core_site_desc - if (specie in _anions and anion_shell_flg) or (specie in _cations and cation_shell_flg): + if (specie in _ANIONS and anion_shell_flg) or (specie in _CATIONS and cation_shell_flg): shel_site_desc = f"{specie.symbol} shel {' '.join(coord)}\n" gin += shel_site_desc else: @@ -785,7 +643,7 @@ def __str__(self): class BuckinghamPotential: - """Generate the Buckingham Potential Table from the bush.lib and lewis.lib. + """Generate the Buckingham Potential Table from the bush.lib or lewis.lib. Ref: T.S.Bush, J.D.Gale, C.R.A.Catlow and P.D. Battle, J. Mater Chem., @@ -794,15 +652,16 @@ class BuckinghamPotential: 1149-1161 (1985) """ - def __init__(self, bush_lewis_flag): + def __init__(self, bush_lewis_flag, pot_file): """ Args: bush_lewis_flag (str): Flag for using Bush or Lewis potential. + pot_file: The potential file, either bush.lib or lewis.lib. """ if bush_lewis_flag not in {"bush", "lewis"}: raise ValueError(f"bush_lewis_flag should be bush or lewis, got {bush_lewis_flag}") - pot_file = "bush.lib" if bush_lewis_flag == "bush" else "lewis.lib" - with open(os.path.join(os.environ["GULP_LIB"], pot_file)) as file: + + with open(pot_file) as file: # In lewis.lib there is no shell for cation species_dict, pot_dict, spring_dict = {}, {}, {} sp_flg, pot_flg, spring_flg = False, False, False @@ -867,9 +726,9 @@ def __init__(self, bush_lewis_flag): class TersoffPotential: """Generate Tersoff Potential Table from "OxideTersoffPotentialentials" file.""" - def __init__(self): + def __init__(self, pot_file): """Init TersoffPotential.""" - with open(f"{MODULE_DIR}/OxideTersoffPotentials") as file: + with open(pot_file) as file: data = {} for row in file: metaloxi = row.split()[0] diff --git a/src/pymatgen/command_line/lewis.lib b/src/pymatgen/command_line/lewis.lib deleted file mode 100644 index 4bc13293b90..00000000000 --- a/src/pymatgen/command_line/lewis.lib +++ /dev/null @@ -1,86 +0,0 @@ -# -# LEWIS library - collection of potentials based -# around the Catlow oxygen-oxygen potential -# -# Taken from Tables 1 and 2 of Lewis and Catlow. -# Potentials derived using method (a) Extrapolation -# for systems with limited data - fit rho as being -# common to all related oxides and only fit A for -# each system (b) fitting of both A and rho where -# structures are of low symmetry. -# -# Reference: -# (1) G.V. Lewis and C.R.A. Catlow, J. Phys. C: Solid -# State Phys., 18, 1149-1161 (1985) -# -species -# Table 1 species -Ca_2+ core 2.00000 -Sc_2+ core 2.00000 -Ti_2+ core 2.00000 -V_2+ core 2.00000 -Cr_2+ core 2.00000 -Mn_2+ core 2.00000 -Fe_2+ core 2.00000 -Co_2+ core 2.00000 -Ni_2+ core 2.00000 -Zn_2+ core 2.00000 -Zr_4+ core 4.00000 -Cd_2+ core 2.00000 -Hf_4+ core 4.00000 -Ce_4+ core 4.00000 -Eu_2+ core 2.00000 -Tb_4+ core 4.00000 -Th_4+ core 4.00000 -U_4+ core 4.00000 -# Table 2 species -Sc_3+ core 3.00000 -Mn_3+ core 3.00000 -Y_3+ core 3.00000 -La_3+ core 3.00000 -Nd_3+ core 3.00000 -Eu_3+ core 3.00000 -Gd_3+ core 3.00000 -Ho_3+ core 3.00000 -Yb_3+ core 3.00000 -Lu_3+ core 3.00000 -Pu_3+ core 3.00000 -# Oxygen -O core 0.86902 -O shel -2.86902 -buckingham -# Table 1 potentials -Ca_2+ core O shel 1227.7 0.33720 0.00000 0.0 10.0 -Sc_2+ core O shel 838.6 0.33720 0.00000 0.0 10.0 -Ti_2+ core O shel 633.3 0.33720 0.00000 0.0 10.0 -V_2+ core O shel 557.8 0.33720 0.00000 0.0 10.0 -Cr_2+ core O shel 619.8 0.33720 0.00000 0.0 10.0 -Mn_2+ core O shel 832.7 0.33720 0.00000 0.0 10.0 -Fe_2+ core O shel 725.7 0.33720 0.00000 0.0 10.0 -Co_2+ core O shel 684.9 0.33720 0.00000 0.0 10.0 -Ni_2+ core O shel 641.2 0.33720 0.00000 0.0 10.0 -Zn_2+ core O shel 700.3 0.33720 0.00000 0.0 10.0 -Zr_4+ core O shel 1453.8 0.35000 0.00000 0.0 10.0 -Cd_2+ core O shel 868.3 0.35000 0.00000 0.0 10.0 -Hf_4+ core O shel 1454.6 0.35000 0.00000 0.0 10.0 -Ce_4+ core O shel 1017.4 0.39490 0.00000 0.0 10.0 -Eu_2+ core O shel 665.2 0.39490 0.00000 0.0 10.0 -Tb_4+ core O shel 905.3 0.39490 0.00000 0.0 10.0 -Th_4+ core O shel 1144.6 0.39490 0.00000 0.0 10.0 -U_4+ core O shel 1055.0 0.39490 0.00000 0.0 10.0 -# Table 1 potentials -Sc_3+ core O shel 1299.4 0.33120 0.00000 0.0 10.0 -Mn_3+ core O shel 1257.9 0.32140 0.00000 0.0 10.0 -Y_3+ core O shel 1345.1 0.34910 0.00000 0.0 10.0 -La_3+ core O shel 1439.7 0.36510 0.00000 0.0 10.0 -Nd_3+ core O shel 1379.9 0.36010 0.00000 0.0 10.0 -Eu_3+ core O shel 1358.0 0.35560 0.00000 0.0 10.0 -Gd_3+ core O shel 1336.8 0.35510 0.00000 0.0 10.0 -Ho_3+ core O shel 1350.2 0.34870 0.00000 0.0 10.0 -Yb_3+ core O shel 1309.6 0.34620 0.00000 0.0 10.0 -Lu_3+ core O shel 1347.1 0.34300 0.00000 0.0 10.0 -Pu_3+ core O shel 1376.2 0.35930 0.00000 0.0 10.0 -# Oxygen-oxygen potential -O shel O shel 22764.0 0.14900 27.87900 0.0 12.0 -spring -O 74.92