本文整理汇总了Python中pymatgen.entries.computed_entries.ComputedEntry类的典型用法代码示例。如果您正苦于以下问题:Python ComputedEntry类的具体用法?Python ComputedEntry怎么用?Python ComputedEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ComputedEntry类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, structure, kpoints, incar, energy, correction=0.0,
parameters=None, data=None, entry_id=None):
ComputedEntry.__init__(self, structure.composition, energy,
correction=correction,
parameters=parameters,
data=data, entry_id=entry_id)
self.structure = structure
self.kpoints = kpoints
self.incar = incar
开发者ID:JARVIS-Unifies,项目名称:MPInterfaces,代码行数:9,代码来源:data_processor.py
示例2: as_entry
def as_entry(self, energies):
"""
Returns a ComputedEntry representation of the reaction.
:return:
"""
comp = sum(self._all_comp, Composition())
entry = ComputedEntry(0.5 * comp, self.calculate_energy(energies))
entry.name = self.__str__()
return entry
开发者ID:sonium0,项目名称:pymatgen,代码行数:9,代码来源:reaction_calculator.py
示例3: as_entry
def as_entry(self, energies):
"""
Returns a ComputedEntry representation of the reaction.
:return:
"""
relevant_comp = [comp * abs(coeff) for coeff, comp
in zip(self._coeffs, self._all_comp)]
comp = sum(relevant_comp, Composition())
entry = ComputedEntry(0.5 * comp, self.calculate_energy(energies))
entry.name = self.__str__()
return entry
开发者ID:ExpHP,项目名称:pymatgen,代码行数:11,代码来源:reaction_calculator.py
示例4: setUp
def setUp(self):
self.entry = ComputedEntry(vasprun.final_structure.composition,
vasprun.final_energy,
parameters=vasprun.incar)
self.entry2 = ComputedEntry({"Fe": 2, "O": 3}, 2.3)
self.entry3 = ComputedEntry("Fe2O3", 2.3)
self.entry4 = ComputedEntry("Fe2O3", 2.3, entry_id=1)
开发者ID:albalu,项目名称:pymatgen,代码行数:7,代码来源:test_computed_entries.py
示例5: setUp
def setUp(self):
d = [
{"correction": 0.0, "data": {}, "energy": -108.56492362, "parameters": {}, "composition": {"Li": 54}},
{
"correction": 0.0,
"data": {},
"energy": -577.94689128,
"parameters": {},
"composition": {"O": 32, "Li": 64},
},
{"correction": 0.0, "data": {}, "energy": -17.02844794, "parameters": {}, "composition": {"O": 2}},
{
"correction": 0.0,
"data": {},
"energy": -959.64693323,
"parameters": {},
"composition": {"O": 72, "Li": 72},
},
]
entries = []
for e in d:
entries.append(ComputedEntry.from_dict(e))
rcts = list(filter(lambda e: e.composition.reduced_formula in ["Li", "O2"], entries))
prods = list(filter(lambda e: e.composition.reduced_formula == "Li2O2", entries))
self.rxn = ComputedReaction(rcts, prods)
开发者ID:rousseab,项目名称:pymatgen,代码行数:26,代码来源:test_reaction_calculator.py
示例6: ComputedEntryTest
class ComputedEntryTest(unittest.TestCase):
def setUp(self):
self.entry = ComputedEntry(vasprun.final_structure.composition, vasprun.final_energy, parameters=vasprun.incar)
self.entry2 = ComputedEntry({"Fe": 2, "O": 3}, 2.3)
self.entry3 = ComputedEntry("Fe2O3", 2.3)
self.entry4 = ComputedEntry("Fe2O3", 2.3, entry_id=1)
def test_energy(self):
self.assertAlmostEqual(self.entry.energy, -269.38319884)
self.entry.correction = 1.0
self.assertAlmostEqual(self.entry.energy, -268.38319884)
self.assertAlmostEqual(self.entry3.energy_per_atom, 2.3 / 5)
def test_composition(self):
self.assertEqual(self.entry.composition.reduced_formula, "LiFe4(PO4)4")
self.assertEqual(self.entry2.composition.reduced_formula, "Fe2O3")
def test_to_from_dict(self):
d = self.entry.as_dict()
e = ComputedEntry.from_dict(d)
self.assertAlmostEqual(e.energy, -269.38319884)
def test_entry_id(self):
self.assertEqual(self.entry4.entry_id, 1)
self.assertEqual(self.entry2.entry_id, None)
def test_str(self):
self.assertIsNotNone(str(self.entry))
开发者ID:georgeyumnam,项目名称:pymatgen,代码行数:28,代码来源:test_computed_entries.py
示例7: test_get_corrections_dict
def test_get_corrections_dict(self):
compat = MaterialsProjectCompatibility()
ggacompat = MaterialsProjectCompatibility("GGA")
#Correct parameters
entry = ComputedEntry(
'Fe2O3', -1, 0.0,
parameters={'is_hubbard': True, 'hubbards': {'Fe': 5.3, 'O': 0},
'run_type': 'GGA+U',
'potcar_symbols': ['PAW_PBE Fe_pv 06Sep2000',
'PAW_PBE O 08Apr2002']})
c = compat.get_corrections_dict(entry)
self.assertAlmostEqual(c["MP Gas Correction"], -2.10687)
self.assertAlmostEqual(c["MP Advanced Correction"], -5.466)
entry.parameters["is_hubbard"] = False
del entry.parameters["hubbards"]
c = ggacompat.get_corrections_dict(entry)
self.assertNotIn("MP Advanced Correction", c)
开发者ID:image-tester,项目名称:pymatgen,代码行数:20,代码来源:test_compatibility.py
示例8: test_get_corrections_dict
def test_get_corrections_dict(self):
compat = MaterialsProjectCompatibility(check_potcar_hash=False)
ggacompat = MaterialsProjectCompatibility("GGA", check_potcar_hash=False)
#Correct parameters
entry = ComputedEntry(
'Fe2O3', -1, 0.0,
parameters={'is_hubbard': True, 'hubbards': {'Fe': 5.3, 'O': 0},
'run_type': 'GGA+U',
'potcar_spec': [{'titel':'PAW_PBE Fe_pv 06Sep2000',
'hash': '994537de5c4122b7f1b77fb604476db4'},
{'titel': 'PAW_PBE O 08Apr2002',
'hash': "7a25bc5b9a5393f46600a4939d357982"}]})
c = compat.get_corrections_dict(entry)
self.assertAlmostEqual(c["MP Anion Correction"], -2.10687)
self.assertAlmostEqual(c["MP Advanced Correction"], -5.466)
entry.parameters["is_hubbard"] = False
del entry.parameters["hubbards"]
c = ggacompat.get_corrections_dict(entry)
self.assertNotIn("MP Advanced Correction", c)
开发者ID:fraricci,项目名称:pymatgen,代码行数:21,代码来源:test_compatibility.py
示例9: from_dict
def from_dict(cls, d):
entries = [ComputedEntry.from_dict(dd) for dd in d["all_entries"]]
elements = [Element.from_dict(dd) for dd in d["elements"]]
return cls(entries, elements)
开发者ID:artemcpp,项目名称:pymatgen,代码行数:4,代码来源:pdmaker.py
示例10: test_to_from_dict
def test_to_from_dict(self):
d = self.entry.to_dict
e = ComputedEntry.from_dict(d)
self.assertAlmostEqual(e.energy, -269.38319884)
开发者ID:qimin,项目名称:pymatgen,代码行数:4,代码来源:test_computed_entries.py
示例11: test_sulfide_energy
def test_sulfide_energy(self):
self.entry = ComputedEntry("BaS", -10.21249155)
self.assertAlmostEqual(self.entry.energy, -10.21249155)
self.assertAlmostEqual(self.entry.energy_per_atom, -10.21249155 / 2)
self.entry.correction = 1.0
self.assertAlmostEqual(self.entry.energy, -9.21249155)
开发者ID:albalu,项目名称:pymatgen,代码行数:6,代码来源:test_computed_entries.py
示例12: convert
def convert(self, d):
if 'structure' in d:
return ComputedStructureEntry.from_dict(d)
else:
return ComputedEntry.from_dict(d)
开发者ID:chenweis,项目名称:pymatgen,代码行数:5,代码来源:hive.py
注:本文中的pymatgen.entries.computed_entries.ComputedEntry类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论