Inplace multiplication of tensors with the same shape but different indicies

Thanks for the quick fix!

@kmp5 hmm, I just cloned ITensors and deved ITensors and NDTensors and I’m getting the same error as before.

ERROR: MethodError: Cannot `convert` an object of type
  Tuple{Int64{},Int64{},Int64,Int64} to an object of type 
  Tuple{Int64{},Int64{}}

It’s running the cloned version since the paths in the stack trace all point to my dev folder.

@OliverDudgeon my changes have not been pushed to main but you can manually change line 382 in the file
ITensors/NDTensors/src/dense/linearalgebra/contract.jl
If you’d like the fix right now.
I have messaged Matt about the pr discussed previously.

Sorry, yeah it’s working. Thanks! I was confused by the pC = NTuple{NC,Int}(props.PC) part of your comment above, since that’s what currently on main.

@kmp5 I just tried my mwe with the data file and I’m still getting the origional error.

I’ve cloned ITensors to my .julia/dev folder then run merged to main your fix branch and then run ]dev ITensors and ]dev NDTensors. Then I can run that script and I get the error.

I see the same numerical issue I found previously.

@OliverDudgeon, I found the problem and believe that I have actually fixed it this time. I was incorrectly permuting the input C tensor and somehow missed that in my testing. You can grab the new NDTensors/src/dense/contract.jl from /[NDTensors][Debug] Fix Typo `NB` should be `NC` by kmp5VT · Pull Request #1158 · ITensor/ITensors.jl · GitHub

I can confirm this is now all working well. Thanks everyone for working on this!

1 Like

This should be fixed now in the latest registered version of NDTensors.