[Numpy-discussion] numpy grant update

Peter Creasey p.e.creasey.00 at googlemail.com
Fri Oct 27 15:24:41 EDT 2017


> Date: Thu, 26 Oct 2017 17:27:33 -0400
> From: Marten van Kerkwijk
>
> That sounds somewhat puzzling as units cannot really propagate without
> them somehow telling how they would change! (e.g., the outcome of
> sin(a) is possible only for angular units and then depends on that
> unit). But in any case, the mailing list is probably not the best case
> to discuss this - rather, I look forward to  -- and will most happily
> give feedback on -- a NEP or other more detailed explanation!
>


So whilst it’s true that trigonometric functions only make sense for
dimensionless quantities, you might still want to compute them for
dimensional quantities for reasons of computational efficiency. Taking
your example of sin(a) in a spectral density identity:

log(cos(ka) + i sin(ka)) = k log(cos(a) + i sin(a))

so if you are computing the LHS for many k and a single a (i.e k the
wavenumber and ka dimensionless) then you might prefer the RHS, which
actually uses sin(a).

Peter


More information about the NumPy-Discussion mailing list