I wonder whether it is currently (or will soon be) possible to specify which physical dimension (or unit) a symbol has and have sympy check that these are compatible when, say, adding symbols or expressions, and compute the resulting dimension (or unit) when, say, multiplying symbols or expressions?
I imagine something like
>>> x = Symbol("x", dimension=length/time)
>>> y = Symbol("y", dimension=time)
>>> x + y
DimensionError: incompatible dimensions cannot be added
>>> (x * y).dimension
length
I know that sympy has now units, but it seems they are only used in numerical computations, not in symbolic ones, am I right?
If the imagined functionality is not present or planned to be added soon, how would you advise me to add it for my project by subclassing? Would it be sufficient to subclass sympy.Expr or would I have to subclass Add, Mul, etc. as well?
Thanks, Jobst