-
Notifications
You must be signed in to change notification settings - Fork 125
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
[ITensors] Fix issue with directsum involving EmptyStorage #1443
Conversation
I would prefer a solution based on As another corner case, what happens if both inputs are using ITensors
i, j, k = Index.(2, ("i", "j", "k"))
A = ITensor(i, j)
B = ITensor(i, k)
directsum(A => j, B => k) ? Probably the result should be |
@mtfishman Would it be reasonable to have this function for now
|
Sure, that sounds like a good idea. Maybe add a sentence like:
|
Thanks! |
Description
In this I attempt to fix issue 1430 where there is an issue in directsum when an
EmptyTensor
is fed in as the first argument instead of the second. Intensor_algebra.jl
the directsum code attempts to callone(EmptyNumber)
.To fix this code I am modifying this function
I have 2 fix ideas, the first is slightly intrusive
elt = promote_type(elt1, elt2)
and useelt
instead ofelt1
in bothD1
andD2
. The second is less intrusive, it iswhich is what I have implemented.
How Has This Been Tested?
I added some tests in the
test_itensors.jl
I test an empty tensor in front and in back.