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.

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].

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.

quantum_numbers_to_angular_ket(species, s_c, ...)

Return an AngularKet object in the corresponding coupling scheme from the given quantum numbers.

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