本文整理汇总了Python中pymatgen.io.vasp.inputs.Potcar.from_dict方法的典型用法代码示例。如果您正苦于以下问题:Python Potcar.from_dict方法的具体用法?Python Potcar.from_dict怎么用?Python Potcar.from_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.io.vasp.inputs.Potcar
的用法示例。
在下文中一共展示了Potcar.from_dict方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pymatgen.io.vasp.inputs import Potcar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Potcar import from_dict [as 别名]
def __init__(self, name, incar, poscar, potcar, kpoints,
qadapter=None, **kwargs ):
"""
default INCAR from config_dict
"""
self.name = name
self.incar = Incar.from_dict(incar.as_dict())
self.poscar = Poscar.from_dict(poscar.as_dict())
self.potcar = Potcar.from_dict(potcar.as_dict())
self.kpoints = Kpoints.from_dict(kpoints.as_dict())
self.extra = kwargs
if qadapter is not None:
self.qadapter = qadapter.from_dict(qadapter.to_dict())
else:
self.qadapter = None
config_dict = {}
config_dict['INCAR'] = self.incar.as_dict()
config_dict['POSCAR'] = self.poscar.as_dict()
#caution the key and the value are not always the same
config_dict['POTCAR'] = self.potcar.as_dict()
#dict(zip(self.potcar.as_dict()['symbols'],
#self.potcar.as_dict()['symbols']))
config_dict['KPOINTS'] = self.kpoints.as_dict()
#self.user_incar_settings = self.incar.as_dict()
DictVaspInputSet.__init__(self, name, config_dict,
ediff_per_atom=False, **kwargs)
示例2: from_dict
# 需要导入模块: from pymatgen.io.vasp.inputs import Potcar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Potcar import from_dict [as 别名]
def from_dict(cls, d):
incar = Incar.from_dict(d["incar"])
poscar = Poscar.from_dict(d["poscar"])
potcar = Potcar.from_dict(d["potcar"])
kpoints = Kpoints.from_dict(d["kpoints"])
qadapter = None
if d["qadapter"] is not None:
qadapter = CommonAdapter.from_dict(d["qadapter"])
return MPINTVaspInputSet(d["name"], incar, poscar, potcar,
kpoints, qadapter, **d["kwargs"])
示例3: from_dict
# 需要导入模块: from pymatgen.io.vasp.inputs import Potcar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Potcar import from_dict [as 别名]
def from_dict(cls, d):
incar = Incar.from_dict(d["incar"])
poscar = Poscar.from_dict(d["poscar"])
potcar = Potcar.from_dict(d["potcar"])
kpoints = Kpoints.from_dict(d["kpoints"])
qadapter = None
if d["qadapter"] is not None:
qadapter = CommonAdapter.from_dict(d["qadapter"])
script_name = d["script_name"]
return MPINTVaspInputSet(d["name"], incar, poscar, potcar,
kpoints, qadapter,
script_name=script_name,
vis_logger=logging.getLogger(d["logger"]),
**d["kwargs"])
示例4: from_dict
# 需要导入模块: from pymatgen.io.vasp.inputs import Potcar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Potcar import from_dict [as 别名]
def from_dict(cls, d):
incar = Incar.from_dict(d["incar"])
poscar = Poscar.from_dict(d["poscar"])
potcar = Potcar.from_dict(d["potcar"])
kpoints = Kpoints.from_dict(d["kpoints"])
cal = Calibrate(incar, poscar, potcar, kpoints,
system=d["system"], is_matrix = d["is_matrix"],
Grid_type = d["Grid_type"],
parent_job_dir=d["parent_job_dir"],
job_dir=d["job_dir"], qadapter=d.get("qadapter"),
job_cmd=d["job_cmd"], wait=d["wait"],
turn_knobs=d["turn_knobs"])
cal.job_dir_list = d["job_dir_list"]
cal.job_ids = d["job_ids"]
return cal
示例5: __init__
# 需要导入模块: from pymatgen.io.vasp.inputs import Potcar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Potcar import from_dict [as 别名]
def __init__(self, name, incar, poscar, kpoints, potcar=None,
qadapter=None, script_name='submit_script',
vis_logger=None, reuse_path=None, test=False,
**kwargs):
"""
default INCAR from config_dict
"""
self.name = name
self.test = test
self.incar_init = Incar.from_dict(incar.as_dict())
self.poscar_init = Poscar.from_dict(poscar.as_dict())
if not self.test:
self.potcar_init = Potcar.from_dict(potcar.as_dict())
if not isinstance(kpoints, str):
self.kpoints_init = Kpoints.from_dict(kpoints.as_dict())
else:
self.kpoints_init = kpoints
self.reuse_path = reuse_path # complete reuse paths
self.extra = kwargs
if qadapter is not None:
self.qadapter = qadapter.from_dict(qadapter.to_dict())
else:
self.qadapter = None
self.script_name = script_name
config_dict = {}
config_dict['INCAR'] = self.incar_init.as_dict()
config_dict['POSCAR'] = self.poscar_init.as_dict()
# caution the key and the value are not always the same
if not self.test:
config_dict['POTCAR'] = self.potcar_init.as_dict()
# dict(zip(self.potcar.as_dict()['symbols'],
# self.potcar.as_dict()['symbols']))
if not isinstance(kpoints, str):
config_dict['KPOINTS'] = self.kpoints_init.as_dict()
else:
# need to find a way to dictify this kpoints string more
# appropriately
config_dict['KPOINTS'] = {'kpts_hse':self.kpoints_init}
# self.user_incar_settings = self.incar.as_dict()
DictSet.__init__(self, poscar.structure, config_dict)
#**kwargs)
if vis_logger:
self.logger = vis_logger
else:
self.logger = logger
示例6: test_to_from_dict
# 需要导入模块: from pymatgen.io.vasp.inputs import Potcar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Potcar import from_dict [as 别名]
def test_to_from_dict(self):
d = self.potcar.as_dict()
potcar = Potcar.from_dict(d)
self.assertEqual(potcar.symbols, ["Fe", "P", "O"])