Closed mofeing closed 4 hours 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.
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.