Closed jofrevalles closed 12 months ago
Before the refactor, the constructor was calling push!
so it was correct. But I decided to recode it to avoid some overhead of overcalling push!
.
I might bypassed some checks that were essential. Can you add a test for this case?
Summary
In the current implementation of the
TensorNetwork
function, inconsistent dimensions of the same tensor index are not correctly checked and handled. This issue manifests when two tensors with the same index label, but have different dimensions in the sameTensorNetwork
.Example
In the above example, despite
:j
index having dimensions of 3 inTensor
A
and 2 inTensor
B
, noDimensionMismatch
error is raised, which is counter-intuitive and can potentially lead to incorrect results.Interestingly, the
DimensionMismatch
error is correctly thrown when using thepush!
function:This suggests that the error handling mechanism might be correctly implemented in
push!
but is not properly functioning in theTensorNetwork
constructor function.