RFC: supporting complex inputs in np.logaddexp
![](https://secure.gravatar.com/avatar/2881ca14e0752487643cca5898a06906.jpg?s=120&d=mm&r=g)
Hello all, I would like to ask if the maintainers would be in favour of adding support to np.logaddexp in order to support complex numbers. scipy.special.logsumexp already does, and it would be relatively straightforward to support them in numpy too. Complex numbers are very common when working in quantum physics, where we have complex-valued probability amplitudes. Best, Filippo Vicentini
![](https://secure.gravatar.com/avatar/5f88830d19f9c83e2ddfd913496c5025.jpg?s=120&d=mm&r=g)
On Tue, Jun 1, 2021 at 3:18 PM Filippo Vicentini <filippovicentini@gmail.com> wrote:
Hello all,
I would like to ask if the maintainers would be in favour of adding support to np.logaddexp in order to support complex numbers. scipy.special.logsumexp already does, and it would be relatively straightforward to support them in numpy too.
That may just work by accident in SciPy, it's not tested in `scipy/special/tests/test_logsumexp.py`. Probably because it's implemented in pure Python. If you rely on that, adding a few tests would be nice. Adding support to `np.logaddexp` seems fine to me. Cheers, Ralf
Complex numbers are very common when working in quantum physics, where we have complex-valued probability amplitudes.
Best, Filippo Vicentini _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion
participants (2)
-
Filippo Vicentini
-
Ralf Gommers