Marcel-Rodekamp / NSL

Nanosystem Simulation Library (NSL) implements statistical simulations for systems on the nanoscale
Other
2 stars 0 forks source link

Tensor Type difference #135

Open Marcel-Rodekamp opened 1 year ago

Marcel-Rodekamp commented 1 year ago

There is a bug in the Tensor class such that it is possible to have NSL::Tensor and the contained torch::tensor being of different types. We realized that by using

NSL::Tensor<NSL::complex<double>> Mat(2,2); Mat.randn();
Mat+=Mat.T()
auto [ee,ev] = NSL::LinAlg::eigh(Mat,"L");

Here ee is of type NSL::Tensor<NSL::complex<double>> but the contained torch::tensor is of type double.