-
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
replace(!)(::Chain, tensor => newtensor) only works for tensors of the same size #191
Comments
This is currently intentional: Indices should have the same size on replacement. But you could try using @unsafe_region psi begin
# put here your replacements
end |
oki, that kind of works: it does the substitution, but still prints an error - this could be misleading, I'd probably remove that..
By the way, there's an even more worrying behavior of replace!: in case of error without unsafe_region, it doesn't add the new tensor but it seems that it does delete the old one, seems quite dangerous...
|
About the first error, it fails because The second error is normal, because what you made in |
No, what I'm saying in the second comment is happening without unsafe_region, the replace method is throwing an error but still doing something destructive (which is not what I would naively expect, it should throw an error and do nothing):
see what I mean ? |
Ahh okay. That's clearly a bug. |
Is this intentional? in principle in a sweep we might want to update MPS tensors on the fly with inconsistent indices.
Or am I doing it wrong?
MWE
but
The text was updated successfully, but these errors were encountered: