issp-center-dev / TeNeS

Massively parallel tensor network solver
http://www.pasums.issp.u-tokyo.ac.jp/tenes/en
GNU General Public License v3.0
46 stars 11 forks source link

Installing TeNeS / user-defined model & lattice #43

Closed HamidArianZad closed 1 year ago

HamidArianZad commented 2 years ago

Dear TeNeS team,

I installed TeNeS on ubuntu 16.04. I installed c++11 compiler and Cmake 3.12 I install numpy and other packages of python3 including toml

First, I could not install the TeNeS in build folder. I followed below steps.

  1. $ git clone https://github.com/issp-center-dev/TeNeS
  2. $ mkdir build
  3. $ cd build
  4. $ cmake -DCMAKE_INSTALL_PREFIX=/usr/azam .. Then I got the below error: CMake Error: The source directory "/home/azam" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.

But I moved the folder build to TeNeS folder and run: cd TeNeS cd build $ cmake -DCMAKE_INSTALL_PREFIX=/usr/azam .. Then I got attached building confirmation. TeNeS_1

After that I tried to make TeNeS by following command: $ make install but I got error (attachment) TeNeS2

Then, I tried $ sudo make install and I got following installing explanation: TeNeS3

Next, I tried to run: python3 tutorial_magnetization.py I got error: python3 can't open file 'tutorial_magnetization.py': [Error 2] No such file or directory I receive the same error when I run other tutorials.

I do not know what is the problem. I will be very thankful to you if help me to solve that.

Thank you Hamid

k-yoshimi commented 2 years ago

@HamidArianZad This command error appears to be caused by the fact that the python command is not running in the directory TeNeS/sample/05_magnetization where tutorial_magnetization.py is located. If you did not move to the directory, please change the directory and run the command again.

HamidArianZad commented 2 years ago

@HamidArianZad This command error appears to be caused by the fact that the python command is not running in the directory TeNeS/sample/05_magnetization where tutorial_magnetization.py is located. If you did not move to the directory, please change the directory and run the command again.

Dear yoshimi, Thank you very much. I could run the codes and plot the magnetization for various models. I have a query and I will be thankful to you if answer. QUERY: I want to simulate the magnetization of an Ising triangular lattice including two-body and three-body interactions that is in the presence of an external magnetic field H. Does the TeNeS support such a calculation? Should I introduce my own lattice manually by changing fome lines of the tenes_simple.py and tenes_std.py files? The Hamiltonian of my favorite model is presented in attachment. Hamiltonian

yomichi commented 2 years ago

@HamidArianZad Please make a new issue for another problem/question

HamidArianZad commented 2 years ago

Hi I want to simulate the magnetization of an Ising triangular lattice including two-body and three-body interactions that is in the presence of an external magnetic field H. Does the TeNeS support such a calculation? Should I introduce my own lattice manually by changing fome lines of the tenes_simple.py and tenes_std.py files? The Hamiltonian of my favorite model is presented in attachment. Hamiltonian

yomichi commented 2 years ago

This Hamiltonian looks like a classical Ising model, doesn't it? If so, it may be better to use another software package (but I'm sorry I don't know a suitable program)

Anyway, TeNeS potentially can treat three or more body systems. TeNeS accepts the series of imaginary-time evolutional tensors on nearest-neighbor bonds of the square lattice as the input. We can always split the imaginary-time evolutional tensor U = exp(-tau Si Sj Sk) into the series of two-body imaginary-time evolutionally tensors acting on nearest-neighbor bond on the square lattice as U = U1 ... Un by using some tensor decomposition technique such as SVD. Indeed, TeNeS treats a nearest-neighbor model on a triangular lattice as a long-ranged model on a square lattice, by inserting an identity operator acting on middle sites.

For the current version of TeNeS, unfortunately, we cannot specify the multi-site operators such as SiSjSk for calculating the expectation value, and hence we can search for the ground state of the three-body system but cannot evaluate the energy.

HamidArianZad commented 2 years ago

This Hamiltonian looks like a classical Ising model, doesn't it? If so, it may be better to use another software package (but I'm sorry I don't know a suitable program)

Anyway, TeNeS potentially can treat three or more body systems. TeNeS accepts the series of imaginary-time evolutional tensors on nearest-neighbor bonds of the square lattice as the input. We can always split the imaginary-time evolutional tensor U = exp(-tau Si Sj Sk) into the series of two-body imaginary-time evolutionally tensors acting on nearest-neighbor bond on the square lattice as U = U1 ... Un by using some tensor decomposition technique such as SVD. Indeed, TeNeS treats a nearest-neighbor model on a triangular lattice as a long-ranged model on a square lattice, by inserting an identity operator acting on middle sites.

For the current version of TeNeS, unfortunately, we cannot specify the multi-site operators such as SiSjSk for calculating the expectation value, and hence we can search for the ground state of the three-body system but cannot evaluate the energy.

yomichi commented 2 years ago

You can define this lattice model by using standard mode (tenes_std). https://issp-center-dev.github.io/TeNeS/manual/master/en/html/file_specification/standard_format.html

tensor section defines sites (shape of the unitcell, dimension of virtual bonds, ...), and hamiltonian section defines bonds (and bond hamiltonians acting on these bonds)

A kagome lattice may be helpful example for making a new lattice. https://issp-center-dev.github.io/TeNeS/manual/master/en/html/file_specification/simple_format.html 2x2x3 sites kagome lattice is represented on the square lattice as Fig. 5.4 (e).

To see the sample standard mode's input file representing kagome lattice, save the following as simple.toml

[parameter]
[parameter.general]

[parameter.simple_update]
num_step = 1000
tau = 0.01

[parameter.full_update]
num_step = 0
tau = 0.01

[lattice]
type = "kagome lattice"
L = 2
W = 2
initial = "ferro"
virtual_dim = 2

[model]
type = "spin"
J = 1.0

and pass it to tenes_simple to generate std.toml (an input file of tenes_std).