Closed kbarros closed 1 year ago
The proposed new behavior is:
sys = System(...)
S = spin_operators(sys, 1)
set_onsite_coupling!(sys, zero(S[3]), 1) # does nothing
set_onsite_coupling!(sys, S[3]^2, 1) # sets a coupling
set_onsite_coupling!(sys, zero(S[3]), 1) # emits a warning and removes coupling
set_onsite_coupling!(sys, S[3]^2, 1) # sets a coupling *without warning* (does not detect existing coupling)
This fixes https://github.com/SunnySuite/Sunny.jl/issues/110 and performs some additional reorganization.