Closed RoyElkabetz closed 2 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.
Thank you @NGBigField ! Awesome job!
Description
Currently, a
TensorNetwork
object refers to a list oftensors
together with a list ofweights
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 twosqrt
weight vectors and then absorb asqrt
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.
SimpleUpdate
class that is calledSimpleUpdate.get_tensor_network_state()
, for example (a different name that makes sense is also acceptable, that would execute theSimpleUpdate.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.TensorNetwork
class side by adding atensor_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 theTensorNetwork
class object, which could allow us to use functionalities reserved for theTensorNetwork
class, such as drawing the tensor network (or other things). For that approach, one would have to copy some of the weight absorption from theSimpleUpdate
class into theTensorNetwork
class or move those functionalities from theSimpleUpdate
class into a tensor network utility module that both classes could use.Acceptance criteria