本文整理汇总了Python中phonopy.structure.symmetry.Symmetry._set_map_operations方法的典型用法代码示例。如果您正苦于以下问题:Python Symmetry._set_map_operations方法的具体用法?Python Symmetry._set_map_operations怎么用?Python Symmetry._set_map_operations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phonopy.structure.symmetry.Symmetry
的用法示例。
在下文中一共展示了Symmetry._set_map_operations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_map_operations
# 需要导入模块: from phonopy.structure.symmetry import Symmetry [as 别名]
# 或者: from phonopy.structure.symmetry.Symmetry import _set_map_operations [as 别名]
def test_get_map_operations(self):
symprec = 1e-5
cell = get_unitcell_from_phonopy_yaml(
os.path.join(data_dir,"../NaCl.yaml"))
scell = get_supercell(cell, np.diag([2, 2, 2]), symprec=symprec)
symmetry = Symmetry(scell, symprec=symprec)
start = time.time()
symmetry._set_map_operations()
end = time.time()
# print(end - start)
map_ops = symmetry.get_map_operations()
map_atoms = symmetry.get_map_atoms()
positions = scell.get_scaled_positions()
rotations = symmetry.get_symmetry_operations()['rotations']
translations = symmetry.get_symmetry_operations()['translations']
for i, (op_i, atom_i) in enumerate(zip(map_ops, map_atoms)):
r_pos = np.dot(rotations[op_i], positions[i]) + translations[op_i]
diff = positions[atom_i] - r_pos
diff -= np.rint(diff)
self.assertTrue((diff < symprec).all())