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

Add electronic structure methods for Species #3902

Merged
merged 36 commits into from
Jul 16, 2024

Conversation

rkingsbury
Copy link
Contributor

@rkingsbury rkingsbury commented Jul 1, 2024

Summary

Replacing #3851 , this PR implements electronic_structure, full_electronic_structure, and valence methods for Species.

Major changes:

  • Electronic configurations of ions is added to periodic_table.json. Instead of a single string, the ["Electronic structure"] key for each element is now a dict keyed by oxidation state, so the elemental electronic structures are found in ["Electronic structure"]["0"]. Those of ions corresponding to the common oxidation states are added accordingly, e.g. under ["Electronic structure"]["2"]. This parallels the way ionic_radii are stored. The data themselves are taken from the NIST ASD database listed in the docstrings of the respective methods.
  • I removed the word "(tentative") from the electron config of Lr (0) because the one listed is shown in the NIST database (presumably last time the .json file was updated, Lr was not as well understood as it is now).
  • Update electronic_structure in Element to accommodate the new data format
  • Implement electronic_structure, full_electronic_structure, and valence methods for Species
  • Added unit tests, including a comprehensive test covering all Element and common_oxidation_states which ensures the total number of electrons between the Element and Species (based on the full_electronic_structure is consistent with the oxidation state.
  • Updated docstrings with references and slightly more explanatory text for all methods.

Note

the NIST database only contains electronic structures of cations. I was unable to find a similar resource for anions, however all of the negative "common oxidation states" could be achieved by filling p orbitals of the corresponding ground state element (e.g., ground state is p2, -4 anion is p6). I took this approach for all negative oxidation states (which are relatively few in comparison to the positive ones) because I feel confident it is correct. However, I welcome suggestions if anyone knows where to find hard data to confirm this.

rkingsbury and others added 26 commits May 30, 2024 14:54
Dict is keyed by oxidation state of the element. This work is
to prepare for implementation of Species.electronic_structure
@rkingsbury
Copy link
Contributor Author

@shyuep can I have your thoughts on this implementation? I think all that remains to finish the PR is entering data for the rest of the common oxidation states, but before I spend time on that I want to make sure this looks workable to you. Thanks!

@rkingsbury
Copy link
Contributor Author

@shyuep can I have your thoughts on this implementation? I think all that remains to finish the PR is entering data for the rest of the common oxidation states, but before I spend time on that I want to make sure this looks workable to you. Thanks!

@shyuep friendly reminder about this - once I get your blessing on the approach I've taken, I'll populate the remaining data.

@rkingsbury
Copy link
Contributor Author

Also just a note that the pre-commit tests are currently unhappy about some spellings in aflow_prototypes

src/pymatgen/analysis/aflow_prototypes.json:1: cristalline ==> crystalline
src/pymatgen/analysis/aflow_prototypes.json:1: Ond ==> One, And
src/pymatgen/analysis/aflow_prototypes.json:1: Bever ==> Never
src/pymatgen/analysis/aflow_prototypes.json:1: CaCl ==> calc
src/pymatgen/analysis/aflow_prototypes.json:1: Parth ==> Path
src/pymatgen/analysis/aflow_prototypes.json:1: cristalline ==> crystalline
src/pymatgen/analysis/aflow_prototypes.json:1: CaF ==> calf
src/pymatgen/analysis/aflow_prototypes.json:1: Sclar ==> Scalar
src/pymatgen/analysis/aflow_prototypes.json:1: Zink ==> Zinc
src/pymatgen/analysis/aflow_prototypes.json:1: Pease ==> Peace, Piece, Please, Lease

@shyuep
Copy link
Member

shyuep commented Jul 11, 2024

Seems ok to me. Ignore the spelling issues.

@rkingsbury rkingsbury marked this pull request as ready for review July 16, 2024 18:10
@rkingsbury
Copy link
Contributor Author

@shyuep @mkhorton this is ready for review / merge!

@shyuep shyuep enabled auto-merge (squash) July 16, 2024 20:27
@shyuep
Copy link
Member

shyuep commented Jul 16, 2024

Merged. Thanks!

@shyuep shyuep disabled auto-merge July 16, 2024 20:27
@shyuep shyuep merged commit 454aa5e into materialsproject:master Jul 16, 2024
33 checks passed
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.

2 participants