[Numpy-discussion] RFC: supporting complex inputs in np.logaddexp

Ralf Gommers ralf.gommers at gmail.com
Mon Jun 7 12:42:46 EDT 2021


On Tue, Jun 1, 2021 at 3:18 PM Filippo Vicentini <filippovicentini at 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 at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20210607/6df291cc/attachment.html>


More information about the NumPy-Discussion mailing list