pyuni10.Contract() fails when two UniTensor have no common label.
It fails when two UniTensor have no common label.
the code
bd = uni10.Bond(2)
T1 = uni10.UniTensor([bd, bd], Rowrank=1, in_labels=[0, 1])
T2 = uni10.UniTensor([bd, bd], Rowrank=1, in_labels=[2, 3])
T1.print_diagram()
T2.print_diagram()
T = uni10.Contract(T1, T2)
fails with following output
-----------------------
tensor Name :
tensor Rank : 2
block_form : false
is_diag : False
on device : cytnx device: CPU
-------------
/ \
0 ____| 2 2 |____ 1
\ /
-------------
-----------------------
tensor Name :
tensor Rank : 2
block_form : false
is_diag : False
on device : cytnx device: CPU
-------------
/ \
2 ____| 2 2 |____ 3
\ /
-------------
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-28-3e9e65703654> in <module>
4 T1.print_diagram()
5 T2.print_diagram()
----> 6 T = uni10.Contract(T1, T2)
7
8 bd = uni10.Bond(2)
RuntimeError:
# Cytnx error occur at cytnx::Tensor cytnx::linalg::Outer(const cytnx::Tensor&, const cytnx::Tensor&)
# error: [ERROR] tensor #1 should have rank-1.
# file : /private/var/folders/26/5351ptkn06s590c1x8fv1jdm0000gn/T/pip-req-build-yu98f2at/cytnx/src/linalg/Outer.cpp (17)