Function adas.cfg2occ
def cfg2occ(config, iz0, iz)
-
Converts a configuration string to an occupation number list.
Parameters
config
:str
- Configuration in standard or Eissner form.
iz0
:int
- Atomic number.
iz
:int
- Charge of ion (0 is neutral).
Returns
occ
:int, list
- Occupation numbers of orbitals in spectroscopic order.
Notes
Determines unspecified electrons by filling in occupation numbers based on the ground configuration of the ion in question in order of spectroscopic notation, this means for the W+14 with a configuration of simply '5p1' it will assume that a 5s electron has been promoted rather than a 4f.
Note, however, that the routine does not assume lower occupation numbers are filled if the ground configuration has them partially empty so for neutral tungsten with a configuration of '6p1' it will leave the 5f and 5g orbitals empty and the 5d partially filled as one would expect.
Version History
-
Martin O'Mullane, 10-08-2022
- First version
-
Martin O'Mullane, 29-12-2022
- Change A-E to 10-14 when parsing ADAS standard form.
-
Martin O'Mullane, 09-05-2023
- Check for Eissner form and convert to a form suitable for use in function.
Example
>>> import adas as adas >>> adas.cfg2occ('3s2 3p5 3d3', 29, 9) array([2, 2, 6, 2, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])