| Documentation | Build Status | Digital Object Identifyer | Coverage |
|---|---|---|---|
TNRKit.jl is a Julia package that aims to implement as many tensor network renormalization (TNR) schemes as possible. It is built upon TensorKit.jl, which provides functionality for symmetric tensors. The following schemes are currently implemented:
2D square tensor networks
- TRG (Levin and Nave's Tensor Renormalization Group)
- BTRG (bond-weighted TRG)
- LoopTNR (entanglement filtering + loop optimization)
- SLoopTNR (C4 & inversion symmetric LoopTNR)
- HOTRG (higher order TRG)
- ATRG (anisotropic TRG)
2D square CTM methods
- CTM (Corner Transfer Matrix)
- c4vCTM (c4v symmetric CTM)
- rCTM (reflection symmetric CTM)
- ctm_TRG (Corner Transfer Matrix environment + TRG)
- ctm_HOTRG (Corner Transfer Matrix environment + HOTRG)
2D triangular CTM methods
- c6vCTM_triangular (c6v symmetric CTM on the triangular lattice)
- CTM_triangular (CTM on the triangular lattice)
2D honeycomb CTM methods
- c3vCTM_honeycomb (c3v symmetric CTM on the honeycomb lattice)
2D Impurity Methods
- ImpurityTRG (Expectation value calculation via TRG)
- ImpurityHOTRG (Expectation value calculation via HOTRG)
2D Correlation Methods
- CorrelationHOTRG (Correlation function calculation via HOTRG)
3D cubic tensor networks
- ATRG_3D (anisotropic TRG)
- HOTRG_3D (higher order TRG)
This project is under active development. The interface is subject to changes. Any feedback about the user interface or the internals is much appreciated. The github discussions page is a great place to talk!
- Choose a (TensorKit!) tensor that respects the leg-convention (see below)
- Choose a TNR scheme
- Choose a truncation scheme
- Choose a stopping criterion
For example:
using TNRKit, TensorKit
T = classical_ising(ising_βc) # partition function of classical Ising model at the critical point
scheme = BTRG(T) # Bond-weighted TRG (excellent choice)
data = run!(scheme, truncrank(16), maxiter(25)) # max bond-dimension of 16, for 25 iterationsdata now contains 26 norms of the tensor, 1 for every time the tensor was normalized. (By default there is a normalization step before the first coarse-graining step wich can be turned off by changing the kwarg run!(...; finalize_beginning=false))
Using these norms you could, for example, calculate the free energy of the critical classical Ising model:
f = free_energy(data, ising_βc) # -2.1096504926141826902647832You could even compare to the exact value, as calculated by the Onsager solution:
julia> abs((f - f_onsager) / f_onsager)
3.1e-07Pretty impressive for a calculation that takes about 0.3s on a laptop.
There are 3 levels of verbosity implemented in TNRKit:
- Level 0: no TNRKit messages whatsoever.
- Level 1: Info at beginning and end of the simulations (including information on why the simulation stopped, how long it took and how many iterations were performed).
- Level 2: Level 1 + info at every iteration about the last generated finalize output and the iteration number.
To choose the verbosity level, simply use run!(...; verbosity=n). The default is verbosity=1.
TNRKit includes several common models out of the box.
- Ising model in 2D:
classical_ising(S, β; h=0)whereScan beTrivialorZ2Irrepto specify the symmetry. - Ising model in 2D with impurities:
classical_ising_impurity(β; h=0). - Ising model in 3D:
classical_ising_3D(S, β; h=0)whereScan beTrivialorZ2Irrepto specify the symmetry. - Potts model in 2D:
classical_potts(S, q, β), whereScan beTrivialorZNIrrep{q}to specify the symmetry. - Potts model in 2D with impurities:
classical_potts_impurity(q, β). - Six Vertex model:
sixvertex(S, elt; a=1.0, b=1.0, c=1.0)whereScan beTrivial,U1IrreporCU1Irrepto specify the symmetry andeltcan be any number type (default isFloat64). - Clock model:
classical_clock(S, q, β)whereScan beTrivialorZNIrrep{q}to specify the symmetry. - XY model in 2D:
classical_XY(S, β, charge_trunc)whereScan beU1IrreporCU1Irrepto specify the symmetry. - Real
$\phi^4$ model:phi4_real(S, K, μ0, λ, h)whereScan beTrivialorZ2Irrepto specify the symmetry. - Real
$\phi^4$ model with impurities:phi4_real_imp1(S, K, μ0, λ, h)andphi4_real_imp2(S, K, μ0, λ, h)whereScan beTrivial. - Complex
$\phi^4$ model:phi4_complex(S, K, μ0, λ)whereScan beTrivial,Z2Irrep ⊠ Z2IrreporU1Irrepto specify the symmetry. - Gross-Neveu model:
gross_neveu_start(S, μ, m, g)whereScan beFermionParityto specify the symmetry.
TNRKit includes several common models out of the box.
- Ising model:
classical_ising_triangular(S, β; h=0)whereScan beTrivialorZ2Irrepto specify the symmetry.
TNRKit includes several common models out of the box.
- Ising model:
classical_ising_honeycomb(S, β; h=0)whereScan beTrivialorZ2Irrepto specify the symmetry.