From 454aa5e2fd7902ff92ea3b52c024e29903d51ae1 Mon Sep 17 00:00:00 2001 From: Ryan Kingsbury Date: Tue, 16 Jul 2024 16:27:36 -0400 Subject: [PATCH] Add electronic structure methods for Species (#3902) * prettify periodic_table.json * fix energy ordering of electronic structures for elements * fix typo * Species: implement electron configuration methods * prettify periodic_table.json * fix energy ordering of electronic structures for elements * fix typo * Species: implement electron configuration methods * fix get_crystal_field_spin * fix _get_number_of_d_electrons * fix PotcarSingle test * fix json typo * prettify periodic_table.json for readability * prettify periodic_table.json for readability * pre-commit auto-fixes * convert Electronic Structure in per table data to dict Dict is keyed by oxidation state of the element. This work is to prepare for implementation of Species.electronic_structure * add ion el str to Group I and II cations * implement Species.electronic_structure methods * update docstrings for electronic struct methods * pre-commit auto-fixes * linting * revert changes to degree symbol * revert reordered energy levels * complete ion electron configs * revert reordered energy levels * add comprehensive species test; correct json * pre-commit auto-fixes * add add'l oxi states relevant to aqueous media --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/pymatgen/core/periodic_table.json | 574 +++++++++++++++++++++----- src/pymatgen/core/periodic_table.py | 104 ++++- tests/core/test_periodic_table.py | 56 ++- 3 files changed, 610 insertions(+), 124 deletions(-) diff --git a/src/pymatgen/core/periodic_table.json b/src/pymatgen/core/periodic_table.json index 930c7f55ec0..e0b56082370 100644 --- a/src/pymatgen/core/periodic_table.json +++ b/src/pymatgen/core/periodic_table.json @@ -33,7 +33,10 @@ "Critical temperature": "no data K", "Density of solid": "10070 kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].6d1.7s2", + "Electronic structure": { + "0": "[Rn].6d1.7s2", + "3": "[Xe].4f14.5d10.6s2.6p6" + }, "Ionic radii": { "3": 1.26 }, @@ -191,7 +194,10 @@ "Critical temperature": "no data K", "Density of solid": "10490 kg m-3", "Electrical resistivity": "1.63 10-8 Ω m", - "Electronic structure": "[Kr].4d10.5s1", + "Electronic structure": { + "0": "[Kr].4d10.5s1", + "1": "[Kr].4d10" + }, "ICSD oxidation states": [ 1, 2, @@ -375,7 +381,10 @@ "Critical temperature": "no data K", "Density of solid": "2700 kg m-3", "Electrical resistivity": "2.7 10-8 Ω m", - "Electronic structure": "[Ne].3s2.3p1", + "Electronic structure": { + "0": "[Ne].3s2.3p1", + "3": "1s2.2s2.2p6" + }, "ICSD oxidation states": [ 3 ], @@ -465,7 +474,10 @@ "Critical temperature": "no data K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f7.7s2", + "Electronic structure": { + "0": "[Rn].5f7.7s2", + "3": "[Rn].5f6" + }, "Ionic radii": { "2": 1.4, "3": 1.115, @@ -667,7 +679,9 @@ "Critical temperature": "150.8 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Ne].3s2.3p6", + "Electronic structure": { + "0": "[Ne].3s2.3p6" + }, "Liquid range": "3.5 K", "Max oxidation state": 0, "Melting point": "83.8 K", @@ -739,7 +753,12 @@ "Critical temperature": "1700 K", "Density of solid": "5727 kg m-3", "Electrical resistivity": "33 10-8 Ω m", - "Electronic structure": "[Ar].3d10.4s2.4p3", + "Electronic structure": { + "0": "[Ar].3d10.4s2.4p3", + "3": "[Ar].3d10.4s2", + "5": "[Ar].3d10", + "-3": "[Ar].3d10.4s2.4p6" + }, "ICSD oxidation states": [ 2, 3, @@ -873,7 +892,11 @@ "Critical temperature": "no data K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d10.6s2.6p5", + "Electronic structure": { + "0": "[Xe].4f14.5d10.6s2.6p5", + "1": "[Xe].4f14.5d10.6s2.6p4", + "-1": "[Xe].4f14.5d10.6s2.6p6" + }, "Ionic radii": { "7": 0.76 }, @@ -1034,7 +1057,10 @@ "Critical temperature": "no data K", "Density of solid": "19300 kg m-3", "Electrical resistivity": "2.2 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d10.6s1", + "Electronic structure": { + "0": "[Xe].4f14.5d10.6s1", + "3": "[Xe].4f14.5d8" + }, "Ionic radii": { "1": 1.51, "3": 0.99, @@ -1203,7 +1229,10 @@ "Critical temperature": "no data K", "Density of solid": "2460 kg m-3", "Electrical resistivity": "> 101210-8 Ω m", - "Electronic structure": "[He].2s2.2p1", + "Electronic structure": { + "0": "[He].2s2.2p1", + "3": "1s2" + }, "ICSD oxidation states": [ 3, -3 @@ -1301,7 +1330,10 @@ "Critical temperature": "no data K", "Density of solid": "3510 kg m-3", "Electrical resistivity": "34 10-8 Ω m", - "Electronic structure": "[Xe].6s2", + "Electronic structure": { + "0": "[Xe].6s2", + "2": "[Kr].4d10.5s2.5p6" + }, "ICSD oxidation states": [ 2 ], @@ -1457,7 +1489,10 @@ "Critical temperature": "no data K", "Density of solid": "1848 kg m-3", "Electrical resistivity": "3.8 10-8 Ω m", - "Electronic structure": "[He].2s2", + "Electronic structure": { + "0": "[He].2s2", + "2": "1s2" + }, "ICSD oxidation states": [ 2 ], @@ -1553,7 +1588,10 @@ "Critical temperature": "no data K", "Density of solid": "9780 kg m-3", "Electrical resistivity": "130 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d10.6s2.6p3", + "Electronic structure": { + "0": "[Xe].4f14.5d10.6s2.6p3", + "3": "[Xe].4f14.5d10.6s2" + }, "ICSD oxidation states": [ 1, 2, @@ -1723,7 +1761,10 @@ "Critical temperature": "no data K", "Density of solid": "14780 kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f9.7s2", + "Electronic structure": { + "0": "[Rn].5f9.7s2", + "3": "[Rn].5f8" + }, "Ionic radii": { "3": 1.1, "4": 0.97 @@ -1907,7 +1948,14 @@ "Critical temperature": "586 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "> 101810-8 Ω m", - "Electronic structure": "[Ar].3d10.4s2.4p5", + "Electronic structure": { + "0": "[Ar].3d10.4s2.4p5", + "-1": "[Ar].3d10.4s2.4p6", + "1": "[Ar].3d10.4s2.4p4", + "3": "[Ar].3d10.4s2.4p2", + "5": "[Ar].3d10.4s2", + "7": "[Ar].3d10" + }, "ICSD oxidation states": [ 5, -1 @@ -2047,7 +2095,11 @@ "Critical temperature": "no data K", "Density of solid": "2267 kg m-3", "Electrical resistivity": "about 1000 - direction dependent10-8 Ω m", - "Electronic structure": "[He].2s2.2p2", + "Electronic structure": { + "0": "[He].2s2.2p2", + "-4": "[He].2s2.2p6", + "4": "1s2" + }, "ICSD oxidation states": [ 2, 3, @@ -2148,7 +2200,10 @@ "Critical temperature": "no data K", "Density of solid": "1550 kg m-3", "Electrical resistivity": "3.4 10-8 Ω m", - "Electronic structure": "[Ar].4s2", + "Electronic structure": { + "0": "[Ar].4s2", + "2": "[Ne].3s2.3p6" + }, "ICSD oxidation states": [ 2 ], @@ -2274,7 +2329,10 @@ "Critical temperature": "no data K", "Density of solid": "8650 kg m-3", "Electrical resistivity": "7 10-8 Ω m", - "Electronic structure": "[Kr].4d10.5s2", + "Electronic structure": { + "0": "[Kr].4d10.5s2", + "2": "[Kr].4d10" + }, "ICSD oxidation states": [ 2 ], @@ -2430,7 +2488,11 @@ "Critical temperature": "no data K", "Density of solid": "6689 kg m-3", "Electrical resistivity": "74 10-8 Ω m", - "Electronic structure": "[Xe].4f1.5d1.6s2", + "Electronic structure": { + "0": "[Xe].4f1.5d1.6s2", + "3": "[Xe].4f1", + "4": "[Cd].5p6" + }, "ICSD oxidation states": [ 3, 4 @@ -2609,7 +2671,10 @@ "Critical temperature": "no data K", "Density of solid": "15100 kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f10.7s2", + "Electronic structure": { + "0": "[Rn].5f10.7s2", + "3": "[Rn].5f9" + }, "Ionic radii": { "3": 1.09, "4": 0.961 @@ -2792,7 +2857,14 @@ "Critical temperature": "417 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "> 101010-8 Ω m", - "Electronic structure": "[Ne].3s2.3p5", + "Electronic structure": { + "0": "[Ne].3s2.3p5", + "-1": "[Ne].3s2.3p6", + "1": "[Ne].3s2.3p4", + "3": "[Ne].3s2.3p2", + "5": "[Ne].3s2", + "7": "1s2.2s2.2p6" + }, "ICSD oxidation states": [ -1 ], @@ -2905,7 +2977,10 @@ "Critical temperature": "no data K", "Density of solid": "13510 kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f7.6d1.7s2", + "Electronic structure": { + "0": "[Rn].5f7.6d1.7s2", + "3": "[Rn].5f7" + }, "Ionic radii": { "3": 1.11, "4": 0.99 @@ -3084,7 +3159,11 @@ "Critical temperature": "no data K", "Density of solid": "8900 kg m-3", "Electrical resistivity": "6 10-8 Ω m", - "Electronic structure": "[Ar].3d7.4s2", + "Electronic structure": { + "0": "[Ar].3d7.4s2", + "2": "[Ar].3d7", + "3": "[Ar].3d6" + }, "ICSD oxidation states": [ 1, 2, @@ -3251,7 +3330,12 @@ "Critical temperature": "no data K", "Density of solid": "7140 kg m-3", "Electrical resistivity": "12.7 10-8 Ω m", - "Electronic structure": "[Ar].3d5.4s1", + "Electronic structure": { + "0": "[Ar].3d5.4s1", + "2": "[Ar].3d4", + "3": "[Ar].3d3", + "6": "[Ne].3s2.3p6" + }, "ICSD oxidation states": [ 2, 3, @@ -3433,7 +3517,10 @@ "Critical temperature": "1938 K", "Density of solid": "1879 kg m-3", "Electrical resistivity": "21 10-8 Ω m", - "Electronic structure": "[Xe].6s1", + "Electronic structure": { + "0": "[Xe].6s1", + "1": "[Kr].4d10.5s2.5p6" + }, "ICSD oxidation states": [ 1 ], @@ -3587,7 +3674,12 @@ "Critical temperature": "no data K", "Density of solid": "8920 kg m-3", "Electrical resistivity": "1.72 10-8 Ω m", - "Electronic structure": "[Ar].3d10.4s1", + "Electronic structure": { + "0": "[Ar].3d10.4s1", + "1": "[Ar].3d10", + "2": "[Ar].3d9", + "3": "[Ar].3d8" + }, "ICSD oxidation states": [ 1, 2, @@ -3748,7 +3840,10 @@ "Critical temperature": "no data K", "Density of solid": "8551 kg m-3", "Electrical resistivity": "92.6 10-8 Ω m", - "Electronic structure": "[Xe].4f10.6s2", + "Electronic structure": { + "0": "[Xe].4f10.6s2", + "3": "[Xe].4f9" + }, "ICSD oxidation states": [ 3 ], @@ -3929,7 +4024,10 @@ "Critical temperature": "no data K", "Density of solid": "9066 kg m-3", "Electrical resistivity": "86.0 10-8 Ω m", - "Electronic structure": "[Xe].4f12.6s2", + "Electronic structure": { + "0": "[Xe].4f12.6s2", + "3": "[Xe].4f11" + }, "ICSD oxidation states": [ 3 ], @@ -4076,7 +4174,10 @@ "Critical temperature": "no data K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f11.7s2", + "Electronic structure": { + "0": "[Rn].5f11.7s2", + "3": "[Rn].5f10" + }, "Liquid range": "no data K", "Melting point": "1133 K", "Mendeleev no": 38, @@ -4236,7 +4337,11 @@ "Critical temperature": "no data K", "Density of solid": "5244 kg m-3", "Electrical resistivity": "90 10-8 Ω m", - "Electronic structure": "[Xe].4f7.6s2", + "Electronic structure": { + "0": "[Xe].4f7.6s2", + "2": "[Xe].4f7", + "3": "[Xe].4f6" + }, "ICSD oxidation states": [ 2, 3 @@ -4417,7 +4522,10 @@ "Critical temperature": "144 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[He].2s2.2p5", + "Electronic structure": { + "0": "[He].2s2.2p5", + "-1": "[He].2s2.2p6" + }, "ICSD oxidation states": [ -1 ], @@ -4526,7 +4634,11 @@ "Critical temperature": "no data K", "Density of solid": "7874 kg m-3", "Electrical resistivity": "10 10-8 Ω m", - "Electronic structure": "[Ar].3d6.4s2", + "Electronic structure": { + "0": "[Ar].3d6.4s2", + "2": "[Ar].3d6", + "3": "[Ar].3d5" + }, "ICSD oxidation states": [ 2, 3 @@ -4703,7 +4815,10 @@ "Critical temperature": "no data K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f12.7s2", + "Electronic structure": { + "0": "[Rn].5f12.7s2", + "3": "[Rn].5f11" + }, "Liquid range": "no data K", "Melting point": "about 1800 K", "Mendeleev no": 37, @@ -4866,7 +4981,10 @@ "Critical temperature": "no data K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].7s1", + "Electronic structure": { + "0": "[Rn].7s1", + "1": "[Hg].6p6" + }, "Ionic radii": { "1": 1.94 }, @@ -5020,7 +5138,10 @@ "Critical temperature": "no data K", "Density of solid": "5904 kg m-3", "Electrical resistivity": "about 14 10-8 Ω m", - "Electronic structure": "[Ar].3d10.4s2.4p1", + "Electronic structure": { + "0": "[Ar].3d10.4s2.4p1", + "3": "[Ar].3d10" + }, "ICSD oxidation states": [ 2, 3 @@ -5142,7 +5263,10 @@ "Critical temperature": "no data K", "Density of solid": "7901 kg m-3", "Electrical resistivity": "131 10-8 Ω m", - "Electronic structure": "[Xe].4f7.5d1.6s2", + "Electronic structure": { + "0": "[Xe].4f7.5d1.6s2", + "3": "[Xe].4f7" + }, "ICSD oxidation states": [ 3 ], @@ -5298,7 +5422,12 @@ "Critical temperature": "no data K", "Density of solid": "5323 kg m-3", "Electrical resistivity": "about 50000 10-8 Ω m", - "Electronic structure": "[Ar].3d10.4s2.4p2", + "Electronic structure": { + "0": "[Ar].3d10.4s2.4p2", + "-4": "[Ar].3d10.4s2.4p6", + "2": "[Ar].3d10.4s2", + "4": "[Ar].3d10" + }, "ICSD oxidation states": [ 2, 3, @@ -5416,7 +5545,11 @@ "Critical temperature": "33 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "1s1", + "Electronic structure": { + "0": "1s1", + "-1": "1s2", + "1": null + }, "ICSD oxidation states": [ 1, -1 @@ -5486,7 +5619,9 @@ "Critical temperature": "5.19 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "1s2", + "Electronic structure": { + "0": "1s2" + }, "Liquid range": "3.27 K", "Max oxidation state": 0, "Melting point": "0.95 K", @@ -5546,7 +5681,10 @@ "Critical temperature": "no data K", "Density of solid": "13310 kg m-3", "Electrical resistivity": "34 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d2.6s2", + "Electronic structure": { + "0": "[Xe].4f14.5d2.6s2", + "4": "[Xe].4f14" + }, "ICSD oxidation states": [ 4 ], @@ -5715,7 +5853,11 @@ "Critical temperature": "1750 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "96 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d10.6s2", + "Electronic structure": { + "0": "[Xe].4f14.5d10.6s2", + "1": "[Xe].4f14.5d10.6s1", + "2": "[Xe].4f14.5d10" + }, "ICSD oxidation states": [ 1, 2 @@ -5909,7 +6051,10 @@ "Critical temperature": "no data K", "Density of solid": "8795 kg m-3", "Electrical resistivity": "81.4 10-8 Ω m", - "Electronic structure": "[Xe].4f11.6s2", + "Electronic structure": { + "0": "[Xe].4f11.6s2", + "3": "[Xe].4f10" + }, "ICSD oxidation states": [ 3 ], @@ -6071,7 +6216,14 @@ "Critical temperature": "819 K", "Density of solid": "4940 kg m-3", "Electrical resistivity": "> 101510-8 Ω m", - "Electronic structure": "[Kr].4d10.5s2.5p5", + "Electronic structure": { + "0": "[Kr].4d10.5s2.5p5", + "-1": "[Kr].4d10.5s2.5p6", + "1": "[Kr].4d10.5s2.5p4", + "3": "[Kr].4d10.5s2.5p2", + "5": "[Kr].4d10.5s2", + "7": "[Kr].4d10" + }, "ICSD oxidation states": [ 5, -1 @@ -6236,7 +6388,10 @@ "Critical temperature": "no data K", "Density of solid": "7310 kg m-3", "Electrical resistivity": "8 10-8 Ω m", - "Electronic structure": "[Kr].4d10.5s2.5p1", + "Electronic structure": { + "0": "[Kr].4d10.5s2.5p1", + "3": "[Kr].4d10" + }, "ICSD oxidation states": [ 1, 2, @@ -6382,7 +6537,11 @@ "Critical temperature": "no data K", "Density of solid": "22650 kg m-3", "Electrical resistivity": "4.7 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d7.6s2", + "Electronic structure": { + "0": "[Xe].4f14.5d7.6s2", + "3": "[Xe].4f14.5d6", + "4": "[Xe].4f14.5d5" + }, "ICSD oxidation states": [ 3, 4, @@ -6554,7 +6713,10 @@ "Critical temperature": "2223 K", "Density of solid": "856 kg m-3", "Electrical resistivity": "7.5 10-8 Ω m", - "Electronic structure": "[Ar].4s1", + "Electronic structure": { + "0": "[Ar].4s1", + "1": "[Ne].3s2.3p6" + }, "ICSD oxidation states": [ 1 ], @@ -6682,7 +6844,9 @@ "Critical temperature": "209.4 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Ar].3d10.4s2.4p6", + "Electronic structure": { + "0": "[Ar].3d10.4s2.4p6" + }, "Liquid range": "4.14 K", "Max oxidation state": 0, "Melting point": "115.79 K", @@ -6776,7 +6940,10 @@ "Critical temperature": "no data K", "Density of solid": "6146 kg m-3", "Electrical resistivity": "61.5 10-8 Ω m", - "Electronic structure": "[Xe].5d1.6s2", + "Electronic structure": { + "0": "[Xe].5d1.6s2", + "3": "[Cd].5p6" + }, "ICSD oxidation states": [ 2, 3 @@ -6932,7 +7099,10 @@ "Critical temperature": "3223 K", "Density of solid": "535 kg m-3", "Electrical resistivity": "9.5 10-8 Ω m", - "Electronic structure": "[He].2s1", + "Electronic structure": { + "0": "[He].2s1", + "1": "1s2" + }, "ICSD oxidation states": [ 1 ], @@ -7012,7 +7182,10 @@ "Critical temperature": "no data K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f14.7s2.7p1 (tentative)", + "Electronic structure": { + "0": "[Rn].5f14.7s2.7p1", + "3": "[Rn].5f14" + }, "Liquid range": "no data K", "Melting point": "about 1900 K", "Mendeleev no": 34, @@ -7175,7 +7348,10 @@ "Critical temperature": "no data K", "Density of solid": "9841 kg m-3", "Electrical resistivity": "58 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d1.6s2", + "Electronic structure": { + "0": "[Xe].4f14.5d1.6s2", + "3": "[Xe].4f14" + }, "ICSD oxidation states": [ 3 ], @@ -7319,7 +7495,10 @@ "Critical temperature": "no data K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f13.7s2", + "Electronic structure": { + "0": "[Rn].5f13.7s2", + "3": "[Rn].5f12" + }, "Liquid range": "no data K", "Melting point": "about 1100 K", "Mendeleev no": 36, @@ -7471,7 +7650,10 @@ "Critical temperature": "no data K", "Density of solid": "1738 kg m-3", "Electrical resistivity": "4.4 10-8 Ω m", - "Electronic structure": "[Ne].3s2", + "Electronic structure": { + "0": "[Ne].3s2", + "2": "[He].2s2.2p6" + }, "ICSD oxidation states": [ 2 ], @@ -7576,7 +7758,13 @@ "Critical temperature": "no data K", "Density of solid": "7470 kg m-3", "Electrical resistivity": "144 10-8 Ω m", - "Electronic structure": "[Ar].3d5.4s2", + "Electronic structure": { + "0": "[Ar].3d5.4s2", + "2": "[Ar].3d5", + "3": "[Ar].3d4", + "4": "[Ar].3d3", + "7": "[Ne].3s2.3p6" + }, "ICSD oxidation states": [ 2, 3, @@ -7796,7 +7984,12 @@ "Critical temperature": "no data K", "Density of solid": "10280 kg m-3", "Electrical resistivity": "5.5 10-8 Ω m", - "Electronic structure": "[Kr].4d5.5s1", + "Electronic structure": { + "0": "[Kr].4d5.5s1", + "3": "[Kr].4d3", + "4": "[Kr].4d2", + "6": "[Ar].3d10.4s2.4p6" + }, "ICSD oxidation states": [ 2, 3, @@ -7967,7 +8160,12 @@ "Critical temperature": "126.2 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[He].2s2.2p3", + "Electronic structure": { + "0": "[He].2s2.2p3", + "-3": "[He].2s2.2p6", + "3": "1s2.2s2", + "5": "1s2" + }, "ICSD oxidation states": [ 1, 3, @@ -8079,7 +8277,10 @@ "Critical temperature": "2573 K", "Density of solid": "968 kg m-3", "Electrical resistivity": "4.9 10-8 Ω m", - "Electronic structure": "[Ne].3s1", + "Electronic structure": { + "0": "[Ne].3s1", + "1": "[He].2s2.2p6" + }, "ICSD oxidation states": [ 1 ], @@ -8202,7 +8403,10 @@ "Critical temperature": "no data K", "Density of solid": "8570 kg m-3", "Electrical resistivity": "15.2 10-8 Ω m", - "Electronic structure": "[Kr].4d4.5s1", + "Electronic structure": { + "0": "[Kr].4d4.5s1", + "5": "[Ar].3d10.4s2.4p6" + }, "ICSD oxidation states": [ 2, 3, @@ -8367,7 +8571,10 @@ "Critical temperature": "no data K", "Density of solid": "6800 kg m-3", "Electrical resistivity": "64.3 10-8 Ω m", - "Electronic structure": "[Xe].4f4.6s2", + "Electronic structure": { + "0": "[Xe].4f4.6s2", + "3": "[Xe].4f3" + }, "ICSD oxidation states": [ 2, 3 @@ -8524,7 +8731,9 @@ "Critical temperature": "44.4 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[He].2s2.2p6", + "Electronic structure": { + "0": "[He].2s2.2p6" + }, "Liquid range": "2.51 K", "Max oxidation state": 0, "Melting point": "24.56 K", @@ -8588,7 +8797,11 @@ "Critical temperature": "no data K", "Density of solid": "8908 kg m-3", "Electrical resistivity": "7.2 10-8 Ω m", - "Electronic structure": "[Ar].3d8.4s2", + "Electronic structure": { + "0": "[Ar].3d8.4s2", + "2": "[Ar].3d8", + "3": "[Ar].3d7" + }, "ICSD oxidation states": [ 1, 2, @@ -8733,7 +8946,10 @@ "Critical temperature": "no data K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Rn].5f14.7s2", + "Electronic structure": { + "0": "[Rn].5f14.7s2", + "3": "[Rn].5f13" + }, "Liquid range": "no data K", "Melting point": "about 1100 K", "Mendeleev no": 35, @@ -8891,7 +9107,10 @@ "Critical temperature": "no data K", "Density of solid": "20450 kg m-3", "Electrical resistivity": "120 10-8 Ω m", - "Electronic structure": "[Rn].5f4.6d1.7s2", + "Electronic structure": { + "0": "[Rn].5f4.6d1.7s2", + "5": "[Rn].5f2" + }, "Ionic radii": { "2": 1.24, "3": 1.15, @@ -9101,7 +9320,10 @@ "Critical temperature": "154.6 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[He].2s2.2p4", + "Electronic structure": { + "0": "[He].2s2.2p4", + "-2": "[He].2s2.2p6" + }, "ICSD oxidation states": [ -2 ], @@ -9215,7 +9437,10 @@ "Critical temperature": "no data K", "Density of solid": "22610 kg m-3", "Electrical resistivity": "8.1 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d6.6s2", + "Electronic structure": { + "0": "[Xe].4f14.5d6.6s2", + "4": "[Xe].4f14.5d4" + }, "Ionic radii": { "4": 0.77, "5": 0.715, @@ -9408,7 +9633,12 @@ "Critical temperature": "994 K", "Density of solid": "1823 kg m-3", "Electrical resistivity": "about 10 10-8 Ω m", - "Electronic structure": "[Ne].3s2.3p3", + "Electronic structure": { + "0": "[Ne].3s2.3p3", + "-3": "[Ne].3s2.3p6", + "3": "[Ne].3s2", + "5": "1s2.2s2.2p6" + }, "ICSD oxidation states": [ 3, 4, @@ -9536,7 +9766,10 @@ "Critical temperature": "no data K", "Density of solid": "15370 kg m-3", "Electrical resistivity": "18 10-8 Ω m", - "Electronic structure": "[Rn].5f2.6d1.7s2", + "Electronic structure": { + "0": "[Rn].5f2.6d1.7s2", + "5": "[Hg].6p6" + }, "Ionic radii": { "3": 1.16, "4": 1.04, @@ -9740,7 +9973,11 @@ "Critical temperature": "no data K", "Density of solid": "11340 kg m-3", "Electrical resistivity": "21 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d10.6s2.6p2", + "Electronic structure": { + "0": "[Xe].4f14.5d10.6s2.6p2", + "2": "[Xe].4f14.5d10.6s2", + "4": "[Xe].4f14.5d10" + }, "ICSD oxidation states": [ 2, 4 @@ -9966,7 +10203,11 @@ "Critical temperature": "no data K", "Density of solid": "12023 kg m-3", "Electrical resistivity": "10.8 10-8 Ω m", - "Electronic structure": "[Kr].4d10", + "Electronic structure": { + "0": "[Kr].4d10", + "2": "[Kr].4d8", + "4": "[Kr].4d6" + }, "ICSD oxidation states": [ 2, 4 @@ -10122,7 +10363,10 @@ "Critical temperature": "no data K", "Density of solid": "7264 kg m-3", "Electrical resistivity": "about 75 10-8 Ω m", - "Electronic structure": "[Xe].4f5.6s2", + "Electronic structure": { + "0": "[Xe].4f5.6s2", + "3": "[Xe].4f4" + }, "Ionic radii": { "3": 1.11 }, @@ -10271,7 +10515,12 @@ "Critical temperature": "no data K", "Density of solid": "9196 kg m-3", "Electrical resistivity": "40 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d10.6s2.6p4", + "Electronic structure": { + "0": "[Xe].4f14.5d10.6s2.6p4", + "-2": "[Xe].4f14.5d10.6s2.6p6", + "2": "[Xe].4f14.5d10.6s2.6p2", + "4": "[Xe].4f14.5d10.6s2" + }, "Ionic radii": { "4": 1.08, "6": 0.81 @@ -10445,7 +10694,10 @@ "Critical temperature": "no data K", "Density of solid": "6640 kg m-3", "Electrical resistivity": "70 10-8 Ω m", - "Electronic structure": "[Xe].4f3.6s2", + "Electronic structure": { + "0": "[Xe].4f3.6s2", + "3": "[Xe].4f2" + }, "ICSD oxidation states": [ 3, 4 @@ -10611,7 +10863,11 @@ "Critical temperature": "no data K", "Density of solid": "21090 kg m-3", "Electrical resistivity": "10.6 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d9.6s1", + "Electronic structure": { + "0": "[Xe].4f14.5d9.6s1", + "2": "[Xe].4f14.5d8", + "4": "[Xe].4f14.5d6" + }, "Ionic radii": { "2": 0.94, "4": 0.765, @@ -10775,7 +11031,10 @@ "Critical temperature": "no data K", "Density of solid": "19816 kg m-3", "Electrical resistivity": "150 10-8 Ω m", - "Electronic structure": "[Rn].5f6.7s2", + "Electronic structure": { + "0": "[Rn].5f6.7s2", + "4": "[Rn].5f4" + }, "Ionic radii": { "3": 1.14, "4": 1, @@ -10981,7 +11240,10 @@ "Critical temperature": "no data K", "Density of solid": "5000 kg m-3", "Electrical resistivity": "100 10-8 Ω m", - "Electronic structure": "[Rn].7s2", + "Electronic structure": { + "0": "[Rn].7s2", + "2": "[Hg].6p6" + }, "Ionic radii": { "2": 1.62 }, @@ -11146,7 +11408,10 @@ "Critical temperature": "2093 K", "Density of solid": "1532 kg m-3", "Electrical resistivity": "13.3 10-8 Ω m", - "Electronic structure": "[Kr].5s1", + "Electronic structure": { + "0": "[Kr].5s1", + "1": "[Ar].3d10.4s2.4p6" + }, "ICSD oxidation states": [ 1 ], @@ -11301,7 +11566,10 @@ "Critical temperature": "no data K", "Density of solid": "21020 kg m-3", "Electrical resistivity": "18 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d5.6s2", + "Electronic structure": { + "0": "[Xe].4f14.5d5.6s2", + "4": "[Xe].4f14.5d3" + }, "ICSD oxidation states": [ 3, 4, @@ -11493,7 +11761,10 @@ "Critical temperature": "no data K", "Density of solid": "12450 kg m-3", "Electrical resistivity": "4.3 10-8 Ω m", - "Electronic structure": "[Kr].4d8.5s1", + "Electronic structure": { + "0": "[Kr].4d8.5s1", + "3": "[Kr].4d6" + }, "ICSD oxidation states": [ 3, 4 @@ -11637,7 +11908,9 @@ "Critical temperature": "377 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d10.6s2.6p6", + "Electronic structure": { + "0": "[Xe].4f14.5d10.6s2.6p6" + }, "Liquid range": "9.3 K", "Max oxidation state": 0, "Melting point": "202 K", @@ -11779,7 +12052,11 @@ "Critical temperature": "no data K", "Density of solid": "12370 kg m-3", "Electrical resistivity": "7.1 10-8 Ω m", - "Electronic structure": "[Kr].4d7.5s1", + "Electronic structure": { + "0": "[Kr].4d7.5s1", + "3": "[Kr].4d5", + "4": "[Kr].4d4" + }, "ICSD oxidation states": [ 2, 3, @@ -11941,7 +12218,13 @@ "Critical temperature": "1314 K", "Density of solid": "1960 kg m-3", "Electrical resistivity": "> 102310-8 Ω m", - "Electronic structure": "[Ne].3s2.3p4", + "Electronic structure": { + "0": "[Ne].3s2.3p4", + "-2": "[Ne].3s2.3p6", + "2": "[Ne].3s2.3p2", + "4": "[Ne].3s2", + "6": "1s2.2s2.2p6" + }, "ICSD oxidation states": [ -1, 2, @@ -12071,7 +12354,12 @@ "Critical temperature": "no data K", "Density of solid": "6697 kg m-3", "Electrical resistivity": "40 10-8 Ω m", - "Electronic structure": "[Kr].4d10.5s2.5p3", + "Electronic structure": { + "0": "[Kr].4d10.5s2.5p3", + "-3": "[Kr].4d10.5s2.5p6", + "3": "[Kr].4d10.5s2", + "5": "[Kr].4d10" + }, "ICSD oxidation states": [ -2, 3, @@ -12222,7 +12510,10 @@ "Critical temperature": "no data K", "Density of solid": "2985 kg m-3", "Electrical resistivity": "about 55 10-8 Ω m", - "Electronic structure": "[Ar].3d1.4s2", + "Electronic structure": { + "0": "[Ar].3d1.4s2", + "3": "[Ne].3s2.3p6" + }, "ICSD oxidation states": [ 2, 3 @@ -12328,7 +12619,13 @@ "Critical temperature": "1766 K", "Density of solid": "4819 kg m-3", "Electrical resistivity": "high 10-8 Ω m", - "Electronic structure": "[Ar].3d10.4s2.4p4", + "Electronic structure": { + "0": "[Ar].3d10.4s2.4p4", + "-2": "[Ar].3d10.4s2.4p6", + "2": "[Ar].3d10.4s2.4p2", + "4": "[Ar].3d10.4s2", + "6": "[Ar].3d10" + }, "ICSD oxidation states": [ -1, 4, @@ -12460,7 +12757,11 @@ "Critical temperature": "no data K", "Density of solid": "2330 kg m-3", "Electrical resistivity": "about 100000 10-8 Ω m", - "Electronic structure": "[Ne].3s2.3p2", + "Electronic structure": { + "0": "[Ne].3s2.3p2", + "-4": "[Ne].3s2.3p6", + "4": "1s2.2s2.2p6" + }, "ICSD oxidation states": [ -4, 4 @@ -12563,7 +12864,10 @@ "Critical temperature": "no data K", "Density of solid": "7353 kg m-3", "Electrical resistivity": "94 10-8 Ω m", - "Electronic structure": "[Xe].4f6.6s2", + "Electronic structure": { + "0": "[Xe].4f6.6s2", + "3": "[Xe].4f5" + }, "ICSD oxidation states": [ 2, 3 @@ -12747,7 +13051,12 @@ "Critical temperature": "no data K", "Density of solid": "7310 kg m-3", "Electrical resistivity": "11.5 10-8 Ω m", - "Electronic structure": "[Kr].4d10.5s2.5p2", + "Electronic structure": { + "0": "[Kr].4d10.5s2.5p2", + "-4": "[Kr].4d10.5s2.5p6", + "2": "[Kr].4d10.5s2", + "4": "[Kr].4d10" + }, "ICSD oxidation states": [ 2, 3, @@ -12899,7 +13208,10 @@ "Critical temperature": "no data K", "Density of solid": "2630 kg m-3", "Electrical resistivity": "13.5 10-8 Ω m", - "Electronic structure": "[Kr].5s2", + "Electronic structure": { + "0": "[Kr].5s2", + "2": "[Ar].3d10.4s2.4p6" + }, "ICSD oxidation states": [ 2 ], @@ -13046,7 +13358,10 @@ "Critical temperature": "no data K", "Density of solid": "16650 kg m-3", "Electrical resistivity": "13.5 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d3.6s2", + "Electronic structure": { + "0": "[Xe].4f14.5d3.6s2", + "5": "[Xe].4f14" + }, "ICSD oxidation states": [ 3, 4, @@ -13230,7 +13545,10 @@ "Critical temperature": "no data K", "Density of solid": "8219 kg m-3", "Electrical resistivity": "115 10-8 Ω m", - "Electronic structure": "[Xe].4f9.6s2", + "Electronic structure": { + "0": "[Xe].4f9.6s2", + "3": "[Xe].4f8" + }, "ICSD oxidation states": [ 3, 4 @@ -13404,7 +13722,11 @@ "Critical temperature": "no data K", "Density of solid": "11500 kg m-3", "Electrical resistivity": "about 22 10-8 Ω m", - "Electronic structure": "[Kr].4d5.5s2", + "Electronic structure": { + "0": "[Kr].4d5.5s2", + "4": "[Kr].4d3", + "7": "[Ar].3d10.4s2.4p6" + }, "Ionic radii": { "4": 0.785, "5": 0.74, @@ -13552,7 +13874,13 @@ "Critical temperature": "no data K", "Density of solid": "6240 kg m-3", "Electrical resistivity": "about 10000 10-8 Ω m", - "Electronic structure": "[Kr].4d10.5s2.5p4", + "Electronic structure": { + "0": "[Kr].4d10.5s2.5p4", + "-2": "[Kr].4d10.5s2.5p6", + "2": "[Kr].4d10.5s2.5p2", + "4": "[Kr].4d10.5s2", + "6": "[Kr].4d10" + }, "ICSD oxidation states": [ -2, 4, @@ -13726,7 +14054,10 @@ "Critical temperature": "no data K", "Density of solid": "11724 kg m-3", "Electrical resistivity": "15 10-8 Ω m", - "Electronic structure": "[Rn].6d2.7s2", + "Electronic structure": { + "0": "[Rn].6d2.7s2", + "4": "[Hg].6p6" + }, "ICSD oxidation states": [ 4 ], @@ -13917,7 +14248,10 @@ "Critical temperature": "no data K", "Density of solid": "4507 kg m-3", "Electrical resistivity": "about 40 10-8 Ω m", - "Electronic structure": "[Ar].3d2.4s2", + "Electronic structure": { + "0": "[Ar].3d2.4s2", + "4": "[Ne].3s2.3p6" + }, "ICSD oxidation states": [ 2, 3, @@ -14062,7 +14396,11 @@ "Critical temperature": "no data K", "Density of solid": "11850 kg m-3", "Electrical resistivity": "15 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d10.6s2.6p1", + "Electronic structure": { + "0": "[Xe].4f14.5d10.6s2.6p1", + "1": "[Xe].4f14.5d10.6s2", + "3": "[Xe].4f14.5d10" + }, "ICSD oxidation states": [ 1, 3 @@ -14253,7 +14591,10 @@ "Critical temperature": "no data K", "Density of solid": "9321 kg m-3", "Electrical resistivity": "67.6 10-8 Ω m", - "Electronic structure": "[Xe].4f13.6s2", + "Electronic structure": { + "0": "[Xe].4f13.6s2", + "3": "[Xe].4f12" + }, "ICSD oxidation states": [ 3 ], @@ -14430,7 +14771,10 @@ "Critical temperature": "no data K", "Density of solid": "19050 kg m-3", "Electrical resistivity": "28 10-8 Ω m", - "Electronic structure": "[Rn].5f3.6d1.7s2", + "Electronic structure": { + "0": "[Rn].5f3.6d1.7s2", + "6": "[Hg].6p6" + }, "ICSD oxidation states": [ 3, 4, @@ -14678,7 +15022,13 @@ "Critical temperature": "no data K", "Density of solid": "6110 kg m-3", "Electrical resistivity": "20 10-8 Ω m", - "Electronic structure": "[Ar].3d3.4s2", + "Electronic structure": { + "0": "[Ar].3d3.4s2", + "2": "[Ar].3d3", + "3": "[Ar].3d2", + "4": "[Ar].3d1", + "5": "[Ne].3s2.3p6" + }, "ICSD oxidation states": [ 2, 3, @@ -14841,7 +15191,11 @@ "Critical temperature": "no data K", "Density of solid": "19250 kg m-3", "Electrical resistivity": "5.4 10-8 Ω m", - "Electronic structure": "[Xe].4f14.5d4.6s2", + "Electronic structure": { + "0": "[Xe].4f14.5d4.6s2", + "4": "[Xe].4f14.5d2", + "6": "[Xe].4f14" + }, "ICSD oxidation states": [ 2, 3, @@ -15026,7 +15380,9 @@ "Critical temperature": "289.7 K", "Density of solid": "no data kg m-3", "Electrical resistivity": "no data 10-8 Ω m", - "Electronic structure": "[Kr].4d10.5s2.5p6", + "Electronic structure": { + "0": "[Kr].4d10.5s2.5p6" + }, "Ionic radii": { "8": 0.62 }, @@ -15154,7 +15510,10 @@ "Critical temperature": "no data K", "Density of solid": "4472 kg m-3", "Electrical resistivity": "about 60 10-8 Ω m", - "Electronic structure": "[Kr].4d1.5s2", + "Electronic structure": { + "0": "[Kr].4d1.5s2", + "3": "[Ar].3d10.4s2.4p6" + }, "ICSD oxidation states": [ 3 ], @@ -15288,7 +15647,10 @@ "Critical temperature": "no data K", "Density of solid": "6570 kg m-3", "Electrical resistivity": "25.0 10-8 Ω m", - "Electronic structure": "[Xe].4f14.6s2", + "Electronic structure": { + "0": "[Xe].4f14.6s2", + "3": "[Xe].4f13" + }, "ICSD oxidation states": [ 2, 3 @@ -15468,7 +15830,10 @@ "Critical temperature": "no data K", "Density of solid": "7140 kg m-3", "Electrical resistivity": "6.0 10-8 Ω m", - "Electronic structure": "[Ar].3d10.4s2", + "Electronic structure": { + "0": "[Ar].3d10.4s2", + "2": "[Ar].3d10" + }, "ICSD oxidation states": [ 2 ], @@ -15592,7 +15957,10 @@ "Critical temperature": "no data K", "Density of solid": "6511 kg m-3", "Electrical resistivity": "43.3 10-8 Ω m", - "Electronic structure": "[Kr].4d2.5s2", + "Electronic structure": { + "0": "[Kr].4d2.5s2", + "4": "[Ar].3d10.4s2.4p6" + }, "ICSD oxidation states": [ 2, 3, diff --git a/src/pymatgen/core/periodic_table.py b/src/pymatgen/core/periodic_table.py index d1be4dd4795..ddc31e6bb1e 100644 --- a/src/pymatgen/core/periodic_table.py +++ b/src/pymatgen/core/periodic_table.py @@ -324,10 +324,19 @@ def electron_affinity(self) -> float: @property def electronic_structure(self) -> str: - """Electronic structure as string, with only valence electrons. - e.g. The electronic structure for Fe is represented as '[Ar].3d6.4s2'. + """Electronic structure as string, with only valence electrons. The + electrons are listed in order of increasing prinicpal quantum number + (orbital number), irrespective of the actual energy level, + e.g., The electronic structure for Fe is represented as '[Ar].3d6.4s2' + even though the 3d electrons are higher in energy than the 4s. + + References: + Kramida, A., Ralchenko, Yu., Reader, J., and NIST ASD Team (2023). NIST + Atomic Spectra Database (ver. 5.11). https://physics.nist.gov/asd [2024, + June 3]. National Institute of Standards and Technology, Gaithersburg, + MD. DOI: https://doi.org/10.18434/T4W30F """ - return re.sub("", "", self._data["Electronic structure"]) + return re.sub("", "", self._data["Electronic structure"]["0"]) @property def average_ionic_radius(self) -> FloatWithUnit: @@ -412,10 +421,18 @@ def icsd_oxidation_states(self) -> tuple[int, ...]: @property def full_electronic_structure(self) -> list[tuple[int, str, int]]: - """Full electronic structure as tuple. - e.g. The electronic structure for Fe is represented as: + """Full electronic structure as list of tuples, in order of increasing + principal (n) and angular momentum (l) quantum numbers. + + For example, the electronic structure for Fe is represented as: [(1, "s", 2), (2, "s", 2), (2, "p", 6), (3, "s", 2), (3, "p", 6), (3, "d", 6), (4, "s", 2)]. + + References: + Kramida, A., Ralchenko, Yu., Reader, J., and NIST ASD Team (2023). NIST + Atomic Spectra Database (ver. 5.11). https://physics.nist.gov/asd [2024, + June 3]. National Institute of Standards and Technology, Gaithersburg, + MD. DOI: https://doi.org/10.18434/T4W30F """ e_str = self.electronic_structure @@ -433,7 +450,8 @@ def parse_orbital(orb_str): @property def valence(self) -> tuple[int | np.nan, int]: """Valence subshell angular moment (L) and number of valence e- (v_e), - obtained from full electron config. + obtained from full electron config, where L=0, 1, 2, or 3 for s, p, d, + and f orbitals, respectively. """ if self.group == 18: return np.nan, 0 # The number of valence of noble gas is 0 @@ -1076,21 +1094,79 @@ def spin(self) -> float | None: return self._spin @property - def full_electronic_structure(self) -> list[tuple[int, str, int]]: - """Full electronic structure as tuple. Not implemented for Species as of now.""" - raise NotImplementedError + def electronic_structure(self) -> str: + """Electronic structure as string, with only valence electrons. The + electrons are listed in order of increasing prinicpal quantum number + (orbital number), irrespective of the actual energy level, + e.g., The electronic structure for Fe is represented as '[Ar].3d6.4s2' + even though the 3d electrons are higher in energy than the 4s. + + References: + Kramida, A., Ralchenko, Yu., Reader, J., and NIST ASD Team (2023). NIST + Atomic Spectra Database (ver. 5.11). https://physics.nist.gov/asd [2024, + June 3]. National Institute of Standards and Technology, Gaithersburg, + MD. DOI: https://doi.org/10.18434/T4W30F + """ + if self._data["Electronic structure"].get(str(self._oxi_state)) is not None: + return re.sub("", "", self._data["Electronic structure"][str(self._oxi_state)]) + raise ValueError(f"No electronic structure data for oxidation state {self.oxi_state}") + + # NOTE - copied exactly from Element. Refactoring / inheritance may improve + # robustness @property - def electronic_structure(self) -> list[tuple[int, str, int]]: - """Electronic structure as tuple. Not implemented for Species as of now.""" - raise NotImplementedError + def full_electronic_structure(self) -> list[tuple[int, str, int]]: + """Full electronic structure as list of tuples, in order of increasing + principal (n) and angular momentum (l) quantum numbers. + + For example, the electronic structure for Fe+2 is represented as: + [(1, "s", 2), (2, "s", 2), (2, "p", 6), (3, "s", 2), (3, "p", 6), + (3, "d", 6)]. + + References: + Kramida, A., Ralchenko, Yu., Reader, J., and NIST ASD Team (2023). NIST + Atomic Spectra Database (ver. 5.11). https://physics.nist.gov/asd [2024, + June 3]. National Institute of Standards and Technology, Gaithersburg, + MD. DOI: https://doi.org/10.18434/T4W30F + """ + e_str = self.electronic_structure + + def parse_orbital(orb_str): + if match := re.match(r"(\d+)([spdfg]+)(\d+)", orb_str): + return int(match[1]), match[2], int(match[3]) + return orb_str + + data = [parse_orbital(s) for s in e_str.split(".")] + if data[0][0] == "[": + sym = data[0].replace("[", "").replace("]", "") + data = list(Element(sym).full_electronic_structure) + data[1:] + return data + # NOTE - copied exactly from Element. Refactoring / inheritance may improve + # robustness @property def valence(self) -> tuple[int | np.nan, int]: """Valence subshell angular moment (L) and number of valence e- (v_e), - obtained from full electron config. Not implemented for Species as of now. + obtained from full electron config, where L=0, 1, 2, or 3 for s, p, d, + and f orbitals, respectively. """ - raise NotImplementedError + if self.group == 18: + return np.nan, 0 # The number of valence of noble gas is 0 + + L_symbols = "SPDFGHIKLMNOQRTUVWXYZ" + valence: list[tuple[int, int]] = [] + full_electron_config = self.full_electronic_structure + last_orbital = full_electron_config[-1] + for n, l_symbol, ne in full_electron_config: + idx = L_symbols.lower().index(l_symbol) + if ne < (2 * idx + 1) * 2 or ( + (n, l_symbol, ne) == last_orbital and ne == (2 * idx + 1) * 2 and len(valence) == 0 + ): # check for full last shell (e.g. column 2) + valence.append((idx, ne)) + if len(valence) > 1: + raise ValueError(f"{self} has ambiguous valence") + + return valence[0] @property def ionic_radius(self) -> float | None: diff --git a/tests/core/test_periodic_table.py b/tests/core/test_periodic_table.py index a0ffe06fead..f92335d5266 100644 --- a/tests/core/test_periodic_table.py +++ b/tests/core/test_periodic_table.py @@ -600,13 +600,55 @@ def test_sort(self): ) assert sp.spin == 5 - def test_not_implemented(self): - with pytest.raises(NotImplementedError): - _ = Species("Fe", 2).full_electronic_structure - with pytest.raises(NotImplementedError): - _ = Species("Fe", 2).electronic_structure - with pytest.raises(NotImplementedError): - _ = Species("Fe", 2).valence + def test_species_electronic_structure(self): + assert Species("Fe", 0).electronic_structure == "[Ar].3d6.4s2" + assert Species("Fe", 0).full_electronic_structure == [ + (1, "s", 2), + (2, "s", 2), + (2, "p", 6), + (3, "s", 2), + (3, "p", 6), + (3, "d", 6), + (4, "s", 2), + ] + assert Species("Fe", 0).valence == (2, 6) + + assert Species("Fe", 2).electronic_structure == "[Ar].3d6" + assert Species("Fe", 2).full_electronic_structure == [ + (1, "s", 2), + (2, "s", 2), + (2, "p", 6), + (3, "s", 2), + (3, "p", 6), + (3, "d", 6), + ] + assert Species("Fe", 2).valence == (2, 6) + + assert Species("Fe", 3).electronic_structure == "[Ar].3d5" + assert Species("Fe", 3).full_electronic_structure == [ + (1, "s", 2), + (2, "s", 2), + (2, "p", 6), + (3, "s", 2), + (3, "p", 6), + (3, "d", 5), + ] + assert Species("Fe", 3).valence == (2, 5) + + assert Species("Li", 1).electronic_structure == "1s2" + # alkali metals, all p + for el in ["Na", "K", "Rb", "Cs"]: + assert Species(el, 1).electronic_structure.split(".")[-1][1::] == "p6", f"Failure for {el} +1" + for el in ["Ca", "Mg", "Ba", "Sr"]: + assert Species(el, 2).electronic_structure.split(".")[-1][1::] == "p6", f"Failure for {el} +2" + + for el in Element: + for ox in el.common_oxidation_states: + if str(el) == "H" and ox == 1: + continue + n_electron_el = sum([orb[-1] for orb in el.full_electronic_structure]) + n_electron_sp = sum([orb[-1] for orb in Species(el, ox).full_electronic_structure]) + assert n_electron_el - n_electron_sp == ox, print(f"Failure for {el} {ox}") def test_get_el_sp():