Lattice Symmetries
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
Hello @Olllom! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
- In the file
lettuce/boundary.py:
Line 120:108: W504 line break after binary operator Line 122:14: W503 line break before binary operator
- In the file
lettuce/collision.py:
Line 348:1: W391 blank line at end of file
- In the file
lettuce/neural.py:
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
- In the file
lettuce/observables.py:
Line 85:108: W504 line break after binary operator
- In the file
lettuce/symmetry.py:
Line 195:24: E231 missing whitespace after ','
- In the file
lettuce/unit.py:
Line 109:13: W503 line break before binary operator Line 116:13: W503 line break before binary operator
- In the file
lettuce/util.py:
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
- In the file
tests/conftest.py:
Line 113:1: W391 blank line at end of file
- In the file
tests/test_symmetry.py:
Line 193:1: W391 blank line at end of file
Comment last updated at 2021-07-06 18:11:27 UTC
This pull request introduces 2 alerts when merging 22e68f7d0ab1eb97b75c0174ddfc1bf515372979 into 15f50475cea6d5a698ff8eb9530819eb00015bcf - view on LGTM.com
new alerts:
- 1 for `__eq__` not overridden when adding attributes
- 1 for Unused import
This pull request introduces 1 alert when merging 772144c95b1573add4214c9cfebf73e0897ea23b into 15f50475cea6d5a698ff8eb9530819eb00015bcf - view on LGTM.com
new alerts:
- 1 for Unused import
This pull request introduces 1 alert when merging 4c585541a11af357a6938ece3a1c49b66b7cf22e into 80699e3461d66c86501364ded82d0b8ac8d26a13 - view on LGTM.com
new alerts:
- 1 for Unused import