Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow set_onsite_coupling! with zero #111

Merged
merged 1 commit into from
Jul 30, 2023
Merged

Allow set_onsite_coupling! with zero #111

merged 1 commit into from
Jul 30, 2023

Conversation

kbarros
Copy link
Member

@kbarros kbarros commented Jul 30, 2023

This fixes #110 and performs some additional reorganization.

@kbarros
Copy link
Member Author

kbarros commented Jul 30, 2023

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)

@kbarros kbarros merged commit ca049de into main Jul 30, 2023
3 checks passed
@kbarros kbarros deleted the onsite_fix branch July 30, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting onsite coupling to zero doesn't remove it
1 participant