You need to sign in or sign up before continuing.
ktensor and ttt inconsistent for complex vectors
rand('state', 0);
u = complex( rand(3,1), rand(3,1) );
v = complex( rand(2,1), rand(2,1) );
X = ktensor(1, u, v);
Y = ttt( tensor(u, 3), tensor(v, 2) );
I would expect X
and Y
to be the same, since the CP decomposition is defined as a weighted sum of rank-one tensors, each being the outer product of vectors (Bader & Kolda, 2006).
>> full(X)
ans is a tensor of size 3 x 2
ans(:,:) =
0.0345 - 1.0023i -0.1985 - 0.4315i
-0.6266 - 0.5967i -0.3921 - 0.1193i
-0.3490 - 0.8463i -0.3277 - 0.2840i
>> Y
Y is a tensor of size 3 x 2
Y(:,:) =
0.0345 + 1.0023i -0.1985 + 0.4315i
-0.6266 + 0.5967i -0.3921 + 0.1193i
-0.3490 + 0.8463i -0.3277 + 0.2840i
It seems to me that ktensor
calculates conj(u * v.')
, while ttt
uses u * v.'
. Another common definition of outer product for complex vectors is u * v'
using conjugate transpose, see https://en.wikipedia.org/wiki/Outer_product#Vector_multiplication.