A research project implementing HOTRG (Higher-Order Tensor Renormalization Group) simulations using the Cytnx library.
-
Operating System: Linux or Windows Subsystem for Linux 2 (WSL2).
-
WSL2 Installation Guide:
Official Microsoft WSL2 Instruction
You can download the installer from the Anaconda Archive.
Or use the following command line:
curl -O https://repo.anaconda.com/archive/Anaconda3-2025.12-2-Linux-x86_64.shInstall Anaconda:
bash ~/Anaconda3-2025.12-2-Linux-x86_64.shCreate a dedicated Conda environment build Cytnx from source.
conda config --add channels conda-forge
conda create --name cytnx python=3.9 _openmp_mutex=*=*_llvm
conda activate cytnx
conda upgrade --allconda install cmake make boost libboost git compilers numpy openblas pybind11 beartype boost-cpp arpackgit clone https://github.com/cytnx-dev/cytnx.git
cd cytnx
mkdir build
cd buildConfigure (Replace /home/chansh/cytnx_install with your desired path):
cmake .. -DCMAKE_INSTALL_PREFIX=/home/chansh/cytnx_installCompile and install:
make -j$(nproc)
make installPath Setup
To use the compiled library in Python, add the installation path manually.
Quick Start (In-script)
Add the following snippet at the beginning of your Python files (make sure this path is correctly modified in all_fn.py):
import sys
# Update this path to where you installed Cytnx
sys.path.insert(0, "/home/chansh/cytnx_install")
import cytnx as cy
print(cy.__version__)model_name
Defines the physical model
- 2D XY model,
model_name = "2D_M={}_XY"Replace {} with the Fourier cutoff value
- 2D clock model:
model_name = "2D_q={}_clock"Replace {} with the q-value.
symm
Boolean. Whether to preserve the symmetric block structure of tensors.
dcut
The bond-dimension cutoff used in HOTRG.
Lmax
Upper limit of system size
unit_size
Controls the initial size of the system before applying HOTRG.
The elementary tensor unit_size * unit_size.
For example, when unit_size=3, we produces an effective tensor
┏━┷━┓ ┏━┷━┓ ┏━┷━┓
─┨ T ┠─┨ T ┠─┨ T ┠─
┗━┯━┛ ┗━┯━┛ ┗━┯━┛
┏━┷━┓ ┏━┷━┓ ┏━┷━┓ ┏━━━┷━━━┓
─┨ T ┠─┨ T ┠─┨ T ┠─ = ─┨ T_3x3 ┠─
┗━┯━┛ ┗━┯━┛ ┗━┯━┛ ┗━━━┯━━━┛
┏━┷━┓ ┏━┷━┓ ┏━┷━┓
─┨ T ┠─┨ T ┠─┨ T ┠─
┗━┯━┛ ┗━┯━┛ ┗━┯━┛
After N steps HOTRG, the system size becomes
iteration
The label of temperature list Ts_tot.
iT
Index of temperature T within temperature list Ts_tot.
iL
Index of size L within size list Ls_tot.
n
Stacking number used to constructed transfer matrix TM
The transfer matrix is built by tracing all vertical bonds using n copies of
Example: Transfer matrix (PBC) with n=3
┌───┐
┏━┷━┓ │
1───┨ T ┠─│──101
┗━┯━┛ │ ┏━━╳━┓
┏━┷━┓ │ 1─┨ ┠─101
2───┨ T ┠─│──102 = 2─┨ TM ┠─102
┗━┯━┛ │ 3─┨ ┠─103
┏━┷━┓ │ ┗━━━━┛
3───┨ T ┠─│──103
┗━┯━┛ │
└───┘
num_collect
Maximum number of eigenvalues to compute.
hermitian
Boolean. Whether to perform Hermitian diagonalization.