本文整理汇总了Python中pymatgen.io.vasp.outputs.Outcar.read_chemical_shifts方法的典型用法代码示例。如果您正苦于以下问题:Python Outcar.read_chemical_shifts方法的具体用法?Python Outcar.read_chemical_shifts怎么用?Python Outcar.read_chemical_shifts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.io.vasp.outputs.Outcar
的用法示例。
在下文中一共展示了Outcar.read_chemical_shifts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_chemical_shifts_with_different_core_contribution
# 需要导入模块: from pymatgen.io.vasp.outputs import Outcar [as 别名]
# 或者: from pymatgen.io.vasp.outputs.Outcar import read_chemical_shifts [as 别名]
def test_chemical_shifts_with_different_core_contribution(self):
filename = os.path.join(test_dir, "nmr", "cs", "core.diff", "core.diff.chemical.shifts.OUTCAR")
outcar = Outcar(filename)
outcar.read_chemical_shifts()
c_vo = outcar.data["chemical_shifts"]["valence_only"][7].maryland_values
for x1, x2 in zip(list(c_vo), [198.7009, 73.7484, 1.0000]):
self.assertAlmostEqual(x1, x2)
c_vc = outcar.data["chemical_shifts"]["valence_and_core"][7].maryland_values
for x1, x2 in zip(list(c_vc), [-1.9406, 73.7484, 1.0000]):
self.assertAlmostEqual(x1, x2)
示例2: test_chemical_shifts
# 需要导入模块: from pymatgen.io.vasp.outputs import Outcar [as 别名]
# 或者: from pymatgen.io.vasp.outputs.Outcar import read_chemical_shifts [as 别名]
def test_chemical_shifts(self):
filename = os.path.join(test_dir, "nmr_chemical_shift", "hydromagnesite", "OUTCAR")
outcar = Outcar(filename)
outcar.read_chemical_shifts()
expected_chemical_shifts = [[191.9974, 69.5232, 0.6342],
[195.0808, 68.183, 0.833],
[192.0389, 69.5762, 0.6329],
[195.0844, 68.1756, 0.8336],
[192.005, 69.5289, 0.6339],
[195.0913, 68.1859, 0.833],
[192.0237, 69.565, 0.6333],
[195.0788, 68.1733, 0.8337]]
self.assertAlmostEqual(len(outcar.data["chemical_shifts"][20: 28]),
len(expected_chemical_shifts))
for c1, c2 in zip(outcar.data["chemical_shifts"][20: 28],
expected_chemical_shifts):
for x1, x2 in zip(list(c1.maryland_values), c2):
self.assertAlmostEqual(x1, x2, places=5)