gen_roots#
- gen_roots(jiter, rotor='linear', kiter_func=None)[source]#
Return a list of
KetBra
in ground vibrational state.- Parameters:
jiter (Iterable) – An iterable of J values.
rotor (str) – Either ‘linear’ for
DiatomState
or ‘symmetric’ forSymTopState
molecular states.kiter_func (str | None) – Python expression evaluating to an iterable over K states. The expression is evaluated in an environment with
j
bound to current J value.
- Return type:
List[KetBra]
Examples
Create KetBras for linear rotor and J up to 5:
>>> import rotsim2d.pathways as pw >>> pw.gen_roots(range(5+1)) [Ketbra(DiatomState(nu=0, j=0), DiatomState(nu=0, j=0)), Ketbra(DiatomState(nu=0, j=1), DiatomState(nu=0, j=1)), Ketbra(DiatomState(nu=0, j=2), DiatomState(nu=0, j=2)), Ketbra(DiatomState(nu=0, j=3), DiatomState(nu=0, j=3)), Ketbra(DiatomState(nu=0, j=4), DiatomState(nu=0, j=4)), Ketbra(DiatomState(nu=0, j=5), DiatomState(nu=0, j=5))]
Create KetBras for symmetric top, J up to 2 and K up to J:
>>> pw.gen_roots(range(2+1), rotor='symmetric', kiter_func='range(j+1)') [Ketbra(SymTopState(nu=0, j=0, k=0), SymTopState(nu=0, j=0, k=0)), Ketbra(SymTopState(nu=0, j=1, k=0), SymTopState(nu=0, j=1, k=0)), Ketbra(SymTopState(nu=0, j=1, k=1), SymTopState(nu=0, j=1, k=1)), Ketbra(SymTopState(nu=0, j=2, k=0), SymTopState(nu=0, j=2, k=0)), Ketbra(SymTopState(nu=0, j=2, k=1), SymTopState(nu=0, j=2, k=1)), Ketbra(SymTopState(nu=0, j=2, k=2), SymTopState(nu=0, j=2, k=2))]