Function adas.i4idfl
def i4idfl(n, l, zeroindex=False)
-
Returns a unique index number based on the value of the n and l quantum numbers passed to it.
Parameters
n
:int
- principal quantum number
l
:int
- angular momentumn quantum number
zeroindex
:bool
- when set to True the result starts the index sequence at 0 rather than 1.
Returns
int
- an index depending on n and l.
Notes
The index is used to reference arrays containing data dependent on the n and l quantum numbers. Set zeroindex=True to index python arrays without adjust the result. Keeping the starting index=1 is to maintain compatability withe the fortran routine.
See Also
xxidtl
- inverse function returning n,l for the index.
Version History
- Martin O'Mullane, 02-07-2018
- First version
Example
>>> import adas as adas >>> adas.i4idfl(8, 7) 36 >>> adas.i4idfl(1, 0, zeroindex=True) 0