ginkgo icon indicating copy to clipboard operation
ginkgo copied to clipboard

Test solvers and preconditioners with complex values

Open upsj opened this issue 4 years ago • 1 comments

We currently don't do any solver and preconditioner tests with complex values. For generality, we should change that! Some implementations contain bugs in that regard.

Examples: https://github.com/ginkgo-project/ginkgo/blob/500d4a5719ab0b60f76f7f5cbc6f77fd6254f544/reference/solver/gmres_kernels.cpp#L90

upsj avatar May 14 '20 08:05 upsj

While investigating a bit more, we need to change multiple parts of our implementation if we want to properly support complex:

  1. Dense::compute_norm2 should put the result into a Dense<remove_complex<ValueType>> While using squared_norm() instead of compute_dot inside the kernels. Reference kernel example: https://github.com/ginkgo-project/ginkgo/blob/develop/reference/matrix/dense_kernels.cpp#L187
  2. The Convergence logger should also use the non-complex storage type here: https://github.com/ginkgo-project/ginkgo/blob/develop/core/log/convergence.cpp#L61
  3. The ResidualNormReduction stopping criterion should use the non-complex vector type: using Vector = matrix::Dense<remove_complex<ValueType>> here: https://github.com/ginkgo-project/ginkgo/blob/develop/include/ginkgo/core/stop/residual_norm_reduction.hpp#L71

There might be more, but these are the ones I could find this far.

thoasm avatar May 26 '20 13:05 thoasm