From cc3a77a819a1734ce14862cd0d694d239ac9f2ba Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Tue, 13 Feb 2024 17:54:24 +0800 Subject: [PATCH 1/4] improve incar para check --- pymatgen/io/vasp/incar_parameters.json | 2097 ++++++++++++++++-------- pymatgen/io/vasp/inputs.py | 32 +- 2 files changed, 1464 insertions(+), 665 deletions(-) diff --git a/pymatgen/io/vasp/incar_parameters.json b/pymatgen/io/vasp/incar_parameters.json index 04bb1b2db85..c6697647007 100644 --- a/pymatgen/io/vasp/incar_parameters.json +++ b/pymatgen/io/vasp/incar_parameters.json @@ -1,653 +1,1448 @@ { - "ADDGRID": "bool", - "AEXX": "float", - "AGGAC": "float", - "AGGAX": "float", - "ALDAC": "float", - "ALGO": [ - "Normal", - "VeryFast", - "Fast", - "Conjugate", - "All", - "Damped", - "Subrot", - "Eigenval", - "Exact", - "None", - "Nothing", - "CHI", - "G0W0", - "GW0", - "GW", - "scGW0", - "scGW", - "G0W0R", - "GW0R", - "GWR", - "scGW0R", - "scGWR", - "ACFDT", - "RPA", - "ACFDTR", - "RPAR", - "BSE", - "TDHF", - "Timeev", - "EVGW0", - "EVGW", - "QPGW0", - "QPGW", - "QPGW0R", - "QPGWR" - ], - "AMIN": "float", - "AMIX": "float", - "AMIX_MAG": "float", - "ANDERSEN_PROB": "float", - "ANTIRES": [ - 0, - 1, - 2 - ], - "APACO": "float", - "BMIX": "float", - "BMIX_MAG": "float", - "CH_LSPEC": "bool", - "CH_NEDOS": "int", - "CH_SIGMA": "float", - "CLL": "int", - "CLN": "int", - "CLNT": "int", - "CLZ": "float", - "CMBJ": "list", - "CMBJA": "float", - "CMBJB": "float", - "CSHIFT": "float", - "DEPER": "float", - "DIMER_DIST": "float", - "DIPOL": "list", - "DQ": "float", - "EBREAK": "float", - "EDIFF": "float", - "EDIFFG": "float", - "EFIELD": "float", - "EFIELD_PEAD": "list", - "EINT": "list", - "EMAX": "float", - "EMIN": "float", - "ENAUG": "float", - "ENCUT": "int", - "ENCUTFOCK": "float", - "ENCUTGW": "float", - "ENCUTGWSOFT": "float", - "ENINI": "float", - "EPSILON": "float", - "EVENONLY": "bool", - "EVENONLYGW": "bool", - "FERDO": "list", - "FERWE": "list", - "FINDIFF": "int", - "GGA": [ - "91", - "PE", - "AM", - "HL", - "CA", - "MK", - "RE", - "VW", - "B3", - "PZ", - "WI", - "RP", - "B5", - "BF", - "CO", - "PS", - "OR", - "BO", - "03", - "05", - "10", - "20", - "RA", - "PL" - ], - "GGA_COMPAT": "bool", - "HFLMAX": "int", - "HFRCUT": "float", - "HFSCREEN": "float", - "HILLS_BIN": "int", - "HILLS_H": "float", - "HILLS_W": "float", - "HITOLER": "float", - "I_CONSTRAINED_M": [ - 1, - 2, - null - ], - "IALGO": [ - -1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 15, - 16, - 17, - 18, - 28, - 38, - 44, - 45, - 46, - 47, - 48, - 53, - 54, - 55, - 56, - 57, - 58 - ], - "IBAND": "list", - "IBRION": [ - -1, - 0, - 1, - 2, - 3, - 5, - 6, - 7, - 8, - 44 - ], - "ICHARG": [ - 0, - 1, - 2, - 4, - 10, - 11, - 12, - 14 - ], - "ICHIBARE": [ - 1, - 2, - 3 - ], - "ICORELEVEL": [ - 0, - 1, - 2 - ], - "IDIPOL": [ - 1, - 2, - 3, - 4 - ], - "IEPSILON": [ - 1, - 2, - 3, - 4 - ], - "IGPAR": [ - 1, - 2, - 3 - ], - "IMAGES": "int", - "IMIX": [ - 0, - 1, - 2, - 4 - ], - "INCREM": "list", - "INIMIX": [ - 0, - 1, - 2 - ], - "INIWAV": [ - 0, - 1 - ], - "IPEAD": [ - 1, - 2, - 3, - 4 - ], - "ISIF": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8 - ], - "ISMEAR": "int", - "ISPIN": [ - 1, - 2 - ], - "ISTART": [ - 0, - 1, - 2, - 3 - ], - "ISYM": [ - -1, - 0, - 1, - 2, - 3 - ], - "IVDW": [ - 0, - 1, - 10, - 11, - 12, - 2, - 20, - 21, - 202, - 4 - ], - "IWAVPR": [ - 0, - 1, - 2, - 3, - 10, - 11, - 12, - 13 - ], - "KBLOCK": "int", - "KGAMMA": "bool", - "KPAR": "int", - "KPOINT_BSE": "list", - "KPUSE": "list", - "KSPACING": "float", - "LADDER": "bool", - "LAECHG": "bool", - "LAMBDA": "float", - "LANGEVIN_GAMMA": "list", - "LANGEVIN_GAMMA_L": "float", - "LASPH": "bool", - "LASYNC": "bool", - "LATTICE_CONSTRAINTS": "list", - "LBERRY": "bool", - "LBLUEOUT": "bool", - "LBONE": "bool", - "LCALCEPS": "bool", - "LCALCPOL": "bool", - "LCHARG": "bool", - "LCHIMAG": "bool", - "LCORR": "bool", - "LDAU": "bool", - "LDAUJ": "list", - "LDAUL": "list", - "LDAUPRINT": [ - 0, - 1, - 2 - ], - "LDAUTYPE": [ - 1, - 2, - 4 - ], - "LDAUU": "list", - "LDIAG": "bool", - "LDIPOL": "bool", - "LEFG": "bool", - "LELF": "bool", - "LEPSILON": "bool", - "LFOCKAEDFT": "bool", - "LHARTREE": "bool", - "LHFCALC": "bool", - "LHYPERFINE": "bool", - "LKPROJ": "bool", - "LLRAUG": "bool", - "LMAXFOCK": "int", - "LMAXFOCKAE": "int", - "LMAXMIX": "int", - "LMAXPAW": "int", - "LMAXTAU": "int", - "LMIXTAU": "bool", - "LMONO": "bool", - "LNABLA": "bool", - "LNMR_SYM_RED": "bool", - "LNONCOLLINEAR": "bool", - "LOCPROJ": "list", - "LOPTICS": "bool", - "LORBIT": [ - 0, - 1, - 2, - 5, - 10, - 11, - 12 - ], - "LORBMOM": "bool", - "LPARD": "bool", - "LPEAD": "bool", - "LPLANE": "bool", - "LREAL": [ - false, - true, - "O", - "A", - "Auto", - "On" - ], - "LRPA": "bool", - "LSCAAWARE": "bool", - "LSCALAPACK": "bool", - "LSCALU": "bool", - "LSCSGRAD": "bool", - "LSELFENERGY": "bool", - "LSEPB": "bool", - "LSEPK": "bool", - "LSORBIT": "bool", - "LSPECTRAL": "bool", - "LSPECTRALGW": "bool", - "LSPIRAL": "bool", - "LSUBROT": "bool", - "LTHOMAS": "bool", - "LUSE_VDW": "bool", - "LVDW_EWALD": "bool", - "LVDWEXPANSION": "bool", - "LVHAR": "bool", - "LVTOT": "bool", - "LWANNIER90": "bool", - "LWANNIER90_RUN": "bool", - "LWAVE": "bool", - "LWRITE_MMN_AMN": "bool", - "LWRITE_UNK": "bool", - "LWRITE_WANPROJ": "bool", - "LZEROZ": "bool", - "M_CONSTR": "list", - "MAGMOM": "list", - "MAXMEM": "int", - "MAXMIX": "int", - "MDALGO": [ - 0, - 1, - 2, - 3, - 11, - 21, - 13 - ], - "METAGGA": [ - "TPSS", - "RTPSS", - "M06L", - "MBJ", - "SCAN", - "MS0", - "MS1", - "MS2" - ], - "MINROT": "float", - "MIXPRE": [ - 0, - 1, - 2, - 3 - ], - "ML_FF_AFILT2_MB": "float", - "ML_FF_CDOUB": "float", - "ML_FF_CSF": "float", - "ML_FF_CSIG": "float", - "ML_FF_CSLOPE": "float", - "ML_FF_CTIFOR": "float", - "ML_FF_EATOM": "list", - "ML_FF_IAFILT2_MB": "int", - "ML_FF_IBROAD1_MB": "int", - "ML_FF_IBROAD2_MB": "int", - "ML_FF_ICOUPLE_MB": "list", - "ML_FF_ICUT1_MB": "int", - "ML_FF_ICUT2_MB": "int", - "ML_FF_IERR": "int", - "ML_FF_IREG_MB": "int", - "ML_FF_ISAMPLE": "int", - "ML_FF_ISCALE_TOTEN_MB": "int", - "ML_FF_ISOAP1_MB": "int", - "ML_FF_ISOAP2_MB": "int", - "ML_FF_ISTART": "int", - "ML_FF_IWEIGHT": "int", - "ML_FF_LAFILT2_MB": "bool", - "ML_FF_LBASIS_DISCARD": "bool", - "ML_FF_LCONF_DISCARD": "bool", - "ML_FF_LCOUPLE_MB": "bool", - "ML_FF_LCRITERIA": "bool", - "ML_FF_LEATOM_MB": "bool", - "ML_FF_LHEAT_MB": "bool", - "ML_FF_LMAX2_MB": "int", - "ML_FF_LMLFF": "bool", - "ML_FF_LMLMB": "bool", - "ML_FF_LNORM1_MB": "bool", - "ML_FF_LNORM2_MB": "bool", - "ML_FF_MB_MB": "int", - "ML_FF_MCONF": "int", - "ML_FF_MCONF_NEW": "int", - "ML_FF_MHIS": "int", - "ML_FF_MRB1_MB": "int", - "ML_FF_MRB2_MB": "int", - "ML_FF_MSPL1_MB": "int", - "ML_FF_MSPL2_MB": "int", - "ML_FF_NATOM_COUPLED_MB": "int", - "ML_FF_NDIM_SCALAPACK": "int", - "ML_FF_NHYP1_MB": "int", - "ML_FF_NHYP2_MB": "int", - "ML_FF_NMDINT": "int", - "ML_FF_NR1_MB": "int", - "ML_FF_NR2_MB": "int", - "ML_FF_NWRITE": "int", - "ML_FF_RCOUPLE_MB": "float", - "ML_FF_RCUT1_MB": "float", - "ML_FF_RCUT2_MB": "float", - "ML_FF_SIGV0_MB": "float", - "ML_FF_SIGW0_MB": "float", - "ML_FF_SION1_MB": "float", - "ML_FF_SION2_MB": "float", - "ML_FF_W1_MB": "float", - "ML_FF_W2_MB": "float", - "ML_FF_WTIFOR": "float", - "ML_FF_WTOTEN": "float", - "ML_FF_WTSIF": "float", - "NBANDS": "int", - "NBANDSGW": "int", - "NBANDSO": "int", - "NBANDSV": "int", - "NBLK": "int", - "NBLOCK": "int", - "NBMOD": "int", - "NBSEEIG": "int", - "NCORE": "int", - "NCRPA_BANDS": "list", - "NDAV": "int", - "NEDOS": "int", - "NELECT": "float", - "NELM": "int", - "NELMDL": "int", - "NELMIN": "int", - "NFREE": "int", - "NGX": "int", - "NGXF": "int", - "NGY": "int", - "NGYF": "int", - "NGYROMAG": "list", - "NGZ": "int", - "NGZF": "int", - "NKRED": "int", - "NKREDX": "int", - "NKREDY": "int", - "NKREDZ": "int", - "NLSPLINE": "bool", - "NMAXFOCKAE": [ - 1, - 2 - ], - "NOMEGA": "int", - "NOMEGAPAR": "int", - "NOMEGAR": "int", - "NPACO": "int", - "NPAR": "int", - "NPPSTR": "int", - "NSIM": "int", - "NSUBSYS": "list", - "NSW": "int", - "NTARGET_STATES": "list", - "NTAUPAR": "int", - "NUPDOWN": "int", - "NWRITE": [ - 0, - 1, - 2, - 3, - 4 - ], - "ODDONLY": "bool", - "ODDONLYGW": "bool", - "OFIELD_A": "float", - "OFIELD_KAPPA": "float", - "OFIELD_Q6_FAR": "float", - "OFIELD_Q6_NEAR": "float", - "OMEGAMAX": "float", - "OMEGAMIN": "float", - "OMEGATL": "float", - "PARAM1": "float", - "PARAM2": "float", - "PFLAT": "bool", - "PHON_LBOSE": "bool", - "PHON_LMC": "bool", - "PHON_NSTRUCT": "int", - "PHON_NTLIST": "int", - "PHON_TLIST": "list", - "PLEVEL": "int", - "PMASS": "float", - "POMASS": "float", - "POTIM": "float", - "PREC": [ - "Low", - "Medium", - "High", - "Normal", - "Single", - "Accurate" - ], - "PRECFOCK": [ - "Low", - "Medium", - "Fast", - "Normal", - "Accurate" - ], - "PROUTINE": "int", - "PSTRESS": "float", - "PSUBSYS": "list", - "PTHRESHOLD": "float", - "QMAXFOCKAE": "list", - "QSPIRAL": "list", - "QUAD_EFG": "list", - "RANDOM_SEED": "list", - "ROPT": "list", - "RWIGS": "list", - "SAXIS": "list", - "SCSRAD": "float", - "SHAKEMAXITER": "int", - "SHAKETOL": "float", - "SIGMA": "float", - "SMASS": "float", - "SMEARINGS": "list", - "SPRING": "int", - "STEP_MAX": "float", - "STEP_SIZE": "float", - "SYMPREC": "float", - "SYSTEM": "str", - "TEBEG": "float", - "TEEND": "float", - "TIME": "float", - "TSUBSYS": "list", - "VALUE_MAX": "list", - "VALUE_MIN": "list", - "VCUTOFF": "float", - "VDW_A1": "float", - "VDW_A2": "float", - "VDW_C6": "list", - "VDW_CNRADIUS": "float", - "VDW_D": "float", - "VDW_R0": "list", - "VDW_RADIUS": "float", - "VDW_S6": "float", - "VDW_S8": "float", - "VDW_SR": "float", - "VOSKOWN": [ - 0, - 1 - ], - "WC": "float", - "WEIMIN": "float", - "ZVAL": "float", - "ISPIND": [ - 1, - 2 - ], - "LCOMPAT": "bool", - "ENMAX": "str", - "LMETAGGA": "bool", - "MIXFIRST": "bool", - "LDOWNSAMPLE": "bool", - "STM": "bool", - "LORBITALREAL": "bool", - "LMUSIC": "bool", - "DARWINR": "bool", - "DARWINV": "bool", - "LSYMGRAD": "bool", - "LHFONE": "bool", - "LRHFCALC": "bool", - "LMODELHF": "bool", - "SHIFTRED": "bool", - "HFSCREENC": "bool", - "LVEL": "bool", - "NUCIND": "bool", - "MAGPOS": "bool", - "LNICSALL": "bool", - "ORBITALMAG": "bool", - "LMAGBLOCH": "bool", - "LGAUGE": "bool", - "LRPAFORCE": "bool", - "LFXC": "bool", - "LTCTE": "bool", - "LTETE": "bool", - "LTRIPLET": "bool", - "LFXCEPS": "bool", - "LFXHEG": "bool", - "LUSEW": "bool", - "ENCUTLF": "bool", - "SELFENERGY": "bool", - "LSINGLES": "bool", - "LFERMIGW": "bool", - "LSOL": "bool", - "MAGDIPOLOUT": "bool" + "ADDGRID": { + "type": "bool" + }, + "AEXX": { + "type": "float" + }, + "AGGAC": { + "type": "float" + }, + "AGGAX": { + "type": "float" + }, + "ALDAC": { + "type": "float" + }, + "ALGO": { + "type": "str", + "values": [ + "Normal", + "VeryFast", + "Fast", + "Conjugate", + "All", + "Damped", + "Subrot", + "Eigenval", + "Exact", + "None", + "Nothing", + "CHI", + "G0W0", + "GW0", + "GW", + "scGW0", + "scGW", + "G0W0R", + "GW0R", + "GWR", + "scGW0R", + "scGWR", + "ACFDT", + "RPA", + "ACFDTR", + "RPAR", + "BSE", + "TDHF", + "Timeev", + "EVGW0", + "EVGW", + "QPGW0", + "QPGW", + "QPGW0R", + "QPGWR" + ] + }, + "AMIN": { + "type": "float" + }, + "AMIX": { + "type": "float" + }, + "AMIX_MAG": { + "type": "float" + }, + "ANDERSEN_PROB": { + "type": "float" + }, + "ANTIRES": { + "type": "int", + "values": [ + 0, + 1, + 2 + ] + }, + "APACO": { + "type": "float" + }, + "BMIX": { + "type": "float" + }, + "BMIX_MAG": { + "type": "float" + }, + "CH_LSPEC": { + "type": "bool" + }, + "CH_NEDOS": { + "type": "int" + }, + "CH_SIGMA": { + "type": "float" + }, + "CLL": { + "type": "int" + }, + "CLN": { + "type": "int" + }, + "CLNT": { + "type": "int" + }, + "CLZ": { + "type": "float" + }, + "CMBJ": { + "type": "list" + }, + "CMBJA": { + "type": "float" + }, + "CMBJB": { + "type": "float" + }, + "CSHIFT": { + "type": "float" + }, + "DEPER": { + "type": "float" + }, + "DIMER_DIST": { + "type": "float" + }, + "DIPOL": { + "type": "list" + }, + "DQ": { + "type": "float" + }, + "EBREAK": { + "type": "float" + }, + "EDIFF": { + "type": "float" + }, + "EDIFFG": { + "type": "float" + }, + "EFIELD": { + "type": "float" + }, + "EFIELD_PEAD": { + "type": "list" + }, + "EINT": { + "type": "list" + }, + "EMAX": { + "type": "float" + }, + "EMIN": { + "type": "float" + }, + "ENAUG": { + "type": "float" + }, + "ENCUT": { + "type": "int" + }, + "ENCUTFOCK": { + "type": "float" + }, + "ENCUTGW": { + "type": "float" + }, + "ENCUTGWSOFT": { + "type": "float" + }, + "ENINI": { + "type": "float" + }, + "EPSILON": { + "type": "float" + }, + "EVENONLY": { + "type": "bool" + }, + "EVENONLYGW": { + "type": "bool" + }, + "FERDO": { + "type": "list" + }, + "FERWE": { + "type": "list" + }, + "FINDIFF": { + "type": "int" + }, + "GGA": { + "type": "str", + "values": [ + "91", + "PE", + "AM", + "HL", + "CA", + "MK", + "RE", + "VW", + "B3", + "PZ", + "WI", + "RP", + "B5", + "BF", + "CO", + "PS", + "OR", + "BO", + "03", + "05", + "10", + "20", + "RA", + "PL" + ] + }, + "GGA_COMPAT": { + "type": "bool" + }, + "HFLMAX": { + "type": "int" + }, + "HFRCUT": { + "type": "float" + }, + "HFSCREEN": { + "type": "float" + }, + "HILLS_BIN": { + "type": "int" + }, + "HILLS_H": { + "type": "float" + }, + "HILLS_W": { + "type": "float" + }, + "HITOLER": { + "type": "float" + }, + "I_CONSTRAINED_M": { + "type": "int", + "values": [ + 1, + 2, + 4 + ] + }, + "IALGO": { + "type": "int", + "values": [ + -1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 15, + 16, + 17, + 18, + 28, + 38, + 44, + 45, + 46, + 47, + 48, + 53, + 54, + 55, + 56, + 57, + 58 + ] + }, + "IBAND": { + "type": "list" + }, + "IBRION": { + "type": "int", + "values": [ + -1, + 0, + 1, + 2, + 3, + 5, + 6, + 7, + 8, + 44 + ] + }, + "ICHARG": { + "type": "int", + "values": [ + 0, + 1, + 2, + 4, + 10, + 11, + 12, + 14 + ] + }, + "ICHIBARE": { + "type": "int", + "values": [ + 1, + 2, + 3 + ] + }, + "ICORELEVEL": { + "type": "int", + "values": [ + 0, + 1, + 2 + ] + }, + "IDIPOL": { + "type": "int", + "values": [ + 1, + 2, + 3, + 4 + ] + }, + "IEPSILON": { + "type": "int", + "values": [ + 1, + 2, + 3, + 4 + ] + }, + "IGPAR": { + "type": "int", + "values": [ + 1, + 2, + 3 + ] + }, + "IMAGES": { + "type": "int" + }, + "IMIX": { + "type": "int", + "values": [ + 0, + 1, + 2, + 4 + ] + }, + "INCREM": { + "type": "list" + }, + "INIMIX": { + "type": "int", + "values": [ + 0, + 1, + 2 + ] + }, + "INIWAV": { + "type": "int", + "values": [ + 0, + 1 + ] + }, + "IPEAD": { + "type": "int", + "values": [ + 1, + 2, + 3, + 4 + ] + }, + "ISIF": { + "type": "int", + "values": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ] + }, + "ISMEAR": { + "type": "int" + }, + "ISPIN": { + "type": "int", + "values": [ + 1, + 2 + ] + }, + "ISTART": { + "type": "int", + "values": [ + 0, + 1, + 2, + 3 + ] + }, + "ISYM": { + "type": "int", + "values": [ + -1, + 0, + 1, + 2, + 3 + ] + }, + "IVDW": { + "type": "int", + "values": [ + 0, + 1, + 10, + 11, + 12, + 2, + 20, + 21, + 202, + 4 + ] + }, + "IWAVPR": { + "type": "int", + "values": [ + 0, + 1, + 2, + 3, + 10, + 11, + 12, + 13 + ] + }, + "KBLOCK": { + "type": "int" + }, + "KGAMMA": { + "type": "bool" + }, + "KPAR": { + "type": "int" + }, + "KPOINT_BSE": { + "type": "list" + }, + "KPUSE": { + "type": "list" + }, + "KSPACING": { + "type": "float" + }, + "LADDER": { + "type": "bool" + }, + "LAECHG": { + "type": "bool" + }, + "LAMBDA": { + "type": "float" + }, + "LANGEVIN_GAMMA": { + "type": "list" + }, + "LANGEVIN_GAMMA_L": { + "type": "float" + }, + "LASPH": { + "type": "bool" + }, + "LASYNC": { + "type": "bool" + }, + "LATTICE_CONSTRAINTS": { + "type": "list" + }, + "LBERRY": { + "type": "bool" + }, + "LBLUEOUT": { + "type": "bool" + }, + "LBONE": { + "type": "bool" + }, + "LCALCEPS": { + "type": "bool" + }, + "LCALCPOL": { + "type": "bool" + }, + "LCHARG": { + "type": "bool" + }, + "LCHIMAG": { + "type": "bool" + }, + "LCORR": { + "type": "bool" + }, + "LDAU": { + "type": "bool" + }, + "LDAUJ": { + "type": "list" + }, + "LDAUL": { + "type": "list" + }, + "LDAUPRINT": { + "type": "int", + "values": [ + 0, + 1, + 2 + ] + }, + "LDAUTYPE": { + "type": "int", + "values": [ + 1, + 2, + 4 + ] + }, + "LDAUU": { + "type": "list" + }, + "LDIAG": { + "type": "bool" + }, + "LDIPOL": { + "type": "bool" + }, + "LEFG": { + "type": "bool" + }, + "LELF": { + "type": "bool" + }, + "LEPSILON": { + "type": "bool" + }, + "LFOCKAEDFT": { + "type": "bool" + }, + "LHARTREE": { + "type": "bool" + }, + "LHFCALC": { + "type": "bool" + }, + "LHYPERFINE": { + "type": "bool" + }, + "LKPROJ": { + "type": "bool" + }, + "LLRAUG": { + "type": "bool" + }, + "LMAXFOCK": { + "type": "int" + }, + "LMAXFOCKAE": { + "type": "int" + }, + "LMAXMIX": { + "type": "int" + }, + "LMAXPAW": { + "type": "int" + }, + "LMAXTAU": { + "type": "int" + }, + "LMIXTAU": { + "type": "bool" + }, + "LMONO": { + "type": "bool" + }, + "LNABLA": { + "type": "bool" + }, + "LNMR_SYM_RED": { + "type": "bool" + }, + "LNONCOLLINEAR": { + "type": "bool" + }, + "LOCPROJ": { + "type": "list" + }, + "LOPTICS": { + "type": "bool" + }, + "LORBIT": { + "type": "int", + "values": [ + 0, + 1, + 2, + 5, + 10, + 11, + 12 + ] + }, + "LORBMOM": { + "type": "bool" + }, + "LPARD": { + "type": "bool" + }, + "LPEAD": { + "type": "bool" + }, + "LPLANE": { + "type": "bool" + }, + "LREAL": { + "type": "Union[bool, str]", + "values": [ + false, + true, + "O", + "A", + "Auto", + "On" + ] + }, + "LRPA": { + "type": "bool" + }, + "LSCAAWARE": { + "type": "bool" + }, + "LSCALAPACK": { + "type": "bool" + }, + "LSCALU": { + "type": "bool" + }, + "LSCSGRAD": { + "type": "bool" + }, + "LSELFENERGY": { + "type": "bool" + }, + "LSEPB": { + "type": "bool" + }, + "LSEPK": { + "type": "bool" + }, + "LSORBIT": { + "type": "bool" + }, + "LSPECTRAL": { + "type": "bool" + }, + "LSPECTRALGW": { + "type": "bool" + }, + "LSPIRAL": { + "type": "bool" + }, + "LSUBROT": { + "type": "bool" + }, + "LTHOMAS": { + "type": "bool" + }, + "LUSE_VDW": { + "type": "bool" + }, + "LVDW_EWALD": { + "type": "bool" + }, + "LVDWEXPANSION": { + "type": "bool" + }, + "LVHAR": { + "type": "bool" + }, + "LVTOT": { + "type": "bool" + }, + "LWANNIER90": { + "type": "bool" + }, + "LWANNIER90_RUN": { + "type": "bool" + }, + "LWAVE": { + "type": "bool" + }, + "LWRITE_MMN_AMN": { + "type": "bool" + }, + "LWRITE_UNK": { + "type": "bool" + }, + "LWRITE_WANPROJ": { + "type": "bool" + }, + "LZEROZ": { + "type": "bool" + }, + "M_CONSTR": { + "type": "list" + }, + "MAGMOM": { + "type": "list" + }, + "MAXMEM": { + "type": "int" + }, + "MAXMIX": { + "type": "int" + }, + "MDALGO": { + "type": "int", + "values": [ + 0, + 1, + 2, + 3, + 11, + 21, + 13 + ] + }, + "METAGGA": { + "type": "str", + "values": [ + "TPSS", + "RTPSS", + "M06L", + "MBJ", + "SCAN", + "MS0", + "MS1", + "MS2" + ] + }, + "MINROT": { + "type": "float" + }, + "MIXPRE": { + "type": "int", + "values": [ + 0, + 1, + 2, + 3 + ] + }, + "ML_FF_AFILT2_MB": { + "type": "float" + }, + "ML_FF_CDOUB": { + "type": "float" + }, + "ML_FF_CSF": { + "type": "float" + }, + "ML_FF_CSIG": { + "type": "float" + }, + "ML_FF_CSLOPE": { + "type": "float" + }, + "ML_FF_CTIFOR": { + "type": "float" + }, + "ML_FF_EATOM": { + "type": "list" + }, + "ML_FF_IAFILT2_MB": { + "type": "int" + }, + "ML_FF_IBROAD1_MB": { + "type": "int" + }, + "ML_FF_IBROAD2_MB": { + "type": "int" + }, + "ML_FF_ICOUPLE_MB": { + "type": "list" + }, + "ML_FF_ICUT1_MB": { + "type": "int" + }, + "ML_FF_ICUT2_MB": { + "type": "int" + }, + "ML_FF_IERR": { + "type": "int" + }, + "ML_FF_IREG_MB": { + "type": "int" + }, + "ML_FF_ISAMPLE": { + "type": "int" + }, + "ML_FF_ISCALE_TOTEN_MB": { + "type": "int" + }, + "ML_FF_ISOAP1_MB": { + "type": "int" + }, + "ML_FF_ISOAP2_MB": { + "type": "int" + }, + "ML_FF_ISTART": { + "type": "int" + }, + "ML_FF_IWEIGHT": { + "type": "int" + }, + "ML_FF_LAFILT2_MB": { + "type": "bool" + }, + "ML_FF_LBASIS_DISCARD": { + "type": "bool" + }, + "ML_FF_LCONF_DISCARD": { + "type": "bool" + }, + "ML_FF_LCOUPLE_MB": { + "type": "bool" + }, + "ML_FF_LCRITERIA": { + "type": "bool" + }, + "ML_FF_LEATOM_MB": { + "type": "bool" + }, + "ML_FF_LHEAT_MB": { + "type": "bool" + }, + "ML_FF_LMAX2_MB": { + "type": "int" + }, + "ML_FF_LMLFF": { + "type": "bool" + }, + "ML_FF_LMLMB": { + "type": "bool" + }, + "ML_FF_LNORM1_MB": { + "type": "bool" + }, + "ML_FF_LNORM2_MB": { + "type": "bool" + }, + "ML_FF_MB_MB": { + "type": "int" + }, + "ML_FF_MCONF": { + "type": "int" + }, + "ML_FF_MCONF_NEW": { + "type": "int" + }, + "ML_FF_MHIS": { + "type": "int" + }, + "ML_FF_MRB1_MB": { + "type": "int" + }, + "ML_FF_MRB2_MB": { + "type": "int" + }, + "ML_FF_MSPL1_MB": { + "type": "int" + }, + "ML_FF_MSPL2_MB": { + "type": "int" + }, + "ML_FF_NATOM_COUPLED_MB": { + "type": "int" + }, + "ML_FF_NDIM_SCALAPACK": { + "type": "int" + }, + "ML_FF_NHYP1_MB": { + "type": "int" + }, + "ML_FF_NHYP2_MB": { + "type": "int" + }, + "ML_FF_NMDINT": { + "type": "int" + }, + "ML_FF_NR1_MB": { + "type": "int" + }, + "ML_FF_NR2_MB": { + "type": "int" + }, + "ML_FF_NWRITE": { + "type": "int" + }, + "ML_FF_RCOUPLE_MB": { + "type": "float" + }, + "ML_FF_RCUT1_MB": { + "type": "float" + }, + "ML_FF_RCUT2_MB": { + "type": "float" + }, + "ML_FF_SIGV0_MB": { + "type": "float" + }, + "ML_FF_SIGW0_MB": { + "type": "float" + }, + "ML_FF_SION1_MB": { + "type": "float" + }, + "ML_FF_SION2_MB": { + "type": "float" + }, + "ML_FF_W1_MB": { + "type": "float" + }, + "ML_FF_W2_MB": { + "type": "float" + }, + "ML_FF_WTIFOR": { + "type": "float" + }, + "ML_FF_WTOTEN": { + "type": "float" + }, + "ML_FF_WTSIF": { + "type": "float" + }, + "NBANDS": { + "type": "int" + }, + "NBANDSGW": { + "type": "int" + }, + "NBANDSO": { + "type": "int" + }, + "NBANDSV": { + "type": "int" + }, + "NBLK": { + "type": "int" + }, + "NBLOCK": { + "type": "int" + }, + "NBMOD": { + "type": "int" + }, + "NBSEEIG": { + "type": "int" + }, + "NCORE": { + "type": "int" + }, + "NCRPA_BANDS": { + "type": "list" + }, + "NDAV": { + "type": "int" + }, + "NEDOS": { + "type": "int" + }, + "NELECT": { + "type": "float" + }, + "NELM": { + "type": "int" + }, + "NELMDL": { + "type": "int" + }, + "NELMIN": { + "type": "int" + }, + "NFREE": { + "type": "int" + }, + "NGX": { + "type": "int" + }, + "NGXF": { + "type": "int" + }, + "NGY": { + "type": "int" + }, + "NGYF": { + "type": "int" + }, + "NGYROMAG": { + "type": "list" + }, + "NGZ": { + "type": "int" + }, + "NGZF": { + "type": "int" + }, + "NKRED": { + "type": "int" + }, + "NKREDX": { + "type": "int" + }, + "NKREDY": { + "type": "int" + }, + "NKREDZ": { + "type": "int" + }, + "NLSPLINE": { + "type": "bool" + }, + "NMAXFOCKAE": { + "type": "int", + "values": [ + 1, + 2 + ] + }, + "NOMEGA": { + "type": "int" + }, + "NOMEGAPAR": { + "type": "int" + }, + "NOMEGAR": { + "type": "int" + }, + "NPACO": { + "type": "int" + }, + "NPAR": { + "type": "int" + }, + "NPPSTR": { + "type": "int" + }, + "NSIM": { + "type": "int" + }, + "NSUBSYS": { + "type": "list" + }, + "NSW": { + "type": "int" + }, + "NTARGET_STATES": { + "type": "list" + }, + "NTAUPAR": { + "type": "int" + }, + "NUPDOWN": { + "type": "int" + }, + "NWRITE": { + "type": "int", + "values": [ + 0, + 1, + 2, + 3, + 4 + ] + }, + "ODDONLY": { + "type": "bool" + }, + "ODDONLYGW": { + "type": "bool" + }, + "OFIELD_A": { + "type": "float" + }, + "OFIELD_KAPPA": { + "type": "float" + }, + "OFIELD_Q6_FAR": { + "type": "float" + }, + "OFIELD_Q6_NEAR": { + "type": "float" + }, + "OMEGAMAX": { + "type": "float" + }, + "OMEGAMIN": { + "type": "float" + }, + "OMEGATL": { + "type": "float" + }, + "PARAM1": { + "type": "float" + }, + "PARAM2": { + "type": "float" + }, + "PFLAT": { + "type": "bool" + }, + "PHON_LBOSE": { + "type": "bool" + }, + "PHON_LMC": { + "type": "bool" + }, + "PHON_NSTRUCT": { + "type": "int" + }, + "PHON_NTLIST": { + "type": "int" + }, + "PHON_TLIST": { + "type": "list" + }, + "PLEVEL": { + "type": "int" + }, + "PMASS": { + "type": "float" + }, + "POMASS": { + "type": "float" + }, + "POTIM": { + "type": "float" + }, + "PREC": { + "type": "str", + "values": [ + "Low", + "Medium", + "High", + "Normal", + "Single", + "Accurate" + ] + }, + "PRECFOCK": { + "type": "str", + "values": [ + "Low", + "Medium", + "Fast", + "Normal", + "Accurate" + ] + }, + "PROUTINE": { + "type": "int" + }, + "PSTRESS": { + "type": "float" + }, + "PSUBSYS": { + "type": "list" + }, + "PTHRESHOLD": { + "type": "float" + }, + "QMAXFOCKAE": { + "type": "list" + }, + "QSPIRAL": { + "type": "list" + }, + "QUAD_EFG": { + "type": "list" + }, + "RANDOM_SEED": { + "type": "list" + }, + "ROPT": { + "type": "list" + }, + "RWIGS": { + "type": "list" + }, + "SAXIS": { + "type": "list" + }, + "SCSRAD": { + "type": "float" + }, + "SHAKEMAXITER": { + "type": "int" + }, + "SHAKETOL": { + "type": "float" + }, + "SIGMA": { + "type": "float" + }, + "SMASS": { + "type": "float" + }, + "SMEARINGS": { + "type": "list" + }, + "SPRING": { + "type": "int" + }, + "STEP_MAX": { + "type": "float" + }, + "STEP_SIZE": { + "type": "float" + }, + "SYMPREC": { + "type": "float" + }, + "SYSTEM": { + "type": "str" +}, + "TEBEG": { + "type": "float" + }, + "TEEND": { + "type": "float" + }, + "TIME": { + "type": "float" + }, + "TSUBSYS": { + "type": "list" + }, + "VALUE_MAX": { + "type": "list" + }, + "VALUE_MIN": { + "type": "list" + }, + "VCUTOFF": { + "type": "float" + }, + "VDW_A1": { + "type": "float" + }, + "VDW_A2": { + "type": "float" + }, + "VDW_C6": { + "type": "list" + }, + "VDW_CNRADIUS": { + "type": "float" + }, + "VDW_D": { + "type": "float" + }, + "VDW_R0": { + "type": "list" + }, + "VDW_RADIUS": { + "type": "float" + }, + "VDW_S6": { + "type": "float" + }, + "VDW_S8": { + "type": "float" + }, + "VDW_SR": { + "type": "float" + }, + "VOSKOWN": { + "type": "int", + "values": [ + 0, + 1 + ] + }, + "WC": { + "type": "float" + }, + "WEIMIN": { + "type": "float" + }, + "ZVAL": { + "type": "float" + }, + "ISPIND": { + "type": "int", + "values": [ + 1, + 2 + ] + }, + "LCOMPAT": { + "type": "bool" + }, + "ENMAX": { + "type": "str" +}, + "LMETAGGA": { + "type": "bool" + }, + "MIXFIRST": { + "type": "bool" + }, + "LDOWNSAMPLE": { + "type": "bool" + }, + "STM": { + "type": "bool" + }, + "LORBITALREAL": { + "type": "bool" + }, + "LMUSIC": { + "type": "bool" + }, + "DARWINR": { + "type": "bool" + }, + "DARWINV": { + "type": "bool" + }, + "LSYMGRAD": { + "type": "bool" + }, + "LHFONE": { + "type": "bool" + }, + "LRHFCALC": { + "type": "bool" + }, + "LMODELHF": { + "type": "bool" + }, + "SHIFTRED": { + "type": "bool" + }, + "HFSCREENC": { + "type": "bool" + }, + "LVEL": { + "type": "bool" + }, + "NUCIND": { + "type": "bool" + }, + "MAGPOS": { + "type": "bool" + }, + "LNICSALL": { + "type": "bool" + }, + "ORBITALMAG": { + "type": "bool" + }, + "LMAGBLOCH": { + "type": "bool" + }, + "LGAUGE": { + "type": "bool" + }, + "LRPAFORCE": { + "type": "bool" + }, + "LFXC": { + "type": "bool" + }, + "LTCTE": { + "type": "bool" + }, + "LTETE": { + "type": "bool" + }, + "LTRIPLET": { + "type": "bool" + }, + "LFXCEPS": { + "type": "bool" + }, + "LFXHEG": { + "type": "bool" + }, + "LUSEW": { + "type": "bool" + }, + "ENCUTLF": { + "type": "bool" + }, + "SELFENERGY": { + "type": "bool" + }, + "LSINGLES": { + "type": "bool" + }, + "LFERMIGW": { + "type": "bool" + }, + "LSOL": { + "type": "bool" + }, + "MAGDIPOLOUT": { + "type": "bool" + } } diff --git a/pymatgen/io/vasp/inputs.py b/pymatgen/io/vasp/inputs.py index 00105b6a98c..04af6e8322d 100644 --- a/pymatgen/io/vasp/inputs.py +++ b/pymatgen/io/vasp/inputs.py @@ -679,10 +679,6 @@ class BadPoscarWarning(UserWarning): """Warning class for bad POSCAR entries.""" -with open(f"{module_dir}/incar_parameters.json", encoding="utf-8") as json_file: - incar_params = json.loads(json_file.read()) - - class Incar(dict, MSONable): """ INCAR object for reading and writing INCAR files. Essentially consists of @@ -967,22 +963,30 @@ def __add__(self, other): return Incar(params) def check_params(self): + """Check INCAR for invalid tags or values. + If a tag doesn't exist, calculation will still run, however VASP + will ignore the tag and set it as default without letting you know. """ - Raise a warning for nonexistent INCAR tags or invalid values. - If a tag doesn't exist (e.g. typo), calculation will still run, - however VASP will ignore the tag without letting you know. - """ + # Load INCAR tag/value check reference file + with open(os.path.join(module_dir, "incar_parameters.json"), encoding="utf-8") as json_file: + incar_params = json.loads(json_file.read()) + for tag, val in self.items(): - # First check if this tag exists + # Check if the tag exists if tag not in incar_params: warnings.warn(f"Cannot find {tag} in the list of INCAR tags", BadIncarWarning, stacklevel=2) + continue + + # Check value and its type + param_type = incar_params[tag].get("type") + allowed_values = incar_params[tag].get("values") - # Now check if the tag type is appropriate - elif isinstance(incar_params[tag], str) and type(val).__name__ != incar_params[tag]: - warnings.warn(f"{tag}: {val} is not a {incar_params[tag]}", BadIncarWarning, stacklevel=2) + if param_type is not None and not isinstance(val, eval(param_type)): + warnings.warn(f"{tag}: {val} is not a {param_type}", BadIncarWarning, stacklevel=2) - # Check if the given value is in the list - elif isinstance(incar_params[tag], list) and val not in incar_params[tag]: + # Only check value when it's not None, + # meaning there is recording for corresponding value + if allowed_values is not None and val not in allowed_values: warnings.warn(f"{tag}: Cannot find {val} in the list of values", BadIncarWarning, stacklevel=2) From 25b61a7e1875e563fc0b04992a3f1bf2cac89111 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Tue, 13 Feb 2024 18:16:10 +0800 Subject: [PATCH 2/4] move path declare to where its used --- pymatgen/io/vasp/inputs.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pymatgen/io/vasp/inputs.py b/pymatgen/io/vasp/inputs.py index 04af6e8322d..27dc7083e6d 100644 --- a/pymatgen/io/vasp/inputs.py +++ b/pymatgen/io/vasp/inputs.py @@ -50,12 +50,6 @@ logger = logging.getLogger(__name__) module_dir = os.path.dirname(os.path.abspath(__file__)) -# hashes computed from the full POTCAR file contents by pymatgen (not 1st-party VASP hashes) -PYMATGEN_POTCAR_HASHES = loadfn(f"{module_dir}/vasp_potcar_pymatgen_hashes.json") -# written to some newer POTCARs by VASP -VASP_POTCAR_HASHES = loadfn(f"{module_dir}/vasp_potcar_file_hashes.json") -POTCAR_STATS_PATH = os.path.join(module_dir, "potcar-summary-stats.json.bz2") - class Poscar(MSONable): """Object for representing the data in a POSCAR or CONTCAR file. @@ -1601,6 +1595,13 @@ class UnknownPotcarWarning(UserWarning): """Warning raised when POTCAR hashes do not pass validation.""" +# hashes computed from the full POTCAR file contents by pymatgen (not 1st-party VASP hashes) +PYMATGEN_POTCAR_HASHES = loadfn(f"{module_dir}/vasp_potcar_pymatgen_hashes.json") +# written to some newer POTCARs by VASP +VASP_POTCAR_HASHES = loadfn(f"{module_dir}/vasp_potcar_file_hashes.json") +POTCAR_STATS_PATH = os.path.join(module_dir, "potcar-summary-stats.json.bz2") + + class PotcarSingle: """ Object for a **single** POTCAR. The builder assumes the POTCAR contains From 5c590abcc222438b48256057f9d4dfd259b92255 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 15 Feb 2024 21:19:02 +0800 Subject: [PATCH 3/4] relocate warning for consistency --- pymatgen/io/vasp/inputs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymatgen/io/vasp/inputs.py b/pymatgen/io/vasp/inputs.py index 27dc7083e6d..aa31d7596b9 100644 --- a/pymatgen/io/vasp/inputs.py +++ b/pymatgen/io/vasp/inputs.py @@ -1591,10 +1591,6 @@ def _parse_list(s): OrbitalDescription = namedtuple("OrbitalDescription", ["l", "E", "Type", "Rcut", "Type2", "Rcut2"]) -class UnknownPotcarWarning(UserWarning): - """Warning raised when POTCAR hashes do not pass validation.""" - - # hashes computed from the full POTCAR file contents by pymatgen (not 1st-party VASP hashes) PYMATGEN_POTCAR_HASHES = loadfn(f"{module_dir}/vasp_potcar_pymatgen_hashes.json") # written to some newer POTCARs by VASP @@ -2571,6 +2567,10 @@ def set_symbols( self.extend(PotcarSingle.from_symbol_and_functional(el, functional) for el in symbols) +class UnknownPotcarWarning(UserWarning): + """Warning raised when POTCAR hashes do not pass validation.""" + + class VaspInput(dict, MSONable): """Class to contain a set of vasp input objects corresponding to a run.""" From 19502c0a54e2e26b5dff3b1918f85ccc85690b37 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Fri, 16 Feb 2024 15:57:45 +0800 Subject: [PATCH 4/4] add return type annotation --- pymatgen/io/vasp/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymatgen/io/vasp/inputs.py b/pymatgen/io/vasp/inputs.py index aa31d7596b9..b8117733966 100644 --- a/pymatgen/io/vasp/inputs.py +++ b/pymatgen/io/vasp/inputs.py @@ -956,7 +956,7 @@ def __add__(self, other): params[key] = val return Incar(params) - def check_params(self): + def check_params(self) -> None: """Check INCAR for invalid tags or values. If a tag doesn't exist, calculation will still run, however VASP will ignore the tag and set it as default without letting you know.