-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relax push!
constrains under specific conditions
#147
Comments
Allowing users to push tensors with different index sizes is something that scares me due to the possibility of introducing subtle and difficult to track bugs. But I completely agree that this makes some code super cumbersome. My idea for this is that we could allow this but through a higher-level interface such that Tenet still checks the dimensions but (and this is the key) after a wrapped region (and not on each Here is a prototype code: Tenet.@unsafe_region tn begin
# here go the push!, pop!, replace!, ...
...
end When this block of code finishes, Tenet will check if the index dimensions remain consistent and throw an error if not. |
I like this idea! |
Implemented in #149 |
Summary
A common procedure in Tensor Networks is replacing some given tensors with new ones. For example, we may have an mps and evolve it with some operator to obtain new tensors, which share the same indices but change their size. The way to do this in now
Tenet
I believe is quite cumbersome, and could be improved if we relaxed the conditions inpush!
. Currently,Tenet
checks that the new pushed tensor does match in size for all their indices. This can be a problem if we wanted to update a tensorT
that has increased in bond dimension, but we still have not computed its neighbor tensor that shares indices with.My suggestion is that we can put a keyword argument in
replace!
that relaxes the mentioned constrains inpush!
.The text was updated successfully, but these errors were encountered: