The main structure related to a free algebra is its coefficient ring. Multivariate free algebras belong to the Magma category AlgFr.
Return the coefficient ring of the free algebra F.
Note that the # operator only returns a value for finite (quotients of) free algebras.
Return the number of indeterminates of free algebra F over its coefficient ring.
In its most general form, a homomorphism taking a free algebra K< x1, ..., xn > as domain requires n + 1 pieces of information, namely, a map (homomorphism) telling how to map the coefficient ring K together with the images of the n indeterminates. The map for the coefficient ring is optional.
Given a free algebra F=K< x1, ..., xn >, a ring or associative algebra S (including another FP-algebra or a matrix algebra), and a map f : K -> S and n elements y1, ..., yn∈S, create the homomorphism g : F -> S by applying the rules that g(rx1a1 ... xnan)=f(r)y1a1 ... ynan for monomials and linearity, that is, g(M + N)=g(M) + g(N).The coefficient ring map may be omitted, in which case the coefficients are mapped into S by the coercion map.
No attempt is made to check whether the map defines a genuine homomorphism.
> K := RationalField(); > F<x,y,z> := FreeAlgebra(K, 3); > h := hom<F -> F | x*y, y*x, z*x>; > h(x); x*y > h(y); y*x > h(x*y); x*y^2*x > h(x + y + z); x*y + y*x + z*x > A := MatrixAlgebra(K, 2); > M := [A | [1,1,-1,1], [-1,3,4,1], [11,7,-7,8]]; > M; [ [ 1 1] [-1 1], [-1 3] [ 4 1], [11 7] [-7 8] ] > h := hom<F -> A | M>; > h(x); [ 1 1] [-1 1] > h(y); [-1 3] [ 4 1] > h(x*y - y*z); [ 35 -13] [-32 -38]