issp-center-dev / tenes Goto Github PK
View Code? Open in Web Editor NEWMassively parallel tensor network solver
Home Page: http://www.pasums.issp.u-tokyo.ac.jp/tenes/en
License: GNU General Public License v3.0
Massively parallel tensor network solver
Home Page: http://www.pasums.issp.u-tokyo.ac.jp/tenes/en
License: GNU General Public License v3.0
Hi everyone,
I have a question about the norm of an iTPS.
I try to consider a 2D square lattice with size
where the quantum state is described by a infinite-size translation-invariant iTPS
To make my question clear,
I have found a figure in the "TeNeS-master/docs/sphinx/img" directory and I have attached it as follows.
It is expected that the norm can be expressed as
where
My question is how to figure out this coefficient
In file "01_transverse_field_ising/output/onesite_obs.dat",
it reads
The meaning of each column is the following:
$1: op_group
$2: site_index
$3: real
$4: imag
The names of op_group are the following:
0: Sz
1: Sx
-1: norm
0 0 1.43822572220935002e-01 0.00000000000000000e+00
0 1 1.43822567502205789e-01 0.00000000000000000e+00
0 2 1.43822577490189368e-01 0.00000000000000000e+00
0 3 1.43822572827914413e-01 0.00000000000000000e+00
1 0 4.51957838213799423e-01 0.00000000000000000e+00
1 1 4.51957837144178809e-01 0.00000000000000000e+00
1 2 4.51957758107002339e-01 0.00000000000000000e+00
1 3 4.51957756949986855e-01 0.00000000000000000e+00
-1 0 8.02176941013978739e-01 0.00000000000000000e+00
-1 1 8.02176538960576391e-01 0.00000000000000000e+00
-1 2 8.02178199879971077e-01 0.00000000000000000e+00
-1 3 8.02177795112917202e-01 0.00000000000000000e+00
For the last four lines, the number "8.02e-01" seems to be obtained
by simple contracting the corner transfer matrices and the edge tensors in Fig. (c),
and its role seems to be the norm of the reduced density matrices for the local
Thus, my question is that,
is it possible to figure out the coefficient
I guess
but I am not sure about the details.
Any suggestion or comment would be greatly appreciated.
I played with the tutorials and found out that you could save the resulting tensors by modifying the parameter.general.tensor_save.
The saved data seems to be the combinations of dtype, indices, and bin files, which I found difficult to interpret.
Is it possible to convert it to dat/txt file so that I can analyze it with other languages( like Python or Julia)?
I am sorry if it is written in the document already.
Thanks!
It is a very nice package that can help to calculate the many-body systems. I tested the triangular lattice antiferromagnetism Heisenberg model for bond dimension D=2,3 but it didn't work well. The spin-spin correlations don't distribute evenly so the state doesn't like a Neel state. I'm not sure if I had some mistakes in operation or there is an intrinsic bias when mapping triangular lattices to square lattice tensor networks.
In principle, we can get a precise PESS state for the triangular lattice model and map it to square lattice PEPS by contracting some indices. So the square lattice PEPS is an adequate ansatz for the triangular AFM Heisenberg model.
I want to ask if you meet the same question when tested. if so, the square lattice PEPS full update may not a good scheme to optimize triangular ground states.
The version I used is [ver. 1.0-beta: 2020/03/30]. Two of the input/output files are attached (I renamed the filename suffixes). By the way, does increasing the bond dimension work?
Dear TeNeS developers,
Firstly, I would like to thank you for including the samples 02_time_evolution and 03_finite_temperature in the TeNeS package. I recently reinstalled TeNeS, and I am pleased to report that currently all components work normally.
However, I have encountered a query while exploring the dependencies in the sample 03_finite_temperature. Specifically, I am uncertain about how to adjust the temperature and field intervals for this sample. In the QMC folder, I observed default intervals of 0.05 < T < 10
for specific heat in files like init_params.py, and in created files magnetization_weak.dat, magnetization_middle.dat, magnetization_strong.dat I found that interval 0.0 < T < 5
is considered.
Could you kindly guide me on how to modify these intervals in sample 03_finite_temperature? While I could easily make such changes in the tutorial_magnetization.py file of sample 04_magnetization, I am unsure about the procedure for sample 03_finite_temperature.
Additionally, in the sample FT_Kitaev, I noticed the consideration of 2S=1
in the stan_gapfull.in file. Has the new version incorporated the conserved quantum number (or conserved Sz total)? I would greatly appreciate any assistance or clarification on this matter.
Thank you for your time and support.
Dear TeNeS group,
Does the TeNeS support quantum many-body systems out of equilibrium?
For example, I aim to investigate the ground-state phase diagram and thermodynamics of a 2D spin lattice out of equilibrium.
Can I do that by employing TeNeS?
Is it true that TeNeS currently doesn't support evaluation of operators such as S_1 S_2 .... S_N for arbitrary N, where S is S^z?
I ask because the multisite observables documentation specifies that all sites must be in a 4x4 square.
Dear NeNeS establishers,
During introducing my own lattice in tenes_simple file I got some errors in tenes_std lines. Please let me know where is the problem and how can I fix this problem.
My own lattice structure is as below figure:
The code that I reformed in tenes_simple file is as following:
class KagomeLattice(Lattice):
def __init__(self, param: Dict[str, Any]):
super().__init__(param)
self.type = "kagome lattice"
self.z = 3
self.L *= 2
self.W *= 2
L, W = self.L, self.W
self.latticevector = np.array([[1.0, 0.0], [0.5, np.sqrt(3.0) / 2]])
self.latticevector *= np.array([[L], [W]])
a0 = np.array([1.0, 0.0])
a1 = np.array([0.5, np.sqrt(3.0) / 2])
vd = self.vdim
self.sublattice.append(SubLattice([1, vd, vd, 1]))
self.sublattice.append(SubLattice([1, 1, vd, vd]))
self.sublattice.append(SubLattice([vd, 1, 1, vd]))
self.sublattice.append(SubLattice([vd, vd, 1, 1]))
# Martini lattice 1:
for index in range(L * W):
x, y = index2coord(index, L)
if x % 2 == 0 and y % 2 == 0:
#
# sublattice A
#
self.sublattice[0].add_site(index)
self.coords.append(a0 * x + a1 * y)
# 1st neighbors
self.bonds[0][0].append(Bond(index, 1, 0))
self.bonds[0][0].append(Bond(index, 0, 1))
elif x % 2 == 1 and y % 2 == 0:
#
# sublattice B
#
self.sublattice[1].add_site(index)
self.coords.append(a0 * x + a1 * y)
# 1st neighbors
self.bonds[0][1].append(Bond(index, 0, 1))
self.bonds[0][0].append(Bond(index, -1, 1))
elif x % 2 == 0 and y % 2 == 1:
#
# sublattice C
#
self.sublattice[2].add_site(index)
self.coords.append(a0 * x + a1 * y)
# 1st neighbors
self.bonds[0][1].append(Bond(index, -1, 0))
elif x % 2 == 1 and y % 2 == 1:
#
# sublattice D
#
self.sublattice[3].add_site(index)
self.coords.append(a0 * x + a1 * y)
# 1st neighbors
self.bonds[0][1].append(Bond(index, 1, 1))
def cartesian_coordinate(self, x: int, y: int) -> np.ndarray:
a0 = np.array([1.0, 0.0])
a1 = np.array([0.5, np.sqrt(3.0) / 2])
return a0 * x + a1 * y
In fact, when I consider following sequence for virtual_dim in Sublattices (full connection) everything works normally and I could calculate the magnetization,
self.sublattice.append(SubLattice([vd, vd, vd, vd]))
self.sublattice.append(SubLattice([vd, vd, vd, vd]))
self.sublattice.append(SubLattice([vd, vd, vd, vd]))
self.sublattice.append(SubLattice([vd, vd, vd, vd]))
But my own lattice has just three connections which two of them are counted as virtual_dim. So, I considered below sequence for the virtual_dim of Sublattices:
self.sublattice.append(SubLattice([1, vd, vd, 1]))
self.sublattice.append(SubLattice([1, 1, vd, vd]))
self.sublattice.append(SubLattice([vd, 1, 1, vd]))
self.sublattice.append(SubLattice([vd, vd, 1, 1]))
and I got following error:
martini2.py > output.dat
Traceback (most recent call last):
File "/home/arian/bin/tenes_std", line 903, in <module>
model = Model(param)
File "/home/arian/bin/tenes_std", line 726, in __init__
self.unitcell = Unitcell(param["tensor"])
File "/home/arian/bin/tenes_std", line 218, in __init__
self.load_dict(lat_dict)
File "/home/arian/bin/tenes_std", line 239, in load_dict
self.check()
File "/home/arian/bin/tenes_std", line 360, in check
raise RuntimeError(msg)
RuntimeError: ERROR: some sites have problems
[INPUT ERROR]
ERROR: cannot find the input file: input_0_500.toml
Traceback (most recent call last):
File "magnetization_martini2.py", line 50, in <module>
with open(join("output_{}_{}".format(idx, num_step), "density.dat")) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'output_0_500/density.dat'`
Hi,
I newly installed last version (v-1.3.3
) of TeNeS. I can run samples code in sample folder of TeNeS.
In previous version (v-1.2
), I introduced my lattice in tenes_simple.py
file and it was working fine with self.z
.
I just copied my lattice code from previous version to the tenes_simple of new version v-1.3.3
and I faced an error after running the code, revealing that self.z
should not be integer.
I found that you replaced self.z
with self.zs
in the lattice parts.
For example for Kagome lattice introduced in the new version, you introduced self.sz
as: self.zs = [[2, 2, 0], [4, 0, 0], [4, 2, 0]]
, while in previous version it was self.z = 4
.
Can you please specify what is the meaning of all elements of 2d array self.zs
, in detail?
For the lattice model shown below:
how the elements of self.zs = [[]]
for above shown lattice should be selected?
I selected them as: self.zs = [[2, 1, 0], [0, 0, 0], [0, 0, 0]]
, is that right?
Thanks!
@yomichi @TsuyoshiOkubo @takeokato719 @k-yoshimi @kwshm
TeNeS 1.1.0 の Debian Package を作成しました。MateriApps LIVE! で
sudo apt-get update
sudo apt-get install tenes
でインストールされます。サンプルファイルは /usr/share/tenes の下にあります。動作確認をお願いできるでしょうか?
03_finite_temperature
calcspec.py
does not calculate specific heat for "zero"
to the for loop at the line 16 as
for name in ("weak", "middle", "strong", "zero"):
develop
branch> v2.0.0
(not yet released)plot_mz.plt
and plot_mx.plt
may fail
set locale "ja_JP.UTF-8"
on line 158 of both files
develop
branch/var/folders/19/kbwltrlx40s0qfrgg0yylhvh0000gn/T//ccYbfuHU.s:13709:2: error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not?
int $3
^
Dear TeNeS establishers,
I would like to simulate the 2D honeycomb lattice with nearest and next-nearest-neighbor interactions J0 and J0'.
I considered the interaction parameters in the basic.toml file as:
[model]
type = "spin"
J0 = 1.0
J0' = 1.0
but I receive below error when I try to run the code:
I considered " J0' " instead of J0' and the code works normally.
Could you please let me know that " J0' " also indicates the next-nearest-neighbor interaction?
Dear TeNeS team,
In my recent TN simulations using TeNeS, I encountered an issue with saving the calculation results in the 'output.dat' file. I'm currently using the command $ python tutorial_magnetization.py > output.dat to save the output. However, despite the file being created, the results are not written into it. Consequently, the calculation process halts, and when I check the 'output.dat' file, I only see the following lines.
Number of Processes: 1
Number of Threads / Process: 16
Tensor type: real
Bond dimensions:
D (Bulk): 2
chi (CTM): 10
Start simple update
after line "Start simple update" there is nothing.
How can I write the results into the output.dat during the calculation time?
I realized that the initialization of tensors generated by tenes_simple probably needs to be corrected for, at least, the S=1 model.
When we set S=1 and
initial = "antiferro"
We see two spin states as the initial state in std.toml created by tense_simple:
initial_state = [1.0, 0.0, 0.0]
initial_state = [0.0, 1.0, 0.0]
Calculating the expectation value for this initial state shows that it is not the expected antiferromagnetic state. Probably, the latter state is |0>. I think the initial_state should be
initial_state = [1.0, 0.0, 0.0]
initial_state = [0.0, 0.0, 1.0]
Dear TeNeS developers,
Recently, I installed new version of TeNeS (v-1.3.3) on my notebook.
When I try to run the sample files for example: tutorial_magnetization.py
in the TeNeS/sample/05-magnetization
folder I get error:
(base) hamid@hamid-ASUS-TUF-Dash-F15-FX517ZM-TUF517ZM:~/TeNeS/sample/05_magnetization$ python tutorial_magnetization.py Calculation Process: 1/21 Steps: 100 tenes: error while loading shared libraries: libmpi.so.12: cannot open shared object file: No such file or directory Traceback (most recent call last): File "/home/hamid/TeNeS/sample/05_magnetization/tutorial_magnetization.py", line 60, in <module> with open(join(output_dir, "density.dat")) as f:
Can you please let me know where is the problem?
I have had previous versions (v-1.2.0 and v-1.3.0) on my notebook they were working normally.
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.
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.
After that I tried to make TeNeS by following command:
$ make install
but I got error (attachment)
Then, I tried
$ sudo make install
and I got following installing explanation:
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
Dear TeNeS group,
I have simulated the magnetization of my favorite 2D spin-1/2 model (below figure) by using TeNeS. I also simulated the same magnetization by using other method that could reproduced nicely the ground-state phase diagram of the model.
By comparing obtained results from the both methods, I found that the TeNeS results do not reproduce the ground-state phase diagram of my model and they are not compatible with that of obtained from the other method.
The model is:
[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
Also, according to your advisement I used the kagome lattice for introducing my model to TeNeS.
I tested both model in below figure:
In fact, I changed the lattice class of kagome lattice in tenes_simple as:
class KagomeLattice(Lattice):
def init(self, param: Dict[str, Any]):
super().init(param)
self.type = "kagome lattice"
self.z = 4
self.L *= 2
self.W *= 2
L, W = self.L, self.W
self.latticevector = np.array([[1.0, 0.0], [0.5, np.sqrt(3.0) / 2]])
self.latticevector *= np.array([[L], [W]])
a0 = np.array([1.0, 0.0])
a1 = np.array([0.5, np.sqrt(3.0) / 2])
vd = self.vdim
self.sublattice.append(SubLattice([vd, vd, vd, vd], is_vacancy=False))
self.sublattice.append(SubLattice([vd, vd, vd, vd], is_vacancy=False))
self.sublattice.append(SubLattice([vd, vd, vd, vd], is_vacancy=False))
self.sublattice.append(SubLattice([vd, vd, vd, vd], is_vacancy=False))
# My favorite lattice:
for index in range(L * W):
x, y = index2coord(index, L)
if x % 2 == 0 and y % 2 == 0:
#
# sublattice A
#
self.sublattice[0].add_site(index)
self.coords.append(a0 * x + a1 * y)
# 1st neighbors
self.bonds[0][0].append(Bond(index, 1, 0))
self.bonds[0][0].append(Bond(index, 0, 1))
# 2nd neighbors
self.bonds[1][0].append(Bond(index, -1, 2))
self.bonds[1][0].append(Bond(index, -2, 1))
# 3rd neighbors
self.bonds[2][0].append(Bond(index, 2, 0))
self.bonds[2][0].append(Bond(index, 0, 2))
self.bonds[2][1].append(Bond(index, -2, 2))
elif x % 2 == 1 and y % 2 == 0:
#
# sublattice B
#
self.sublattice[1].add_site(index)
self.coords.append(a0 * x + a1 * y)
# 1st neighbors
self.bonds[0][1].append(Bond(index, 0, 1))
self.bonds[0][0].append(Bond(index, -1, 1))
# 2nd neighbors
self.bonds[1][0].append(Bond(index, 1, 1))
self.bonds[1][0].append(Bond(index, -1, 2))
# 3rd neighbors
self.bonds[2][0].append(Bond(index, 2, 0))
self.bonds[2][0].append(Bond(index, -2, 2))
self.bonds[2][1].append(Bond(index, 0, 2))
elif x % 2 == 0 and y % 2 == 1:
#
# sublattice C
#
self.sublattice[2].add_site(index)
self.coords.append(a0 * x + a1 * y)
# 1st neighbors
self.bonds[0][1].append(Bond(index, -1, 0))
# self.bonds[0][1].append(Bond(index, -1, 1))
# 2nd neighbors
self.bonds[1][0].append(Bond(index, 1, 1))
self.bonds[1][0].append(Bond(index, -2, 1))
# 3rd neighbors
self.bonds[2][0].append(Bond(index, 0, 2))
self.bonds[2][0].append(Bond(index, -2, 2))
self.bonds[2][1].append(Bond(index, 2, 0))
elif x % 2 == 1 and y % 2 == 1:
#
# sublattice D
#
self.sublattice[3].add_site(index)
self.coords.append(a0 * x + a1 * y)
# 1st neighbors
# self.bonds[0][1].append(Bond(index, 1, 0))
self.bonds[0][1].append(Bond(index, 1, 1))
# 2nd neighbors
self.bonds[1][0].append(Bond(index, 1, 1))
self.bonds[1][0].append(Bond(index, -2, 1))
# 3rd neighbors
self.bonds[2][0].append(Bond(index, 0, 2))
self.bonds[2][0].append(Bond(index, -2, 2))
self.bonds[2][1].append(Bond(index, 2, 0))
The results obtained from TeNeS simulations for J = 1 (and Delta = 1) is as following figure for 16 sites (also for 24 sites is very similar):
While the results obtained from other method is as:
in which magnetization jumps and plateaus of total magnetization m_T (black curves) occur at different magnetic fields and different incommensurate values M/M_s.
I would be thankful to you if help me to fix this problem.
All the best,
Hi,
Thank you for developping this valuable software.
I am trying to export the converged iTPS (iPEPS) wave function and use it in matlab for my project.
However, I have faced a problem about understanding the network structure of the iTPS (iPEPS) used in TeNeS.
In the original CTM method with 2x2 unit-cells to simulating the infinite-size transverse-field Ising square,
the network structure can be expressed in the form of :
C1 E1 E2 C2
E8 Ta Tb E3
E7 Ta Tb E4
C1 E6 E5 C2
where the four C tensors are the Corner TMs, Ta and Tb are the core tensors, and the eight E tensors are the edge tensors.
I have tried the "sample/01_transverse_field_Ising" tutorial with the default settings (that is, L=2 and W=2)
and saved the corresponding tensors in a directory "tensor".
Then in this directory I find many tensors.
(1) for the CTMs I find
C1_0.dat C1_2.dat C2_0.dat C2_2.dat C3_0.dat C3_2.dat C4_0.dat C4_2.dat
C1_1.dat C1_3.dat C2_1.dat C2_3.dat C3_1.dat C3_3.dat C4_1.dat C4_3.dat
(2) For the edge tensors I find
Eb_0.dat Eb_2.dat El_0.dat El_2.dat Er_0.dat Er_2.dat Et_0.dat Et_2.dat
Eb_1.dat Eb_3.dat El_1.dat El_3.dat Er_1.dat Er_3.dat Et_1.dat Et_3.dat
(3) For the core tensors I find
T_0.dat T_1.dat T_2.dat T_3.dat
Since the unit cell is with size 2x2,
these 4 core-tensors in (3) seems quite reasonable.
However, for the CTMs in (1) and the edge tensors in (2),
there seem to be too many enviroment tensors,
and it becomes difficult for me to figure out their meanings.
Therefore, my main question is that,
why are so many local tensors in the converged iTPS for "sample/01_transverse_field_Ising" tutorial?
What is the network structure connecting these local tensors?
Thank you.
In my original post, I have a second question:
>My second question is about the reading of these tensors.
>For the core tensors T_0, T_1, T_2 and T_3,
>I have succefully read their data and everything seems to be ok.
>However, for the CTMs C and the edge tensors E,
>I find all the elements are just 0.
>Would TeNeS just clear all the enviroment tensors (E and C) and just save the core tensors T?
>Is there some method to export these enviroment tensors?
I find that this question can be solved
by adding several steps of "Full update" in the input files.
(By reading simple_update.cpp,
I find that when just using "Simple update", the enviroment tensors E and C are not explicitly accessable.)
Dear developers and users,
Is there some methods to solve this error?
Any suggestions would greatly helpful.
Dear TeNeS support team,
I am investigating the zero-temperature magnetization of a 2D triangle-hexagon lattice in the presence of an external magnetic field. In my previous discussion, you mentioned that I can consider infinite-size lattice. Can you please specify that how can I introduce infinite-size lattice for the tenes?
In the basic.toml I consider parameters as following:
[parameter]
[parameter.general]
is_real = true
[parameter.simple_update]
num_step = 1000
tau = 0.01
[parameter.full_update]
num_step = 0
tau = 0.01
[parameter.ctm]
iteration_max = 200
dimension = 10
[lattice]
type = "kagome lattice"
L = 3
W = 3
virtual_dim = 2
initial = "random"
[model]
type = "spin"
J0 = 0.5
J1x = 1
J1y = 1
J1z = 1
where L and W are finite and give a lattice with 36 number of spins.
Thanks!
The document says Ham = ... + D (S^z)^2
, but tenes_simple
indeed treats Ham = ... - D (S^z)^2
.
Old Intel MKL libraries include some bugs for treating complex values, although all tests for the scalapck library can pass.
Thus, TeNeS test fails at AF_HFM_complex. It is better to recompile the lapack and blas libraries without the MKL libraries.
Then,
modify TeNeS/CMakefile.txt
find_package(ScaLAPACK REQUIRED)
string(REGEX REPLACE ";" " " SCALAPACK_LIBS "${SCALAPACK_LIBRARIES}")
->
find_package(ScaLAPACK REQUIRED)
string(REGEX REPLACE ";" " " SCALAPACK_LIBS "${SCALAPACK_LIBRARIES}")
set(SCALAPACK_LIBS ${SCALAPACK_LIBRARIES})
and add -DSCALAPACK_LIBRARIES="-L/ -lscalapack [-lgfortran -lifcore]", when you execute cmake.
Please use positive skew.
This bug is fixed in the develop branch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.