Example codes: TRG
Please look at the readme page if you have not done so already. Here we present an implementation of the tensor renormalization group (TRG), which can be applied to contract the partition function of a 2D classical statistical mechanics model or the pathintegral of a 1D quantum lattice model. This implementation is based on the insertion of properly chosen isometries into the network, as explained here, opposed to the direct use of the SVD. Isometries q are chosen to maximize the norm of the C tensor defined below, while isometries v and w are chosen to maximize the norm of the coarsegrained A' tensor defined below. We assume, for simplicity, that the initial network contains only real coefficients and is symmetric under reflections on both the horizontal and vertical axes.

Computational cost: O(χ^6)â€‹
â€‹

Exploits (horizontal and vertical) spatial reflection symmetries
â€‹â€‹

Three isometries q, w and v at coarsegraining step
Coarsegraining structure:
Reflection symmetry constraints:
Optimization criteria:
Index ordering conventions:
Coarsegraining iteration (MATLAB function):
Initialization (MATLAB script):
'mainTRG' benchmark:
â€‹
Method: TRG (heavily customized algorithm), bond dimension χ = 32
Test problem: 2D classical Ising model at T = 0.98Tc, square lattice of 2^16 by 2^16 sites
Running time: approx 15 secs
Quantities computed: free energy density, internal energy density, spontaneous magnetization
â€‹
Typical results:
â€‹
Error in free energy density (TRG): approx 1e9
Error in internal energy density (TRG): approx 7e6
â€‹
Spontaneous magnetization (TRG): M = 0.74615...
Spontaneous magnetization (exact): M = 0.74624...