Package sage :: Package algebras :: Module free_algebra_element :: Class FreeAlgebraElement
[hide private]
[frames] | no frames]

Class FreeAlgebraElement

source code

                      object --+                    
                               |                    
structure.sage_object.SageObject --+                
                                   |                
           structure.element.Element --+            
                                       |            
         structure.element.ModuleElement --+        
                                           |        
               structure.element.RingElement --+    
                                               |    
                structure.element.AlgebraElement --+
                                                   |
                                                  FreeAlgebraElement


A free algebra element.



Instance Methods [hide private]
 
__init__(self, A, x)
Create the element x of the FreeAlgebra A.
source code
 
_repr_(self)
Return string representation of self.
source code
 
_latex_(self)
Return latex representation of self.
source code
 
__call__(self, *x, **kwds)
EXAMPLES: sage: A.<x,y,z>=FreeAlgebra(ZZ,3) sage: (x+3*y).subs(x=1,y=2,z=14) 7 sage: (2*x+y).subs({x:1,y:z}) 2 + z sage: f=x+3*y+z sage: f(1,2,1/2) 15/2 sage: f(1,2) Traceback (most recent call last): ...
source code
 
__cmp__(left, right)
Compare two free algebra elements with the same parents.
source code
 
_add_(self, y)
Return sum of self and y (another free algebra element with...
source code
 
_neg_(self)
Return negation of self...
source code
 
_sub_(self, y)
Return self minus y (another free algebra element with the...
source code
 
_mul_(self, y)
Return product of self and y (another free algebra element with...
source code

Inherited from structure.element.AlgebraElement: __new__

Inherited from structure.element.RingElement: __div__, __idiv__, __imul__, __invert__, __mul__, __pos__, __pow__, __rdiv__, __rmul__, __rpow__, __rtruediv__, __truediv__, _div_, _idiv_, _imul_, abs, additive_order, is_nilpotent, is_one, is_unit, multiplicative_order, order

Inherited from structure.element.ModuleElement: __add__, __iadd__, __isub__, __neg__, __radd__, __rsub__, __sub__, _iadd_, _ilmul_, _isub_, _lmul_, _rmul_

Inherited from structure.element.Element: __eq__, __ge__, __gt__, __hash__, __le__, __lt__, __ne__, __nonzero__, __reduce__, __rxor__, __xor__, _cmp_, _im_gens_, _richcmp_, base_base_extend, base_base_extend_canonical_sym, base_extend, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, base_ring, category, is_zero, n, parent, subs, substitute

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_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, A, x)
(Constructor)

source code 

Create the element x of the FreeAlgebra A.

Overrides: structure.element.Element.__init__

_repr_(self)

source code 

Return string representation of self.

EXAMPLES:
    sage: A.<x,y,z>=FreeAlgebra(ZZ,3)
    sage: repr(-x+3*y*z)
    '-x + 3*y*z'

Overrides: structure.element.Element._repr_

_latex_(self)

source code 

Return latex representation of self.

EXAMPLES:
    sage: A.<x,y,z>=FreeAlgebra(ZZ,3)
    sage: latex(-x+3*y^20*z)
    \left(-1\right)x + 3y^{20}z
    sage: alpha,beta,gamma=FreeAlgebra(ZZ,3,'alpha,beta,gamma').gens()
    sage: latex(alpha-beta)
    \alpha + \left(-1\right)\beta

__call__(self, *x, **kwds)
(Call operator)

source code 

EXAMPLES:
    sage: A.<x,y,z>=FreeAlgebra(ZZ,3)
    sage: (x+3*y).subs(x=1,y=2,z=14)
    7
    sage: (2*x+y).subs({x:1,y:z})
    2 + z
    sage: f=x+3*y+z
    sage: f(1,2,1/2)
    15/2
    sage: f(1,2)
    Traceback (most recent call last):
    ...
    ValueError: must specify as many values as generators in parent

AUTHOR:
    -- Joel B. Mohler (2007.10.27)

__cmp__(left, right)
(Comparison operator)

source code 

Compare two free algebra elements with the same parents.

The ordering is the one on the underlying sorted list of (monomial,coefficients) pairs.

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

Overrides: structure.element.Element.__cmp__

_add_(self, y)

source code 

Return sum of self and y (another free algebra element with
the same parents)

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

Overrides: structure.element.ModuleElement._add_

_neg_(self)

source code 

Return negation of self

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

Overrides: structure.element.ModuleElement._neg_

_sub_(self, y)

source code 

Return self minus y (another free algebra element with the
same parents)

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

Overrides: structure.element.ModuleElement._sub_

_mul_(self, y)

source code 

Return product of self and y (another free algebra element with
the same parents)

EXAMPLES:
    sage: A.<x,y,z>=FreeAlgebra(ZZ,3)
    sage: (x+y+x*y)*(x+y+1)
    x + y + x^2 + 2*x*y + y*x + y^2 + x*y*x + x*y^2

Overrides: structure.element.RingElement._mul_