SunnySuite / Sunny.jl

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

Correctly identify and duplicated inhomogeneous interactions, and overwrite #69

Closed kbarros closed 1 year ago

kbarros commented 1 year ago

Consider a system constructed with to_inhomogeneous. To set a local interaction, one currently must specify two Site parameters. Sunny will then attempt to infer the "displacement" vector in multiples of reshaped unit cells. This inference is possibly ambiguous, because there are multiple ways of wrapping a periodic system. Due to this ambiguity, Sunny may or may not recognize when a specific bond is being overwritten. It seems like we need some improvements:

  1. Do a better job inferring the minimum distance wrapping for a bond.
  2. If the wrapping is ambiguous (because the system size is too small), force the user to select an explicit displacement in reshaped unit cells. (This displacement will be a new optional parameter.)
  3. Given a specific displacement (either inferred or specified), always overwrite existing interactions on bonds.
kbarros commented 1 year ago

Should be fixed in https://github.com/SunnySuite/Sunny.jl/commit/bae8d4bac27ae46d722ae4404991c81fcf918d62