kmath
kmath copied to clipboard
ComplexField.power gives invalid return values for negative integer reals with a real power
Example:
ComplexField.power(Complex(-3.0, 0.0), 0.5)
This results in a complex result where both the real and imaginary parts are NaN.
Workaround:
ComplexField(Complex(-3.0, 0.0), Complex(0.5, 0.0))
Thank you, I've reproduced it on the latest build.
Thanks again, the problem was in optimization made for complex numbers without real part: https://github.com/SciProgCentre/kmath/commit/8a754ace199d84959978b78fb1b175595a1d7af3.