Skip to content

InteractionNSite

N-site interaction term spanning a contiguous window of MPO sites.

InteractionNSite dataclass

InteractionNSite(
    sites: List[int] = list(),
    tnsrs: Optional[List[Tensor]] = None,
    *,
    cpl: float = 0.0,
    label: List[str] = list(),
)

Bases: Interaction

N-site interaction term spanning a contiguous window of MPO sites.

Attributes:

Name Type Description
sites List[int]

Operator site indices in operator order (e.g. [m, n, k, l] for c†_m c†_n c_k c_l). Used by the model builder; build_hamiltonian places tensors by the contiguous window derived from min(sites) and max(sites).

tnsrs Optional[List[Tensor]]

Contiguous list of 4-index MPO tensors covering [min(sites), max(sites)]. Length must equal max(sites) - min(sites) + 1. Each tensor has axes (L_bond_IN, R_bond_OUT, bra_OUT, ket_IN). Outer bonds of the window are trivial dim-1 charge-neutral. build_hamiltonian scales the last window tensor by cpl; the model builder must NOT bake the coupling in. Set by the model builder.

Notes

Unlike Interaction1Site and Interaction2Site, which name their sites explicitly and let build_hamiltonian synthesize the operator string in between, an InteractionNSite carries the entire window verbatim. The window is the contiguous range [min(sites), max(sites)], and tnsrs must supply one tensor per site in that range — including any identity or Jordan-Wigner string tensors on sites that carry no operator.

  • sites records the operator site indices in operator order (e.g. [m, n, k, l] for c†_m c†_n c_k c_l). This order is metadata for the model builder; build_hamiltonian only reads min(sites) and max(sites) to locate the window.
  • tnsrs[offset] is placed at site min(sites) + offset. Every tensor has axes (L_bond_IN, R_bond_OUT, bra_OUT, ket_IN); the two outer bonds of the window must be trivial (dim-1, charge-neutral) so the term composes with the identity tensors on the remaining sites.
  • build_hamiltonian scales only the last window tensor by cpl — do not bake the coupling into the tensors.

Since the window is taken verbatim, a term whose operators are not contiguous is expressed by padding the gaps with identity (or string) tensors rather than by splitting the term.

See Also