Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symmetry: use only point group symmetry #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading