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

Warn if set_onsite_coupling! is called for spin s=1/2 #319

Merged
merged 2 commits into from
Sep 20, 2024
Merged

Conversation

kbarros
Copy link
Member

@kbarros kbarros commented Sep 19, 2024

Quantum mechanics disallows single-ion anisotropy for quantum spin-1/2. This is because any Pauli matrix squared is the identity matrix. Sunny follows quantum mechanics, but it can be confusing to users who may be thinking of spins as classical dipole vectors. Print an informative error message if this situation is detected, and provide guidance about using :dipole_large_s to reproduce legacy calculations.

@kbarros kbarros merged commit 69131fe into main Sep 20, 2024
4 checks passed
@kbarros kbarros deleted the warn-half branch September 20, 2024 17:09
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.

1 participant