So I have some rules for a symbolic inner product that work for quite a lot of cases:
SetAttributes[CircleDot, Orderless]
x_ \[CircleDot] 0 := 0
(x_ + a_)\[CircleDot] b_ := x \[CircleDot] b + a\[CircleDot] b
(x_ a_) \[CircleDot] b_ := x (a\[CircleDot] b) /; NumericQ[x]
This is great if all symbols are vectors, and the scalars satisfy NumericQ == True
.
Does anyone know a good way to define symbolic scalars? I'd like some kind of 'MakeScalar' function which I can use to mark some of my symbols so that they're taken out of the inner product, and then all other symbols would be interpreted as vectors
I've tried messing around with setting Attributes
, but they didn't work very well, partially because I need that if a
is a scalar, so is 1/a
, Sin[a]
etc. . Is it possible to assign NumericQ
to be true for a given symbol? I'm not sure if this would be a good idea, but I think it would work for me