-
Notifications
You must be signed in to change notification settings - Fork 876
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
Fix MagOrderingTransformation
by enforcing implicit-zero magnetic moments in SpaceGroupAnalyzer
#3070
Fix MagOrderingTransformation
by enforcing implicit-zero magnetic moments in SpaceGroupAnalyzer
#3070
Conversation
This PR has been open for a while and fixed some of the previous magnetic moment problems. I apologize for not adding tests yet to get it merged. However, with the recent changes in Does anyone with more knowledge of this situation able to address? @janosh @shyuep @mkhorton |
Just for clarity, this PR still addresses a relevant bug and is just missing tests? Sounds like the |
SpaceGroupAnalyzer
and MagOrderingTransformation
MagOrderingTransformation
by enforcing implicit-zero magnetic moments in SpaceGroupAnalyzer
The original problem this PR addressed is still "fixed"(i.e., enforcing implicit-zero magnetic moments) but the implementation here will need to be reworked to account for the new defaults in how spin is handled. I am just somewhat confused about specifically why it's broken now and what is the right thing to do... I think @shyuep also expressed that sentiment: 9d0461f |
Well it certainly worked at some point! I think keeping this running in CI was tricky because of its dependence on `enumlib`, and since `enumlib` on `conda` was quite out of date (this is not to blame the issue on `enumlib`, simply for why this bug might have remained uncaught).
|
This fix actually works. I am merging. |
I should add that my changes to Specie does not do anything backward incompatible. I was deliberate in making sure all existing code still works. @mattmcdermott 's solution works since it is based on existing ways of determining spin. |
Also, no tests are necessary. There is an existing test in MagTransformation. The tests fail previously. Not sure why the Github actions is not detecting it. But I confirm the tests pass now. |
Oh, that is great to hear! Glad you were able to pull this in, @shyuep. Thank you for investigating :) I should have spent some more time digging yesterday before I brought up that it was broken; it is actually a different section of code that is broken now -- specifically I just found a simple one-line fix for that, so I will open up a new PR :) thanks again everyone! |
This PR addresses the bugs described in #3006. To summarize: changes to default magnetic moments introduced in #2727 now mean that structures with only partially defined magnetic moments (e.g., on half the sites) cannot be successfully analyzed by
SpaceGroupAnalyzer
. This was encountered when performing magnetic ordering enumeration, as the previous default behavior forMagOrderingTransformation
does not implicitly yield spins of 0 on the nonmagnetic sites. Altogether this has been fixed with two edits:SpaceGroupAnalyzer
. If any site in the structure has magnetic moments defined, then assume that any undefined ones are implicitly zero.MagOrderingTransformation
to ensure that all the sites in the transformed structure have labeled spins (this means explicitly defining spin=0), per recommendation by @mkhortonTodos
Checklist
ruff
.mypy
.