Package sage :: Package monoids :: Module free_abelian_monoid_element :: Class FreeAbelianMonoidElement
[hide private]
[frames] | no frames]

Class FreeAbelianMonoidElement

source code

                      object --+            
                               |            
structure.sage_object.SageObject --+        
                                   |        
           structure.element.Element --+    
                                       |    
         structure.element.MonoidElement --+
                                           |
                                          FreeAbelianMonoidElement

Instance Methods [hide private]
 
__init__(self, F, x)
Create the element x of the FreeAbelianMonoid F.
source code
 
__repr__(self)
File: sage/structure/sage_object.pyx (starting at line 86)
source code
 
__mul__(self, y)
File: sage/structure/element.pyx (starting at line 1073) Top-level multiplication operator for monoid elements.
source code
 
__pow__(self, n)
Raises self to the power of n.
source code
 
list(self)
Return (a reference to) the underlying list used to represent this element.
source code

Inherited from structure.element.MonoidElement: __new__, __nonzero__, __rmul__, __rpow__, _mul_, multiplicative_order, order

Inherited from structure.element.Element: __cmp__, __eq__, __ge__, __gt__, __hash__, __le__, __lt__, __ne__, __reduce__, __rxor__, __xor__, _cmp_, _im_gens_, _repr_, _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: _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, F, x)
(Constructor)

source code 

Create the element x of the FreeAbelianMonoid F.

EXAMPLES:
    sage: F = FreeAbelianMonoid(5, 'abcde')
    sage: F
    Free abelian monoid on 5 generators (a, b, c, d, e)
    sage: F(1)
    1
    sage: a, b, c, d, e = F.gens()
    sage: a^2 * b^3 * a^2 * b^4
    a^4*b^7
    sage: F = FreeAbelianMonoid(5, 'abcde')
    sage: a, b, c, d, e = F.gens()
    sage: a in F
    True
    sage: a*b in F
    True

Overrides: structure.element.Element.__init__

__repr__(self)
(Representation operator)

source code 
File: sage/structure/sage_object.pyx (starting at line 86)

Overrides: structure.sage_object.SageObject.__repr__
(inherited documentation)

__mul__(self, y)

source code 
File: sage/structure/element.pyx (starting at line 1073)

Top-level multiplication operator for monoid elements.
See extensive documentation at the top of element.pyx.

Overrides: structure.element.MonoidElement.__mul__
(inherited documentation)

__pow__(self, n)

source code 

Raises self to the power of n.

AUTHOR:
    - Tom Boothby (2007-08) Replaced O(log n) time, O(n) space
      algorithm with O(1) time and space "algorithm".

EXAMPLES:
    sage: F = FreeAbelianMonoid(5,names = list("abcde"))
    sage: (a,b,c,d,e) = F.gens()
    sage: x = a*b^2*e*d; x
    a*b^2*d*e
    sage: x^3
    a^3*b^6*d^3*e^3
    sage: x^0
    1

Overrides: structure.element.MonoidElement.__pow__

list(self)

source code 

Return (a reference to) the underlying list used to represent
this element.  If this is a monoid in an abelian monoid on $n$
generators, then this is a list of nonnegative integers of
length $n$.

EXAMPLES:
    sage: F = FreeAbelianMonoid(5, 'abcde')
    sage: (a, b, c, d, e) = F.gens()
    sage: a.list()
    [1, 0, 0, 0, 0]