CDTK.Tools.Iterators module
- class CDTK.Tools.Iterators.MultiCombination(n, m)[source]
Bases:
object
Iterate over all possible combinations of n indices taken in groups of m
- class CDTK.Tools.Iterators.MultiCounter(length=1, maxiter=1)[source]
Bases:
object
Emulate the behaviour of multiple nested do loops
Maintains a list of integers that evolve as the indexes of a nested “for” loop. It may be useful to construct nested “for” loops from which the number of nested elements is not known at programming time, but at execution time.
- increase()[source]
increase the list of pointers return 0 if the end is reached return 1 if succeed
- setLimitsN(n=0, nd=1)[source]
set the list of initial limits to a given number N n – number at which the pointers are set nd – length of the vector
- CDTK.Tools.Iterators.excitations(x, m, n=None, r=None)[source]
Generate excitation indices for x degrees of freedom up to m quanta
x – integer, number of degrees of freedom m – integer, maximum quanta of excitation —- n – tuple with maximum states per DOF (max states = max quanta + 1) r – reference tuple passed recursively returns an interator object.