romeric / Fastor

A lightweight high performance tensor algebra framework for modern C++
MIT License
752 stars 70 forks source link

Multiplying a complex tensor with a complex number gives zero #149

Open APN-Pucky opened 3 years ago

APN-Pucky commented 3 years ago
Tensor<complex<double>,3,3> a = {{1,0,0},{0,0,0},{0,0,0}};
std::cout << a << std::endl << std::endl;
auto b = a*std::complex<double>(3,5);
std::cout << b << std::endl;

results in

[(1,0), (0,0), (0,0)]
[(0,0), (0,0), (0,0)]
[(0,0), (0,0), (0,0)]

[(0,0), (0,0), (0,0)]
[(0,0), (0,0), (0,0)]
[(0,0), (0,0), (0,0)]

which is unexpected. Multiplying a complex tensor with a double however works fine.

Possibly related to #146 .

romeric commented 2 years ago

Will work on this ASAP. Thanks for reporting.