本文整理汇总了Python中pymatgen.core.Structure.from_spacegroup方法的典型用法代码示例。如果您正苦于以下问题:Python Structure.from_spacegroup方法的具体用法?Python Structure.from_spacegroup怎么用?Python Structure.from_spacegroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.core.Structure
的用法示例。
在下文中一共展示了Structure.from_spacegroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_metal_check
# 需要导入模块: from pymatgen.core import Structure [as 别名]
# 或者: from pymatgen.core.Structure import from_spacegroup [as 别名]
def test_metal_check(self):
structure = Structure.from_spacegroup("Fm-3m", Lattice.cubic(3),
["Cu"], [[0, 0, 0]])
with warnings.catch_warnings(record=True) as w:
# Cause all warnings to always be triggered.
warnings.simplefilter("always")
# Trigger a warning.
vis = MITRelaxSet(structure)
incar = vis.incar
# Verify some things
self.assertIn("ISMEAR", str(w[-1].message))
示例2: setUp
# 需要导入模块: from pymatgen.core import Structure [as 别名]
# 或者: from pymatgen.core.Structure import from_spacegroup [as 别名]
def setUp(self):
parser = CifParser(os.path.join(test_dir, 'Fe.cif'))
self.Fe = parser.get_structures()[0]
parser = CifParser(os.path.join(test_dir, 'LiFePO4.cif'))
self.LiFePO4 = parser.get_structures()[0]
parser = CifParser(os.path.join(test_dir, 'Fe3O4.cif'))
self.Fe3O4 = parser.get_structures()[0]
parser = CifParser(os.path.join(test_dir, 'magnetic.ncl.example.GdB4.mcif'))
self.GdB4 = parser.get_structures()[0]
parser = CifParser(os.path.join(test_dir, 'magnetic.example.NiO.mcif'))
self.NiO_expt = parser.get_structures()[0]
latt = Lattice.cubic(4.17)
species = ["Ni", "O"]
coords = [[0, 0, 0],
[0.5, 0.5, 0.5]]
self.NiO = Structure.from_spacegroup(225, latt, species, coords)
latt = Lattice([[2.085, 2.085, 0.0],
[0.0, -2.085, -2.085],
[-2.085, 2.085, -4.17]])
species = ["Ni", "Ni", "O", "O"]
coords = [[0.5, 0, 0.5],
[0, 0, 0],
[0.25, 0.5, 0.25],
[0.75, 0.5, 0.75]]
self.NiO_AFM_111 = Structure(latt, species, coords, site_properties={'magmom': [-5, 5, 0, 0]})
latt = Lattice([[2.085, 2.085, 0],
[0, 0, -4.17],
[-2.085, 2.085, 0]])
species = ["Ni", "Ni", "O", "O"]
coords = [[0.5, 0.5, 0.5],
[0, 0, 0],
[0, 0.5, 0],
[0.5, 0, 0.5]]
self.NiO_AFM_001 = Structure(latt, species, coords, site_properties={'magmom': [-5, 5, 0, 0]})
示例3: Workflow
# 需要导入模块: from pymatgen.core import Structure [as 别名]
# 或者: from pymatgen.core.Structure import from_spacegroup [as 别名]
if scan:
wf_name += " - SCAN"
wf = Workflow(fws, name=wf_name)
wf = add_additional_fields_to_taskdocs(wf, {"wf_meta": self.wf_meta})
tag = "magnetic_orderings group: >>{}<<".format(self.uuid)
wf = add_tags(wf, [tag, ordered_structure_origins])
return wf
if __name__ == "__main__":
# for trying workflows
from fireworks import LaunchPad
latt = Lattice.cubic(4.17)
species = ["Ni", "O"]
coords = [[0.00000, 0.00000, 0.00000], [0.50000, 0.50000, 0.50000]]
NiO = Structure.from_spacegroup(225, latt, species, coords)
wf_deformation = get_wf_magnetic_deformation(NiO)
wf_orderings = MagneticOrderingsWF(NiO).get_wf()
lpad = LaunchPad.auto_load()
lpad.add_wf(wf_orderings)
lpad.add_wf(wf_deformation)