RoyElkabetz / Tensor-Networks-Simple-Update

This repo contains an implementation of the Simple-Update Tensor Network algorithm as described in the paper - A universal tensor network algorithm for any infinite lattice by Saeed S. Jahromi and Roman Orus.
MIT License
8 stars 3 forks source link

Create `get_tensor_network_state` function #4

Closed RoyElkabetz closed 2 months ago

RoyElkabetz commented 3 months ago

Description

Currently, a TensorNetwork object refers to a list of tensors together with a list of weights corresponding to the weight vectors (or diagonal matrices) for every edge in the tensor network. However, when we think of the tensor network as a state, having only a tensor list without a weight list is more intuitive.

Therefore, this issue aims to create a method/function/class that holds the tensor networks state. A way to get the state from the tensor networks would be to absorb all the weight vectors into the tensors in the tensor networks. One way to do that would be to replace each weight vector for each edge with two sqrt weight vectors and then absorb a sqrt weight vector to every neighbor tensor (two for every edge). That way, we end up with a tensor network state with only tensors, and all of its weights have been absorbed by all the tensors (which is precisely what we want).

There are a few ways to implement that in the package.

  1. The simplest one would be to create a function under the SimpleUpdate class that is called SimpleUpdate.get_tensor_network_state(), for example (a different name that makes sense is also acceptable, that would execute the SimpleUpdate.abbsorb_all_weights() function and then returns a copy of the tensors list with a copy of the structure matrix. However, using that method, we cannot return from a state to a tensor network.
  2. Another way would be to try to attack that from the TensorNetwork class side by adding a tensor_state field (or a different name) that would hold a list of tensors that corresponds to the state alongside the original list of tensors and the list of weights. That way, we still "live" under the TensorNetwork class object, which could allow us to use functionalities reserved for the TensorNetwork class, such as drawing the tensor network (or other things). For that approach, one would have to copy some of the weight absorption from the SimpleUpdate class into the TensorNetwork class or move those functionalities from the SimpleUpdate class into a tensor network utility module that both classes could use.

Acceptance criteria

NGBigField commented 3 months ago

Another potential method where returning the state might be expected, is the run() method. Currently run() returns None, but the user might expect some result out of this method, be it the energy of the ground-state or the state itself. Once a SimpleUpdate.get_tensor_network_state() method is added, it's worth considering calling it at the end of SimpleUpdate.run() and returning its result as an output.

RoyElkabetz commented 2 months ago

Thank you @NGBigField ! Awesome job!