Free algebras

AUTHORS:

  • David Kohel (2005-09)
  • William Stein (2006-11-01): add all doctests; implemented many things.

EXAMPLES:

sage: F = FreeAlgebra(ZZ,3,'x,y,z')
sage: F.base_ring()
Integer Ring
sage: G = FreeAlgebra(F, 2, 'm,n'); G
Free Algebra on 2 generators (m, n) over Free Algebra on 3 generators (x, y, z) over Integer Ring
sage: G.base_ring()
Free Algebra on 3 generators (x, y, z) over Integer Ring        

TESTS:

sage: F = FreeAlgebra(GF(5),3,'x')
sage: F == loads(dumps(F))
True
sage: F.<x,y,z> = FreeAlgebra(GF(5),3)
sage: F == loads(dumps(F))
True
sage: F = FreeAlgebra(GF(5),3, ['xx', 'zba', 'Y'])
sage: F == loads(dumps(F))
True
sage: F = FreeAlgebra(GF(5),3, 'abc')
sage: F == loads(dumps(F))
True
sage: F = FreeAlgebra(FreeAlgebra(ZZ,1,'a'), 2, 'x')
sage: F == loads(dumps(F))
True
sage.algebras.free_algebra.FreeAlgebra(R, n, names)

Return the free algebra over the ring R on n generators with given names.

INPUT:

  • R - ring
  • n - integer
  • names - string or list/tuple of n strings

OUTPUT: a free algebra

EXAMPLES:

sage: FreeAlgebra(GF(5),3,'x')
Free Algebra on 3 generators (x0, x1, x2) over Finite Field of size 5
sage: F.<x,y,z> = FreeAlgebra(GF(5),3)
sage: (x+y+z)^2
x^2 + x*y + x*z + y*x + y^2 + y*z + z*x + z*y + z^2
sage: FreeAlgebra(GF(5),3, 'xx, zba, Y')
Free Algebra on 3 generators (xx, zba, Y) over Finite Field of size 5
sage: FreeAlgebra(GF(5),3, 'abc')
Free Algebra on 3 generators (a, b, c) over Finite Field of size 5
sage: FreeAlgebra(GF(5),1, 'z')
Free Algebra on 1 generators (z,) over Finite Field of size 5
sage: FreeAlgebra(GF(5),1, ['alpha'])
Free Algebra on 1 generators (alpha,) over Finite Field of size 5
sage: FreeAlgebra(FreeAlgebra(ZZ,1,'a'), 2, 'x')
Free Algebra on 2 generators (x0, x1) over Free Algebra on 1 generators (a,) over Integer Ring

Free algebras are globally unique:

sage: F = FreeAlgebra(ZZ,3,'x,y,z')
sage: G = FreeAlgebra(ZZ,3,'x,y,z')
sage: F is G
True

Free algebras commute with their base ring.

sage: K.<a,b> = FreeAlgebra(QQ,2)
sage: K.is_commutative()
False
sage: L.<c> = FreeAlgebra(K,1)
sage: L.is_commutative()
False
sage: s = a*b^2 * c^3; s
a*b^2*c^3
sage: parent(s)
Free Algebra on 1 generators (c,) over Free Algebra on 2 generators (a, b) over Rational Field
sage: c^3 * a * b^2
a*b^2*c^3
class sage.algebras.free_algebra.FreeAlgebra_generic(R, n, names)

Bases: sage.rings.ring.Algebra

The free algebra on n generators over a base ring.

EXAMPLES:

sage: F.<x,y,z> = FreeAlgebra(QQ, 3); F
Free Algebra on 3 generators (x, y, z) over Rational Field
sage: mul(F.gens())
x*y*z
sage: mul([ F.gen(i%3) for i in range(12) ])
x*y*z*x*y*z*x*y*z*x*y*z
sage: mul([ F.gen(i%3) for i in range(12) ]) + mul([ F.gen(i%2) for i in range(12) ])
x*y*x*y*x*y*x*y*x*y*x*y + x*y*z*x*y*z*x*y*z*x*y*z
sage: (2 + x*z + x^2)^2 + (x - y)^2
4 + 5*x^2 - x*y + 4*x*z - y*x + y^2 + x^4 + x^3*z + x*z*x^2 + x*z*x*z
coerce_map_from_impl(R)
gen(i)

The i-th generator of the algebra.

EXAMPLES:

sage: F = FreeAlgebra(ZZ,3,'x,y,z')
sage: F.gen(0)
x
is_commutative()

Return True if this free algebra is commutative.

EXAMPLES:

sage: R.<x> = FreeAlgebra(QQ,1)
sage: R.is_commutative()
True
sage: R.<x,y> = FreeAlgebra(QQ,2)
sage: R.is_commutative()
False
is_field(proof=True)

Return True if this Free Algebra is a field, which is only if the base ring is a field and there are no generators

EXAMPLES:

sage: A=FreeAlgebra(QQ,0,'')
sage: A.is_field()
True
sage: A=FreeAlgebra(QQ,1,'x')
sage: A.is_field()
False
monoid()

The free monoid of generators of the algebra.

EXAMPLES:

sage: F = FreeAlgebra(ZZ,3,'x,y,z')
sage: F.monoid()
Free monoid on 3 generators (x, y, z)
ngens()

The number of generators of the algebra.

EXAMPLES:

sage: F = FreeAlgebra(ZZ,3,'x,y,z')
sage: F.ngens()
3
quo(mons, mats, names)
Returns a quotient algebra defined via the action of a free algebra A on a (finitely generated) free module. The input for the quotient algebra is a list of monomials (in the underlying monoid for A) which form a free basis for the module of A, and a list of matrices, which give the action of the free generators of A on this monomial basis.
quotient(mons, mats, names)
Returns a quotient algebra defined via the action of a free algebra A on a (finitely generated) free module. The input for the quotient algebra is a list of monomials (in the underlying monoid for A) which form a free basis for the module of A, and a list of matrices, which give the action of the free generators of A on this monomial basis.
sage.algebras.free_algebra.is_FreeAlgebra(x)

Return True if x is a free algebra; otherwise, return False.

EXAMPLES:

sage: from sage.algebras.free_algebra import is_FreeAlgebra
sage: is_FreeAlgebra(5)
False
sage: is_FreeAlgebra(ZZ)
False
sage: is_FreeAlgebra(FreeAlgebra(ZZ,100,'x'))
True

Previous topic

Algebras

Next topic

Free algebra elements

This Page