-
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
Enhance replace!(tn::TensorNetwork, ...)
function for more flexible Tensor
replacements
#56
Comments
Marked with the "on hold" label, since we are waiting for the new refactor to be merged |
#55 includes a new |
We could now enhance the |
Update: this can be already implemented |
But we haven't discussed the semantics yet... I have concerns on adding new labels not in the Tensor Network (or renaming) or resizing an index from a If you suggest some coherent semantics, I will consider them. |
@jofrevalles I think we can close this since we now have |
Yes! |
Summary
Currently, the
replace!
function can replace aTensor
within aTensorNetwork
but only under the condition that the newTensor
has the samelabels
as the original one. This restriction imposes a considerable limitation on our usage of this function, especially in scenarios where we might want to replace a tensor with another one that differs in size and consequently, in labels.At the moment, this implementation could potentially introduce problems. Specifically, the
TensorNetwork
has aninds
field that links indexes with tensors. In its current form, we cannot add a new index to aTensorNetwork
because of the immutable nature of this struct.The recent refactor presented in PR #55 removes the
inds
field, allowing a more generalized replacement of tensors like the one just explained.The text was updated successfully, but these errors were encountered: