1+1D Quantum Models
TNRKit provides tools to construct partition function tensors for $(1+1)$-dimensional quantum lattice models with translation symmetry (currently only nearest-neighbor Hamiltonians are supported). These tensors can then be studied with any of the 2D tensor network renormalization schemes (TRG, HOTRG, LoopTNR, etc.).
Quantum Partition Functions
A $(1+1)$D quantum system at inverse temperature $\beta$ has partition function
\[\mathcal{Z} = \mathrm{Tr}\, e^{-\beta H}\]
where $H$ is the Hamiltonian. By discretizing the imaginary-time direction into $N$ steps of size $\delta\tau = \beta / N$ and applying a Trotter–Suzuki decomposition, the partition function becomes a contraction of a 2D tensor network. Each time step is represented by a Trotter gate acting on nearest-neighbor pairs.
Tensor Network Representation of $\mathcal{Z}$
When $H = \sum_i h_{i,i+1}$, where $h_{i,i+1} = h$ (due to translation symmetry) is a nearest-neighbor term, the Trotter gate network naturally forms a square lattice. Each Trotter gate $g = \exp(-\delta\tau \, h)$ connects two spatial sites (horizontal direction in the gate diagram) and advances by one imaginary-time step $\delta\tau$ (vertical direction in the gate diagram). However, the gate network is rotated by 45 degrees relative to the standard upright orientation.
gate_to_tensor transforms the rotated gate network into an upright square tensor network. The resulting tensor $T$ is the elementary cell of this upright network, and follows the standard TNRKit leg convention:
3
↓
1 ← T ← 4
↓
2The horizontal direction (legs 1 ↔ 4) corresponds to the spatial dimension of the quantum chain, and the vertical direction (legs 2 ↔ 3) corresponds to imaginary time. The imaginary-time step represented by one $T$ tensor is the same $\delta\tau$ as one Trotter gate — the transformation does not coarse-grain in time. In the spatial direction, however, the transformation does renormalize: each $T$ represents two original lattice sites.
Vertical Stacking
To build up the imaginary-time direction, multiple copies of $T$ are stacked vertically. As the stack grows, the bond dimension in the spatial direction would grow exponentially if left unchecked. TNRKit provides two stacking strategies that use HOTRG-style compression to keep the bond dimension under control.
vertical_stack_expstacks $2^{\text{nfold}}$ copies of $T$ by repeatedly doubling the current stack. Each iteration takes the current stack (representing $2^k$ Trotter steps) and compresses it on top of itself, yielding a stack of $2^{k+1}$ steps. Afternfolditerations, the result represents $2^{\text{nfold}}$ Trotter steps. This is expected to be the more accurate approach, since only $m$ iterations are needed to reach $2^m$ steps.vertical_stack_linearstacks exactly $n$ copies of $T$ linearly (as opposed to a power of 2). Each iteration adds one more copy of the original tensor $T$ on top of the current stack. This is useful when you need a specific number of Trotter steps rather than a power of 2.
Implementing Custom Quantum Models
To construct the partition function of a custom $(1+1)$D quantum Hamiltonian with nearest-neighbor interactions, follow this recipe:
Construct the Trotter gate: Build a 4-leg tensor representing $\exp(-\delta\tau \, h_{i,i+1})$ where $h_{i,i+1}$ is the nearest-neighbor Hamiltonian term. The gate should live in $V \otimes V \leftarrow V \otimes V$, where $V$ is the local Hilbert space.
Convert to partition function tensor: Call
gate_to_tensor(gate; trunc=...)to obtain the elementary tensor $T$.Stack in the time direction: Use
vertical_stack_exporvertical_stack_linearto build up the desired number of Trotter steps.
Now you are ready to feed the resulting 2D tensor network into any of TNRKit's 2D schemes (TRG, HOTRG, LoopTNR, etc.).