diff --git a/pyxtal/operations.py b/pyxtal/operations.py index 41947fd..2fc3e17 100644 --- a/pyxtal/operations.py +++ b/pyxtal/operations.py @@ -725,7 +725,8 @@ def __init__(self, op, parse_trans=False, hexagonal=False): self.axis = rotvec / self.angle if self.hexagonal: # print('convert hex', self.axis, np.dot(self.axis, hex_cell)) - self.axis = np.dot(self.axis, hex_cell) + if np.linalg.norm(self.axis - np.array([1, 0, 0])) > 1e-4: + self.axis = np.dot(self.axis, hex_cell) # parse symmetry direction if self.parse_trans and not self.parse_axis(): self.axis *= -1 @@ -758,8 +759,9 @@ def __init__(self, op, parse_trans=False, hexagonal=False): self.angle = np.linalg.norm(rotvec) self.axis = rotvec / self.angle if self.hexagonal: - # print('convert hex', self.axis, np.dot(self.axis, hex_cell)) - self.axis = np.dot(self.axis, hex_cell) + if np.linalg.norm(self.axis - np.array([1, 0, 0])) > 1e-4: + # print('convert hex', self.axis, np.dot(self.axis, hex_cell)) + self.axis = np.dot(self.axis, hex_cell) if np.isclose(self.angle, 0): self.symbol = "-1" self.type = "inversion" diff --git a/pyxtal/symmetry.py b/pyxtal/symmetry.py index cc8c35b..6beb522 100644 --- a/pyxtal/symmetry.py +++ b/pyxtal/symmetry.py @@ -2414,7 +2414,7 @@ def get_site_symm_wo_translation(self): return [SymmOp.from_rotation_and_translation(op.rotation_matrix, [0, 0, 0]) for op in self.symmetry[0]] def get_site_symmetry_object(self, idx=0): - ops = self.get_site_symm_ops(idx) + ops = self.get_site_symm_ops(idx)#; print(self.number, self.index, self.letter) return site_symmetry(ops, self.lattice_type, self.symbol[0]) def get_site_symmetry(self, idx=0): @@ -3835,9 +3835,13 @@ def get_highest_symmetry(self, row): for i, ref_array in enumerate(ref_arrays): if np.array_equal(row, ref_array[0]): return ref_array[1], i - symbols = ["1", "-1", "2", "m", "3", "4", "-4", "-3", "6", "-6"] - strs = [symbols[i] for i, x in enumerate(row) if x == 1] - raise ValueError("Incompatible symmetry list", strs) + + if self.lattice_type not in ["hexagonal", "trigonal"]: + symbols = ["1", "-1", "2", "m", "3", "4", "-4", "-3", "6", "-6"] + strs = [symbols[i] for i, x in enumerate(row) if x == 1] + print(row) + #raise ValueError("Incompatible symmetry list", strs) + return ref_arrays[0][1], 0 def organized_wyckoffs(group):