nkdsl.KBodyIteratorSpec¶
- class KBodyIteratorSpec(labels, index_sets)[source]¶
Static K-body iterator over a pre-computed list of site-index tuples.
This iterator evaluates a term kernel once per entry in index_sets. Each entry is a K-tuple of integer site indices that are bound to the corresponding element of labels inside the evaluation environment.
For a single-site iterator over all N sites, use
KBodyIteratorSpec(labels=("i",), index_sets=tuple((k,) for k in range(N))). For a static triplet iterator, provide the explicit list of(e1, e2, e3)triplets. For a global (one-branch) term, useKBodyIteratorSpec(labels=(), index_sets=((),)).Methods
__init__(labels, index_sets)format_iterate_line([max_shown])Returns a compact readable description of the iteration domain.
Attributes
kindlabel_alabel_b