Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the issues raised in #1408. Full matrix tilings are trickier than first appreciated.
Nexus attempts to arrive at an effective diagonal tiling by reducing the tiling matrix into a volume preserving diagonal form via successive shear operations. This usually works, but the diagonal tiling apparently depends on the order of the shearing operations (e.g. you can sometimes get either (1,1,4) or (1,2,2)) as revealed by #1408.
This PR added tests of diagonal and matrix tiling and also a search over permutations in the shearing operation order. This change worked for the problem case of #1408, however it did not work for all of the randomly generated tiling matrices just added to the test set.
A final brute force fallback operation was added to catch the remaining cases: essentially find a bounding box for the tiled supercell in the basis of the untiled axes, generate new atomic coordinates in this bounding box, and then remove duplicate points. This approach was avoided originally because it's worst case scaling is order det(T)^3 rather than order det(T) as above.