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

Lattice Symmetries #85

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Lattice Symmetries #85

wants to merge 23 commits into from

Conversation

Olllom
Copy link
Collaborator

@Olllom Olllom commented Jun 7, 2021

This is a first attempt to formalize the incorporation of lattice symmetries into collision models. For now it mainly automates finding the symmetries of each stencil and converting them into the respective index permutations. The current version at least allows us to check if a collision model obeys all desired lattice symmetries (see the last test in test_symmetry.py)

The code for such a check would look like this:

import lettuce as lt
stencil = ... # some stencil
collision = ... # some collision model
f = ... # some f
symmetry_group = lt.SymmetryGroup(stencil)
for permutation in symmetry_group.permutations:
    assert torch.allclose(collision(f[permutation]), collision(f)[permutation])

Breaking Change:

Swapped the order of transform and relaxation_parameters in the MRT collision model constructor.

@McBs

@pep8speaks
Copy link

pep8speaks commented Jun 7, 2021

Hello @Olllom! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 120:108: W504 line break after binary operator
Line 122:14: W503 line break before binary operator

Line 348:1: W391 blank line at end of file

Line 8:8: E225 missing whitespace around operator
Line 60:84: E226 missing whitespace around arithmetic operator
Line 61:84: E226 missing whitespace around arithmetic operator
Line 214:43: E226 missing whitespace around arithmetic operator
Line 234:1: W391 blank line at end of file

Line 85:108: W504 line break after binary operator

Line 195:24: E231 missing whitespace after ','

Line 109:13: W503 line break before binary operator
Line 116:13: W503 line break before binary operator

Line 98:31: E126 continuation line over-indented for hanging indent
Line 98:81: W504 line break after binary operator
Line 99:81: W504 line break after binary operator
Line 100:81: W504 line break after binary operator
Line 101:81: W504 line break after binary operator
Line 102:81: W504 line break after binary operator

Line 113:1: W391 blank line at end of file

Line 193:1: W391 blank line at end of file

Comment last updated at 2021-07-06 18:11:27 UTC

@Olllom Olllom requested a review from McBs June 7, 2021 14:48
@lgtm-com
Copy link

lgtm-com bot commented Jun 7, 2021

This pull request introduces 2 alerts when merging 22e68f7 into 15f5047 - view on LGTM.com

new alerts:

  • 1 for `__eq__` not overridden when adding attributes
  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jun 7, 2021

This pull request introduces 1 alert when merging 772144c into 15f5047 - view on LGTM.com

new alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 6, 2021

This pull request introduces 1 alert when merging 4c58554 into 80699e3 - view on LGTM.com

new alerts:

  • 1 for Unused import

@Olllom Olllom added the enhancement New feature or request label Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants