SunnySuite / Sunny.jl

Spin dynamics and generalization to SU(N) coherent states
Other
86 stars 19 forks source link

Problem with extend_periodically() #35

Closed kbarros closed 2 years ago

kbarros commented 2 years ago

extend_periodically() currently has a bug regarding conversion between coordinate systems, but this presents a good opportunity to do some refactors.

Right now Crystal stores basis positions in fractional coordinates whereas Lattice stores atom positions in global Cartesian coordinates. @ddahlbom and I discussed a refactor of SpinSystem so that it would use fractional coordinates throughout. Information currently stored in the Lattice field can be moved directly into the SpinSystem (e.g., SpinSystem could store a Crystal and a three-tuple of dims; it does not necessarily need to cache the list of atom positions).

Note that long-range dipole-dipole interactions are potentially performance sensitive to position information, but in that specific use case we precompute the effective pairwise interactions via Ewald summation anyway. Another need for the positions is in the plotting functions, but in that context I think some additional memory allocations is acceptable.