本文整理汇总了Python中pymatgen.symmetry.analyzer.SpacegroupAnalyzer.get_point_group_operations方法的典型用法代码示例。如果您正苦于以下问题:Python SpacegroupAnalyzer.get_point_group_operations方法的具体用法?Python SpacegroupAnalyzer.get_point_group_operations怎么用?Python SpacegroupAnalyzer.get_point_group_operations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.symmetry.analyzer.SpacegroupAnalyzer
的用法示例。
在下文中一共展示了SpacegroupAnalyzer.get_point_group_operations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: symm_check
# 需要导入模块: from pymatgen.symmetry.analyzer import SpacegroupAnalyzer [as 别名]
# 或者: from pymatgen.symmetry.analyzer.SpacegroupAnalyzer import get_point_group_operations [as 别名]
def symm_check(self, ucell, wulff_vertices):
"""
# Checks if the point group of the Wulff shape matches
# the point group of its conventional unit cell
Args:
ucell (string): Unit cell that the Wulff shape is based on.
wulff_vertices (list): List of all vertices on the Wulff
shape. Use wulff.wulff_pt_list to obtain the list
(see wulff_generator.py).
return (bool)
"""
space_group_analyzer = SpacegroupAnalyzer(ucell)
symm_ops = space_group_analyzer.get_point_group_operations(
cartesian=True)
for point in wulff_vertices:
for op in symm_ops:
symm_point = op.operate(point)
if in_coord_list(wulff_vertices, symm_point):
continue
else:
return False
return True
示例2: symmetrize
# 需要导入模块: from pymatgen.symmetry.analyzer import SpacegroupAnalyzer [as 别名]
# 或者: from pymatgen.symmetry.analyzer.SpacegroupAnalyzer import get_point_group_operations [as 别名]
def symmetrize(self, structure):
tensor = self._reduced_tensor
if self._is_real_space:
real_lattice = self._lattice
else:
real_lattice = self._lattice.reciprocal_lattice
# I guess this is the reason why tensor.symmetrize (omega) is so slow!
real_finder = SpacegroupAnalyzer(structure)
real_symmops = real_finder.get_point_group_operations(cartesian=True)
cartesian_tensor = self.cartesian_tensor
sym_tensor = np.zeros((3,3))
my_tensor = cartesian_tensor
for real_sym in real_symmops:
mat = real_sym.rotation_matrix
prod_sym = np.dot(np.transpose(mat),np.dot(cartesian_tensor,mat))
sym_tensor = sym_tensor + prod_sym
sym_tensor = sym_tensor/len(real_symmops)
self._reduced_tensor = from_cart_to_red(sym_tensor,self._lattice)
示例3: get_sym_eq_kpoints
# 需要导入模块: from pymatgen.symmetry.analyzer import SpacegroupAnalyzer [as 别名]
# 或者: from pymatgen.symmetry.analyzer.SpacegroupAnalyzer import get_point_group_operations [as 别名]
def get_sym_eq_kpoints(self, kpoint, cartesian=False, tol=1e-2):
"""
Returns a list of unique symmetrically equivalent k-points.
Args:
kpoint (1x3 array): coordinate of the k-point
cartesian (bool): kpoint is in cartesian or fractional coordinates
tol (float): tolerance below which coordinates are considered equal
Returns:
([1x3 array] or None): if structure is not available returns None
"""
if not self.structure:
return None
sg = SpacegroupAnalyzer(self.structure)
symmops = sg.get_point_group_operations(cartesian=cartesian)
points = np.dot(kpoint, [m.rotation_matrix for m in symmops])
rm_list = []
# identify and remove duplicates from the list of equivalent k-points:
for i in range(len(points) - 1):
for j in range(i + 1, len(points)):
if np.allclose(pbc_diff(points[i], points[j]), [0, 0, 0], tol):
rm_list.append(i)
break
return np.delete(points, rm_list, axis=0)