SunnySuite / Sunny.jl

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

It's impossible to get the suggested magnetic supercell from `suggest_magnetic_supercell` programmatically #140

Closed Lazersmoke closed 1 year ago

Lazersmoke commented 1 year ago

https://github.com/SunnySuite/Sunny.jl/blob/8116a163d78bd984a3bf90d8ae32183c2bc40187/src/Reshaping.jl#L342-L347

It would be nice if there was a way to get this so that further code can be run on the best suggested supercell. Should this be a user-facing function?

kbarros commented 1 year ago

Fixed in https://github.com/SunnySuite/Sunny.jl/commit/360277cb8dd9caa91d639654ed8d1e570e8c6b99.

kbarros commented 1 year ago

I reverted the fix in https://github.com/SunnySuite/Sunny.jl/commit/81f37620b24e28a5c253c8b9f2a0469559c4efd4

The danger is that suggest_magnetic_supercell relies on a lot of subjective heuristics that might change. By forcing the user to copy-paste the 3x3 matrix into reshape_supercell, it will protect them from indexing errors in case the behavior of suggest_magnetic_supercell changes.