bsc-quantic / Tenet.jl

Composable Tensor Network library in Julia
https://bsc-quantic.github.io/Tenet.jl/
Apache License 2.0
17 stars 1 forks source link

Define canonize-form "semantics" and add verifiers for `Chain` ansatz #166

Open mofeing opened 5 months ago

mofeing commented 5 months ago

I propose that whenever there is a virtual hyperindex connected to a vector, then we can assume that the TN is in some canonical-form. This condition eases implementation of many methods that require canonical-form or that work with it.

Whether that canonical-form is correctly formatted should be queried by some verifiers, that numerically check it out. Users should have no direct access to modify this hyperindices within the public API to avoid problems.

This issue addresses that we should (1) discuss if this is the correct way to go and (2) document it.

jofrevalles commented 5 months ago

I propose that whenever there is a virtual hyperindex connected to a vector, then we can assume that the TN is in some canonical-form. This condition eases implementation of many methods that require canonical-form or that work with it.

I think this could be restrictive. There are some situations where we have a Chain without any vector connected to it (no Schmidt values there) and the tensors are all in left-canonical or right-canonical form, and we should account for this case too.

Also, in some cases (like in many quantum-chemistry algorithms) it is important to have the MPS in a certain canonical form but also have all the singular values stored in some way. This eases the computation since the singular values are used to compute certain quantities, but the network can be kept untouched.

In TeNPy, I recall that they have some arguments in the tensors that store the canonical form of them. Also, instead of accessing to tensors with tensors(chain, site), they have the method get_A(chain, site) (get_B(chain, site)) to get the tensor in the left(right)-canonical form directly.