awietek / xdiag

C++ library for Exact Diagonalization of quantum many-body systems
https://awietek.github.io/xdiag
Apache License 2.0
21 stars 5 forks source link

Main #12

Closed mulaga closed 2 weeks ago

mulaga commented 3 weeks ago

added a fill method that works with matrices. apply is still overloaded to work with both columns and matrices since this seems to be a design decision with the State class.

i also added some docs for this functionality and tests with each block type.

awietek commented 3 weeks ago

Thank you Martin, that's a great new feature to have. It does seem as if on Linux, the continuous integration testing has some undefined references when it tries to compile. I realize this is whenever the matrix is complex. Are these functions defined, or maybe a template instantiation is missing?

awietek commented 3 weeks ago

Looking a bit more closely, it indeed seems you just missed the template instantiation for complex matrices, i.e. you only added e.g.:

template void apply(OpSum const &, Electron const &, arma::Mat const &, Electron const &, arma::Mat &, double);

but not

template void apply(OpSum const &, Electron const &, arma::Mat const &, Electron const &, arma::Mat &, double);

mulaga commented 2 weeks ago

i guess the compiler defaulted to weak symbols which don't work on all architectures. not sure that I completely understand the behaviour, but I seem to have missed it since it compiled fine on several computers.