Closed MasonProtter closed 1 year ago
Perhaps include NCAdd
to widen available Algebraizations.
It is helpful to have anti-commutative operations available and visually distinct from their subsumptive non-commutative operations. a ⨱ b == -(b x a)
Or, allow one to declare a type or to declare some arithmetic ops for a type to be commutative or anticommutative or noncommutative, associative or nonassociative
We now have LiteralReal
which just does not reorder anything! It can be used as a type annotation and is a subtype of Real:
julia> @syms a::LiteralReal b::LiteralReal
(a, b)
julia> a * b * a
(a * b) * a
This is currently incomplete, but it's in at least a somewhat working state. It still requires at the very least
and maybe also
Add
The idea here is that I've added a special term struct
NCMul
which is meant to represent non-commutative multiplication (kinda likeMul
, but order preserving). I've also added a new type of rule,AssocRule
where the idea is that it is meant to represent associative replacement rules (but not commutative).For example, we could write
and this would traverse the arguments list doing something like
Now, here is an example case where someone might want to use this machinery to implement a 2D geometric algebra:
Now we can do all sorts of stuff: