rydiqule.atom_utils.expand_qnums¶
- rydiqule.atom_utils.expand_qnums(qstates: List[A_QState], I: float | None = None) List[A_QState] [source]¶
Expand all list-like A_QStates in a list.
List-like quantum numbers are defined either with a list of quantum numbers or the string “all”. In the “all” case, that quantum number will be expanded into all physically allowed values of that quantum number given the preceeeding numbers.
Iterates through the list, expanding each A_QState specifcation into a list of all states matching that specification. For each state specification in the list, quantum numbers are expanded from left to right. The final list of A_QStates will respect the ordering of the intial states by ordering the states corresponding to each specification by n, l, j, m_j, f, and finally m_f
- Parameters:
- Returns:
List of all atomic states corresponding to all the specifications in the given list.
- Return type:
Notes
- ..note::
While this funcion can expand arbitrary states, it should be noted that the resulting lists of states can be quite long. If they are to be used as the states of a
Cell
, these long state lists can dramatically increase computation time, and it is often worth ensuring that tracking hyperfine states individually is absolutely necessary.
Examples
A basic piece of functionality for this function is as a shorthand for allstates in a given manifold.
>>> D1_ground = A_QState(5,0,0.5, f="all") >>> D1_excited = A_QState(5,0,0.5,f="all") >>> #manifolds for rubidium 87 (I=3/2) >>> print(rq.expand_qnums([D1_ground], I=3/2)) [(n=5, l=0, j=0.5, f=1.0), (n=5, l=0, j=0.5, f=2.0)] >>> print(rq.expand_qnums([D1_excited], I=3/2)) [(n=5, l=0, j=0.5, f=1.0), (n=5, l=0, j=0.5, f=2.0)] >>> #manifolds for rubidium 85 (I=5/2) >>> print(rq.expand_qnums([D1_ground], I=5/2)) [(n=5, l=0, j=0.5, f=2.0), (n=5, l=0, j=0.5, f=3.0)] >>> print(rq.expand_qnums([D1_excited], I=5/2)) [(n=5, l=0, j=0.5, f=2.0), (n=5, l=0, j=0.5, f=3.0)]
Note that while this function is capable of getting large numbers of states, the resulting lists can be quite cumbersome, and be substantially slower if used in a calculation, especially for high angular momentum states.
>>> state = A_QState(7, 2, 2.5, f="all", m_f="all") >>> states_all = rq.expand_qnums([state], I=7/2) >>> print(len(states_all)) 48