Skip to content

Commit

Permalink
Symmetry: use only point group symmetry
Browse files Browse the repository at this point in the history
The point symmetry group should be used instead of the
space group, here by avoiding fractional translations.
  • Loading branch information
bastonero committed Jul 3, 2024
1 parent 3ee9e7c commit 5951829
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/aiida_vibroscopy/calculations/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ def get_connected_fields_with_operations(
:return: tuple containing equivalent fields and associated rotations and translations
"""
lattice = phonopy_instance.unitcell.cell
# We should probably use only the point group operations.
# Technically, this implementation should not cause any conceptual issue.
# We use only the point group operations.
operations = phonopy_instance.symmetry.symmetry_operations
rotations = operations['rotations']
translations = operations['translations']

directions = []

for r, t in zip(rotations, translations):
r_cart = similarity_transformation(lattice.T, r)
directions.append(tuple(np.dot(r_cart, field_direction).round(2).tolist()))
if np.all(np.isclose(t, [0, 0, 0])):
r_cart = similarity_transformation(lattice.T, r)
directions.append(tuple(np.dot(r_cart, field_direction).round(2).tolist()))

directions = [list(direction) for direction in set(directions)]

Expand All @@ -232,13 +232,14 @@ def get_connected_fields_with_operations(
directions_copy = []

for r, t in zip(rotations, translations):
r_cart = similarity_transformation(lattice.T, r)
field_cart = np.dot(r_cart, field_direction).round(2).tolist()
if field_cart in directions:
rotations_set.append(r)
translations_set.append(t)
directions_copy.append(field_cart)
directions.remove(field_cart)
if np.all(np.isclose(t, [0, 0, 0])):
r_cart = similarity_transformation(lattice.T, r)
field_cart = np.dot(r_cart, field_direction).round(2).tolist()
if field_cart in directions:
rotations_set.append(r)
translations_set.append(t)
directions_copy.append(field_cart)
directions.remove(field_cart)

return np.array(directions_copy, dtype='int32'), np.array(rotations_set, dtype='int32'), np.array(translations_set)

Expand Down

0 comments on commit 5951829

Please sign in to comment.