There is are some domains in FriCAS for doing computations with non-commuting variables developed by Michel Petitot. You can find some examples in the FriCAS book under the title XPolynomial? but unfortunately the explanations are a little terse. You can also check for documentation in the source files:
and HyperDoc example page about XPOLY In FriCAS algebra is simplified and there is no longer OrderedFreeMonoid?, we just use FreeMonoid below. We need left and right quotients which are provided by Test left and right exact quotients. fricas m1:=(x*y*y*z)$FMONOID(Symbol)
Type: FreeMonoid(Symbol)
fricas m2:=(x*y)$FMONOID(Symbol)
Type: FreeMonoid(Symbol)
fricas lquo(m1,
Type: Union(FreeMonoid(Symbol),
fricas m3:=(y*y)$FMONOID(Symbol)
Type: FreeMonoid(Symbol)
fricas divide(m1,
fricas divide(m1,
fricas m4:=(y^3)$FMONOID(Symbol)
Type: FreeMonoid(Symbol)
fricas divide(m1,
Type: Union("failed",
This option is required to compile the functions that follow. fricas )set function compile on On Tuesday, February 28, 2006 6:54 AM Fabio S. wrote: I would like to build the non-commutative algebra h=k[x,y] and then I would like to make computations in h using some predefined rules for x and y. As an example, take the three equations x*y*x=y*x*y x*x=a*x+b y*y=a*y+b where a and b are (generic, if possible) elements of k. Then, I would like to be able to reduce polynomials in x and y according to the previous rules. For example, (x+y)^2 (=x^2+x*y+y*x+y^2) should reduce to a*(x+y)+2*b+x*y+y*x fricas --Generic elements of k --OVAR = OrderedVariableList C==>OVAR [a, Type: Void
fricas --Commutative Field: k=Q[a, Type: Void
fricas --Non-commutative variables V==>OVAR [x, Type: Void
fricas --Non-commutative Algebra: h=k[x, Type: Void
fricas --Free monoid M==>FMONOID V Type: Void
fricas --Record giving result of division Rec==>Record(lm : M, Type: Void
fricas --Substitution rules are applied to words from the monoid over --the variables and return polynomials subs(w:M):H == --x*y*x=y*x*y n:=divide(w, Type: Void
fricas --Apply rules to a term. Keep coefficients newterm(x:Record(k:M, Type: Void
fricas --Reconstruct polynomial, Type: Void
Example calculations: fricas p1:=(x::V+y::V)$H^2
Type: XDistributedPolynomial(OrderedVariableList([x,
fricas newpoly(p1) fricas Compiling function newpoly with type XDistributedPolynomial( OrderedVariableList([x, fricas Compiling function subs with type FreeMonoid(OrderedVariableList([x, fricas Compiling function newterm with type Record(k: FreeMonoid( OrderedVariableList([x,
Type: XDistributedPolynomial(OrderedVariableList([x,
fricas p2:=(x::V+y::V)$H^3
Type: XDistributedPolynomial(OrderedVariableList([x,
fricas newpoly(p2)
Type: XDistributedPolynomial(OrderedVariableList([x,
fricas reduce(p:H):H == p2 := newpoly(p) p3 := newpoly(p2) while p3 ~= p2 repeat p2 := p3 p3 := newpoly(p2) p3 Type: Void
fricas reduce(p2) fricas Compiling function newpoly with type XDistributedPolynomial( OrderedVariableList([x, fricas Compiling function reduce with type XDistributedPolynomial( OrderedVariableList([x,
Type: XDistributedPolynomial(OrderedVariableList([x,
|