Re-introduce support for complex numbers
since !292 (merged) complex numbers are not supported anymore, which is a feature I'm dependent on.
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related. Learn more.
Activity
- Maintainer
You will probably want to switch from
pystencils.fields('x, y: complex64')
topystencils.fields('x, y: float32[2d]')
and implement your own helper functions for complex arithmetic (exp
,arg
,abs
,real
,imag
, ...). I guess the downside of the old implementation (!72 (merged)) was that it just mapped to the C99 complex data type. That means you were forced to use zyxf layout and you did not gain anything because no modern hardware architecture has native complex number instructions.Edited by Michael Kuron - Owner
- Owner
What is the status of this Issue @alexander.reinauer ? Should it remain open or is the work-around good enough?
- Author Contributor
I've created a work-around a while back. I'm kind of forced to use the
numpy.complex128
datatype for the arrays, because of another library, but I created and reshaped a view of these arrays withdtype=numpy.float64
and implemented the complex-number arithmetics I need myself, as @kuron suggested. Not an elegant solution and relying on the allocation in numpy, but it works. For me it's good enough for the moment, so feel free to close if it's not worth the effort to support.Edited by Alexander Reinauer - Owner
Ok then I will close it for now
- Markus Holzer closed
closed