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
49 stars 11 forks source link

What is the network structure connecting the local tensors of the iTPS in TeNeS ? #89

Closed sunzhaoyu2000 closed 8 months ago

sunzhaoyu2000 commented 8 months ago

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.)
sunzhaoyu2000 commented 8 months ago

I have read “twosite_obs.cpp”, and I find that it is still not easy to capture its network structure. I consider an iTPS with 2x2 unit cells:

T_2 T_3 T_0 T_1

Suppose I want to calculat the average value of a four-site operator O = O_0 O_1 O_2 * O_3 in my project,

O_2 O_3 O_0 O_1 In the network structure of <iTPS|O|iTPS>, which four CTMs should I use (I have found totally 16 CTMs in the tensor directory)? and which eight edge tensors should I use (I have also found totally 16 edge tensors E in the tensor directory)? Moreover, where shall I place the lambda tensors in network structure of <iTPS|O|iTPS>?

Once this network structure is clear, using the converged iTPS (and all the output tensors) in other projects would become greatly conveniont.

Any suggestion would be greatly appreciated.

Thank you again !

yomichi commented 8 months ago

TeNeS calculates CTMs for each single bulk tensor. For example, T_0 (the bulk tensor on site 0) is surrounded by CTMs as follows:

C1_0 Et_0 C2_0
El_0  T_0 Er_0
C4_0 Eb_0 C3_0

Another bulk tensor, say, T_1, has the corresponding CTMs in the same way:

C1_1 Et_1 C2_1
El_1  T_1 Er_1
C4_1 Eb_1 C3_1

This setup enables us to contract tensors on a rectangle with arbitrary shape (if we have enough computational resources, of course), for example (assume the 2x2 unit cell here):

(contract 1x2 sites)

C1_0 Et_0 Et_1 C2_1
El_0  T_0  T_1 Er_1
C4_0 Eb_0 Eb_1 C3_1
(contract 2x2 sites)

C1_2 Et_2 Et_3 C2_1
El_2  T_2  T_3 Er_3
El_0  T_0  T_1 Er_1
C4_0 Eb_0 Eb_1 C3_1
(contract 1x3 sites!)

C1_0 Et_0 Et_1 Et_0 C2_0
El_0  T_0  T_1  T_0 Er_0
C4_0 Eb_0 Eb_1 Eb_0 C3_0
sunzhaoyu2000 commented 8 months ago

TeNeS calculates CTMs for each single bulk tensor. For example, T_0 (the bulk tensor on site 0) is surrounded by CTMs as follows:

C1_0 Et_0 C2_0
El_0  T_0 Er_0
C4_0 Eb_0 C3_0

Another bulk tensor, say, T_1, has the corresponding CTMs in the same way:

C1_1 Et_1 C2_1
El_1  T_1 Er_1
C4_1 Eb_1 C3_1

This setup enables us to contract tensors on a rectangle with arbitrary shape (if we have enough computational resources, of course), for example (assume the 2x2 unit cell here):

(contract 1x2 sites)

C1_0 Et_0 Et_1 C2_1
El_0  T_0  T_1 Er_1
C4_0 Eb_0 Eb_1 C3_1
(contract 2x2 sites)

C1_2 Et_2 Et_3 C2_1
El_2  T_2  T_3 Er_3
El_0  T_0  T_1 Er_1
C4_0 Eb_0 Eb_1 C3_1
(contract 1x3 sites!)

C1_0 Et_0 Et_1 Et_0 C2_0
El_0  T_0  T_1  T_0 Er_0
C4_0 Eb_0 Eb_1 Eb_0 C3_0

Thank you ! This is just what I need. Thank you again !

sunzhaoyu2000 commented 8 months ago

Dear professors and developers,

Now I have converted the iTPS into matlab, and try to reproduce <iTPS|Sz|iTPS> in output/onesite_obs.dat. I found my result is wrong, so I may still have some misunderstanding about the storage of iTPS.

I have read the answers about the storage of the output iTPS tensors in previous Issues. However, I still have a minor question described as follows.

Again I consider an iTPS with 2x2 unit cells given by

T_2 T_3 T_0 T_1

By reading the source code, I have found that the storage of these bulk tensors should be in the form of

T_0(i_left, i_top, i_right, i_down, i_phys).

For the output tensors, their axes_maps turn out to be

T_0: asex_map= 0 1 2 4 3 T_1: asex_map= 0 1 2 4 3 T_2: asex_map= 3 0 2 4 1 T_3: asex_map= 3 0 2 4 1

Therefore, my question is that:

(1) Are the output tensors already in the standard form of

T_0(i_left, i_top, i_right, i_down, i_phys)?

Or (2)on the contrary, in order to re-construct into the standard form T_0(i_left, i_top, i_right, i_down, i_phys), it is necessary to transpose these tensors by hand, such as by the following method ?

T_0.transpose( T_0.get_axes_map( ) ); T_1.transpose( T_1.get_axes_map( ) ); T_2.transpose( T_2.get_axes_map( ) ); T_3.transpose( T_3.get_axes_map( ) );

Thank you very much for your patience.

sunzhaoyu2000 commented 8 months ago

I have checked that the output tensors T_0 T_1 T_2 T_3 for 2x2 iTPS are already in the standard form

T_0(i_left, i_top, i_right, i_down, i_phys).

Thank you :)