[WIP] A generalized PeriodicEuclidean (allows specifying the periods as a parallelogon)#237
Open
GiggleLiu wants to merge 2 commits intoJuliaStats:masterfrom
Open
[WIP] A generalized PeriodicEuclidean (allows specifying the periods as a parallelogon)#237GiggleLiu wants to merge 2 commits intoJuliaStats:masterfrom
GiggleLiu wants to merge 2 commits intoJuliaStats:masterfrom
Conversation
dkarrasch
reviewed
Jan 26, 2022
Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de>
Author
|
I notice that the distance computed in this way (shifting the parallelogon for 2^ndim times towards all directions) does not cover all cases (actually I found a counter-example). I need to do more research and will comment back later. Note: So far, I haven't found any information useful. Maybe finding the shortest distance in non-rectangular periodic space is an open problem? https://math.stackexchange.com/questions/1364594/distance-in-a-periodic-system |
Author
|
Note: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In physics, we often use lattices, the periodic boundary condition is non-rectangular in most cases. It can be an arbitrary parallelogon.
It would be nice if the periods can be a matrix, it will make
NearestNeighbors.jlmore useful to condensed matter physicists.I am not very familiar with the design pattern of this package, if someone feel the added code is not qualified according to your standard, please feel free to modify this PR. Thanks!
Example
UPDATE: somehow, the NearestNeighbors.jl does not work properly with this update. Still checking why it is so.
UPDATE 2: they redefined some functions in their own package... this is so wield.
https://github.com/KristofferC/NearestNeighbors.jl/blob/1de39f57fcf5e51ce51592e382f530e514a59952/src/evaluation.jl#L9
https://github.com/KristofferC/NearestNeighbors.jl/blob/1de39f57fcf5e51ce51592e382f530e514a59952/src/ball_tree.jl#L64
@KristofferC
UPDATE3: This issue can be fixed by this monkey patch (KristofferC/NearestNeighbors.jl#130). I tested it in my lattice package, it is a correct fix.