-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove new_group_axis from space groups
- Loading branch information
Showing
2 changed files
with
32 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
function test_action_composition(space_group::SpaceGroup, x::AbstractArray, axes::AxesInfo) | ||
new_group_axis = 1 | ||
point_group = space_group.point_group | ||
g_x = space_group(x, axes) | ||
g_x = space_group(x, axes, new_group_axis) | ||
|
||
# This is when acting two times, first with the element at axis 1, then at axis 2 | ||
# here we need to take care of the axes explicitly | ||
_, axes = lift(x, axes, space_group.new_group_axis) | ||
# Now the h axis is action.new_group_axis and the g axis is action.new_group_axis + 1 | ||
h_on_g_x = space_group(g_x, axes) | ||
_, axes = lift(x, axes, new_group_axis) | ||
# Now the h axis is new_group_axis and the g axis is new_group_axis + 1 | ||
h_on_g_x = space_group(g_x, axes, new_group_axis) | ||
|
||
# Now first compose the point group elements, then act once | ||
# flattened list of compositions | ||
h_compose_g = reshape(point_group.composition, :) | ||
indices = ntuple(a -> a == space_group.new_group_axis ? h_compose_g : :, ndims(g_x)) | ||
indices = ntuple(a -> a == new_group_axis ? h_compose_g : :, ndims(g_x)) | ||
h_g_on_x = g_x[indices...] | ||
# This has the actions of all 2 group element compositions on one axis, | ||
# so we need to spread them over two axes again | ||
h_g_on_x = reshape(h_g_on_x, size(h_on_g_x)...) | ||
|
||
# Check if the two are equal | ||
@test all(h_on_g_x .=== h_g_on_x) | ||
end | ||
end |