Function adas.occ2cfg

def occ2cfg(occ, eissner=False, cowan=False, start=0, keep_zero=False)

Converts a configuration string to an occupation number list.

Parameters

occ : int, list or array
Shell occupations in convention form ie, 1s, 2s,2p, 3s, 3p, 3d etc.
eissner : bool
The configuration is returned in Eissner form.
cowan : bool
The configuration is returned in a form suitable to use in the rcn step of adas8#1, the Cowan atomic structure code.
start_index : int
Start the returned configuration at this index in occ. The default is 0, ie start at 1s.
keep_zero : bool
Retain unoccupied orbitals in the configuration. Default is False, ie to remove them.

Returns

config : string
Configuration string in standard ADAS form unless the eissner or cowan arguments are set to True.

Notes

The occupation input (occ) must start at 1s.

The standard ADAS form has a single space for the number of electrons, eg 3d10 is represented as 3dA.

n=8 is the (current) maximum principal quantum allowed.

For Cowan-style configurations limit the number of orbitals to 8 since this is the maximum amount permitted in the driver files.

Version History

  • Martin O'Mullane, 12-08-2022

    • First version
  • Martin O'Mullane, 22-08-2022

    • Restrict Cowan-style configurations to 8 orbitals.

Example

An Ni-like ground configuration in differet forms.

>>> import adas as adas
>>> occ = [2, 2, 6, 2, 6, 10]
>>> adas.occ2cfg(occ)
'1s2 2s2 2p6 3s2 3p6 3dA'
>>> adas.occ2cfg(occ, start=2, keep_zero=True, cowan=True)
'2p6  3s2  3p6  3d10'
>>> adas.occ2cfg(occ, eissner=True)
'521522563524565606'