utils

Full module path: rydstate.angular.utils

Functions

check_spin_addition_rule(s_1, s_2, s_tot)

Check if the spin addition rule is satisfied.

format_quantum_number(value)

Format a quantum number as string.

get_coupling_scheme_for_quantum_number(qn[, ...])

Return the coupling scheme, in which the given quantum number is a good quantum number.

get_possible_quantum_number_values(s_1, s_2, ...)

Determine a list of possible s_tot values from s_1 and s_2 if s_tot is not given, else return [s_tot].

get_qn_name_from_operator(operator)

Return the quantum number name corresponding to the given operator.

get_quantum_number_names_for_coupling_scheme(...)

Return a list of quantum number names that are good quantum numbers in the given coupling scheme.

get_spectroscopic_letter(l)

Return the spectroscopic letter (s, p, d, f, ...) for the orbital angular momentum quantum number l.

is_angular_momentum_quantum_number(qn)

Check if the given string is an AngularMomentumQuantumNumbers.

is_angular_operator_type(qn)

Check if the given string is an AngularOperatorType.

is_not_set(obj)

Check if the obj is the NotSet singleton.

is_unknown(obj)

Check if obj is Unknown.

lru_cache(maxsize)

Wrap functools.lru_cache for correct type annotations.

minus_one_pow(n)

Calculate (-1)^n for an integer n and raise an error if n is not an integer.

try_trivial_spin_addition(s_1, s_2, s_tot)

Try to determine s_tot from s_1 and s_2 if it is not given.

Classes

NotSet(*args, **kwargs)

Singleton for a not set value and type at the same time.

Unknown(*args, **kwargs)

Singleton for a unknown quantum number and type at the same time.

Exceptions

InvalidQuantumNumbersError(ket[, msg])

Module description