Physical units in Julia

Specifically on the topic of arrays with unitful entries: I do think we need a special array package for that. The point is that, e.g., linear algebra only makes sense for certain arrays, where the units are a cartesian product of unitful vectors for each axis. You can see that quite easily: with

\sum_j A_{ij} x_j

you can only add the terms together if A_{ij} x_j all have the same units for each j. Consequently, the units of A_{ij} must be given by u_i v_j where {\bf u} and {\bf v} are unitful-vectors (and where v_j x_j has units that are independent of j).

So really unitful arrays should be handled as dimensionless arrays with axis-vectors of units.

14 Likes