Element/Species: order full_electron_structure by energy#3944
Merged
shyuep merged 2 commits intomaterialsproject:masterfrom Jul 23, 2024
Merged
Element/Species: order full_electron_structure by energy#3944shyuep merged 2 commits intomaterialsproject:masterfrom
Element/Species: order full_electron_structure by energy#3944shyuep merged 2 commits intomaterialsproject:masterfrom
Conversation
Element/Species: order full_electron_structure by energy
This was referenced Feb 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a follow up to #3902 to address an inconsistent behavior I encountered. The major change in this PR is that
full_electronic_structureis now always returned as a sorted list according to the Madelung rule, so that the final element is always the valence shell. Prior to this PR, this was sometimes but not always the case, as I elaborate below.Major changes:
ElementandSpecies.full_electronic_structureare now sorted by increasing energy level according to the Madelung rulevalenceandfull_electronic_structureboth work as expectedn_electronsproperty toSpeciesandElementBackground
As we discussed in #3902,
electronic_structureshould not be sorted by energy level, because this is how NIST and many other sources report it (e.g., forCe(0)we have'[Xe].4f1.5d1.6s2').full_electronic_structureparseselectronic_structureinto a list but did not make any attempt to sort it. In theory, given the above convention, one might expect this to mean thatfull_electronic_structurealways gives orbitals in order of increasing quantum numbers (e.g. 1s, 2s ... 3d, 4s, 4p, 4d, 4f, 5s...), but that was not always the case. For example, it worked forFe(0)which gavebut for
Ce(0)we getUltimately, this is caused by the fact that when
electronic_structureis written in shorthand (for example, Ce is[Xe].4f1.5d1.6s2),full_electronic_structurejust takes that structure of the atom ([Xe]) and appends the new orbitals to it. This can result in unpredictable ordering of the orbitals as shown above.valenceDOES make an attempt to sort the orbitals, but because of the issues raised above, it will fail to find the correct valence for someSpecies.The changes in this PR remedy all of the above problems and ensure that
full_electronic_structurehas a consistent meaning for allElementandSpecies.