Package sage :: Package algebras :: Module free_algebra :: Class FreeAlgebra_generic
[hide private]
[frames] | no frames]

Class FreeAlgebra_generic

source code

                      object --+                        
                               |                        
structure.sage_object.SageObject --+                    
                                   |                    
             structure.parent.Parent --+                
                                       |                
    structure.parent_base.ParentWithBase --+            
                                           |            
        structure.parent_gens.ParentWithGens --+        
                                               |        
                                 rings.ring.Ring --+    
                                                   |    
                                  rings.ring.Algebra --+
                                                       |
                                                      FreeAlgebra_generic


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



Instance Methods [hide private]
 
__init__(self, R, n, names)
INPUT:...
source code
 
is_field(self)
Return True if this Free Algebra is a field, which is only if...
source code
 
is_commutative(self)
Return True if this free algebra is commutative.
source code
 
__cmp__(self, other)
Two free algebras are considered the same if they have the same base ring, number of generators and variable names.
source code
 
_repr_(self)
Text representation of this free algebra.
source code
 
__call__(self, x)
Coerce x into self.
source code
 
_coerce_impl(self, x)
Canonical coercion of x into self.
source code
 
coerce_map_from(self, S)
File: sage/structure/parent.pyx (starting at line 133)
source code
 
gen(self, i)
The i-th generator of the algebra.
source code
 
quotient(self, mons, mats, names)
Returns a quotient algebra defined via the action of a free algebra A on a (finitely generated) free module.
source code
 
quo(self, mons, mats, names)
Returns a quotient algebra defined via the action of a free algebra A on a (finitely generated) free module.
source code
 
ngens(self)
The number of generators of the algebra.
source code
 
monoid(self)
The free monoid of generators of the algebra.
source code

Inherited from rings.ring.Algebra: __new__, characteristic

Inherited from rings.ring.Ring: __getitem__, __hash__, __iter__, __len__, __mul__, __rmul__, __rxor__, __xor__, _ideal_class_, base_extend, category, ideal, is_atomic_repr, is_exact, is_finite, is_integral_domain, is_noetherian, is_prime_field, is_ring, is_subring, one_element, order, principal_ideal, random_element, unit_ideal, zero_element, zero_ideal, zeta, zeta_order

Inherited from rings.ring.Ring (private): _r_action

Inherited from structure.parent_gens.ParentWithGens: __getslice__, __getstate__, __setstate__, _is_valid_homomorphism_, gens, gens_dict, hom, inject_variables, injvar, latex_name, latex_variable_names, list, objgen, objgens, variable_name, variable_names

Inherited from structure.parent_base.ParentWithBase: Hom, base, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, base_ring

Inherited from structure.parent.Parent: __contains__, _coerce_, coerce_map_from_impl, construction, get_action, get_action_impl, has_coerce_map_from, has_coerce_map_from_impl, init_coerce

Inherited from structure.sage_object.SageObject: __repr__, _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from structure.parent.Parent (private): _has_coerce_map_from

Inherited from object: __class__

Method Details [hide private]

__init__(self, R, n, names)
(Constructor)

source code 

INPUT:
    R -- ring
    n -- an integer
    names -- generator names

Overrides: rings.ring.Algebra.__init__

is_field(self)

source code 

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

Overrides: rings.ring.Ring.is_field

is_commutative(self)

source code 

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

Overrides: rings.ring.Ring.is_commutative

__cmp__(self, other)
(Comparison operator)

source code 

Two free algebras are considered the same if they have the
same base ring, number of generators and variable names.

EXAMPLES:
    sage: F = FreeAlgebra(QQ,3,'x')
    sage: F ==  FreeAlgebra(QQ,3,'x')
    True
    sage: F is  FreeAlgebra(QQ,3,'x')
    True
    sage: F == FreeAlgebra(ZZ,3,'x')
    False
    sage: F == FreeAlgebra(QQ,4,'x')
    False
    sage: F == FreeAlgebra(QQ,3,'y')
    False        

_repr_(self)

source code 

Text representation of this free algebra.

EXAMPLES:
    sage: F = FreeAlgebra(QQ,3,'x')
    sage: print F
    Free Algebra on 3 generators (x0, x1, x2) over Rational Field
    sage: F.rename('QQ<<x0,x1,x2>>')
    sage: print F
    QQ<<x0,x1,x2>>        

__call__(self, x)
(Call operator)

source code 

Coerce x into self.

EXAMPLES:
    sage: R.<x,y> = FreeAlgebra(QQ,2)
    sage: R(3)
    3

Overrides: rings.ring.Ring.__call__

_coerce_impl(self, x)

source code 

Canonical coercion of x into self.

Here's what canonically coerces to self:
    * this free algebra
    * the underlying monoid
    * anything that coerces to the base ring of this free algebra
    * any free algebra whose base ring coerces to the base ring of this free algebra

EXAMPLES:
    sage: F.<x,y,z> = FreeAlgebra(GF(7),3); F
    Free Algebra on 3 generators (x, y, z) over Finite Field of size 7

Elements of the free algebra canonically coerce in.
    sage: F._coerce_(x*y)
    x*y

Elements of the integers coerce in, since there is a coerce map from ZZ to GF(7).
    sage: F._coerce_(1)
    1

There is no coerce map from QQ to GF(7).
    sage: F._coerce_(2/3)
    Traceback (most recent call last):
    ...
    TypeError: no canonical coercion of element into self

Elements of the base ring coerce in.
    sage: F._coerce_(GF(7)(5))
    5

Elements of the correspondining moind (of monomials) coerce in:
    sage: M = F.monoid(); m = M.0*M.1^2; m
    x*y^2
    sage: F._coerce_(m)
    x*y^2

The free algebra over ZZ on x,y,z coerces in, since ZZ coerces
to GF(7):
    sage: G = FreeAlgebra(ZZ,3,'x,y,z')
    sage: F._coerce_(G.0^3 * G.1)
    x^3*y

However, GF(7) doesn't coerce to ZZ, so the free algebra over
GF(7) doesn't coerce to the one over ZZ:
    sage: G._coerce_(x^3*y)
    Traceback (most recent call last):
    ...
    TypeError: no natural map between bases of free algebras        

Overrides: structure.parent.Parent._coerce_impl

coerce_map_from(self, S)

source code 
File: sage/structure/parent.pyx (starting at line 133)

Overrides: structure.parent.Parent.coerce_map_from
(inherited documentation)

gen(self, i)

source code 

The i-th generator of the algebra.

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

Overrides: structure.parent_gens.ParentWithGens.gen

quotient(self, mons, mats, names)

source code 

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.

quo(self, mons, mats, names)

source code 

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.

ngens(self)

source code 

The number of generators of the algebra.

EXAMPLES:
    sage: F = FreeAlgebra(ZZ,3,'x,y,z')
    sage: F.ngens()
    3

Overrides: structure.parent_gens.ParentWithGens.ngens

monoid(self)

source code 

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)