build_hamiltonian¶
Build a Hamiltonian MPO from a list of Interaction objects.
build_hamiltonian
¶
build_hamiltonian(
interactions: List[Interaction],
L: int,
spc: Index,
trunc: Optional[dict] = None,
compact_every: int = 10,
) -> MPO
Build a Hamiltonian MPO from a list of Interaction objects.
Each interaction is accumulated term by term into a running MPO via
oplus, then the result is compressed with two canonical sweeps. This
approach handles arbitrary symmetries — including non-Abelian SU(2) — by
delegating sector arithmetic to Nicole's oplus.
All tensor fields (tnsr, leading_tnsr, terminal_tnsr,
intermid_tnsr) must be pre-filled (including any coupling constants)
before calling this function. build_hamiltonian uses them verbatim.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interactions
|
List[Interaction]
|
List of |
required |
L
|
int
|
Chain length (number of sites). |
required |
spc
|
Index
|
Physical |
required |
trunc
|
Optional[dict]
|
Truncation parameters forwarded to |
None
|
compact_every
|
int
|
Call |
10
|
Returns:
| Type | Description |
|---|---|
MPO
|
Compressed Hamiltonian MPO with bond itags |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any required tensor slot is |
See Also¶
- build_interaction — produces the
interactionslist. - MPO — returned type.
- dmrg.run — passes this MPO to the DMRG solver.