Skip to content

WIP: Complex number support

Depends on !43 (merged)

Pystencils should eventually support complex numbers. Even if complex fields can be considered harmful for CPU vectorization. The concept is nice since SymPy and Python support complex numbers and there should be no performance disadvantage for normal CPU and GPU code. Many applications in physics and signal processing rely on complex numbers.

Complex output fields can be passed directly to libraries like cufft.

Problem: In C++, one cannot mix calculation with std::complex<float> with std::complex<double>. So user has to specify data_type='float32' when single precision complex floats are desired.

TODO:

  • GPU support with the header pycuda provides
  • only use complex_helper.h when needed
  • remove commits from !34 (merged) (probably the code will be changed)
  • rebase -i
Edited by Stephan Seitz

Merge request reports