Skip to content

build_ihamiltonian

Build a Hamiltonian iMPO over a unit cell from a list of Interaction objects.

build_ihamiltonian

build_ihamiltonian(interactions: List[Interaction], N: int, spc: Index) -> iMPO

Build a Hamiltonian iMPO for one unit cell of an infinite chain.

Assembles the unit cell directly as an upper-triangular finite-state automaton (see the module docstring). Unlike build_hamiltonian there is no term-by-term accumulation and no compression pass: the automaton is already minimal for finite-range models, and compressing it would destroy the channel structure the VUMPS environments rely on.

Interactions are consumed exactly as build_hamiltonian consumes them: tensor slots must be pre-filled, and the coupling cpl must not be baked in. It is applied here, scaling the on-site tensor or the terminal tensor of a two-site term.

A two-site interaction names its bond by the unit-cell site that leads it, so leading_site must lie in [0, N). Its terminal_site may run past the cell, the spelling for a bond reaching into the next unit cell: Interaction2Site(leading_site=N-1, terminal_site=N) couples the last site of one cell to the first site of the next. intrcmap_1dchain emits exactly that when bcx='IBC'.

Parameters:

Name Type Description Default
interactions List[Interaction]

List of Interaction1Site and Interaction2Site objects with all required tensor fields set.

required
N int

Number of sites in the unit cell.

required
spc Index

Physical Index (space) shared by all sites.

required

Returns:

Type Description
iMPO

Hamiltonian iMPO with bond itags W{i % N:0M} and physical itags s{i:02d}, where M is max(2, len(str(N))).

Raises:

Type Description
ValueError

If N < 1, if a site index falls outside the unit cell, if a span is non-positive, or if a required tensor slot is None.

TypeError

If an active interaction is not Interaction1Site or Interaction2Site.

NotImplementedError

If an active interaction is an InteractionNSite.

Examples:

Heisenberg chain with a two-site unit cell:

>>> cfg = {
...     'geometry': {'lattice': 'chain', 'lx': 2, 'bcx': 'IBC'},
...     'model': {'category': 'bosonic', 'label': 'Heisenberg',
...               'symmetry': 'U1', 'spin': 0.5, 'J': 1.0},
... }
>>> interactions, spc, geo = build_interaction(cfg)
>>> impo = build_ihamiltonian(interactions, geo.L, spc)

Notes

The interactions come from build_interaction on a geometry whose bcx is IBC and whose lx is the length of the unit cell, not of a chain. An interaction that reaches past the end of the cell wraps onto the next copy, the way a translation-invariant chain is described by a finite list.

The operator is left uncompressed on purpose. The environment solver keys on its automaton structure, start channel first and finish channel last; see iMPO.

See Also