It appears that extraLevels for an atom finds any levels that have principle quantum number smaller than the ground state, but, which nonetheless have energy higher than the ground state and are dipole coupled to the ground state. These extraLevels are always added into the basis for DynamicPolarizability
calculation. This check is useful and has helped us avoid missing coupling to some states in the past. For the case of Rubidium87
the ground state has n=5 but there are some n=4 levels included in extraLevels
. If one passes in nMin=4
to defineBasis
then these states are double counted. This has led to incorrect values for calculations.
with nMin = 5:
[[5, 0, 0.5, 0.5], [5, 2, 1.5, 0.5], [5, 2, 2.5, 0.5], [6, 0, 0.5, 0.5], [6, 2, 1.5, 0.5], [6, 2, 2.5, 0.5], [4, 2, 2.5], [4, 2, 1.5]]
with nMin = 4:
[[4, 0, 0.5, 0.5], [4, 2, 1.5, 0.5], [4, 2, 2.5, 0.5], [5, 0, 0.5, 0.5], [5, 2, 1.5, 0.5], [5, 2, 2.5, 0.5], [6, 0, 0.5, 0.5], [6, 2, 1.5, 0.5], [6, 2, 2.5, 0.5], [4, 2, 2.5], [4, 2, 1.5]]
This issue could be resolved by checking if the existing state is already included in the basis whenever adding new states to the basis.
I have not checked if this issue occurs anywhere else in the code but it may be likely.