Package sage :: Package structure :: Module element :: Class RingElement
[hide private]
[frames] | no frames]

Class RingElement



            object --+            
                     |            
sage_object.SageObject --+        
                         |        
                   Element --+    
                             |    
                 ModuleElement --+
                                 |
                                RingElement
Known Subclasses:
CommutativeRingElement, functions.functions.Function, interfaces.expect.ExpectElement, libs.pari.gen.gen, rings.real_mpfr.RealNumber, AlgebraElement, rings.real_mpfi.RealIntervalFieldElement, rings.infinity.FiniteNumber, rings.infinity.LessThanInfinity, InfinityElement, rings.pari_ring.Pari, rings.quotient_ring_element.QuotientRingElement, calculus.calculus.SymbolicExpression

Instance Methods [hide private]
 
__div__(...)
File: sage/structure/element.pyx (starting at line 1471) Top-level multiplication operator for ring elements.
 
__idiv__(...)
File: sage/structure/element.pyx (starting at line 1516) Top-level division operator for ring elements.
 
__imul__(...)
File: sage/structure/element.pyx (starting at line 1402)
 
__invert__(...)
File: sage/structure/element.pyx (starting at line 1538)
 
__mul__(...)
File: sage/structure/element.pyx (starting at line 1254) Top-level multiplication operator for ring elements.
 
__new__(T, S, ...)
 
__pos__(...)
File: sage/structure/element.pyx (starting at line 1535)
 
__pow__(x, y, z=...)
pow(x, y[, z])
 
__rdiv__(x, y)
y/x
 
__rmul__(x, y)
y*x
 
__rpow__(y, x, z=...)
pow(x, y[, z])
 
__rtruediv__(x, y)
y/x
 
__truediv__(...)
File: sage/structure/element.pyx (starting at line 1465)
 
_div_(...)
File: sage/structure/element.pyx (starting at line 1510) Python classes should override this function to implement division.
 
_idiv_(...)
File: sage/structure/element.pyx (starting at line 1529)
 
_imul_(...)
File: sage/structure/element.pyx (starting at line 1414)
 
_mul_(...)
File: sage/structure/element.pyx (starting at line 1395) Python classes should override this function to implement multiplication.
 
abs(...)
File: sage/structure/element.pyx (starting at line 1580) Return the absolute value of self.
 
additive_order(...)
File: sage/structure/element.pyx (starting at line 1549) Return the additive order of self.
 
is_nilpotent(...)
File: sage/structure/element.pyx (starting at line 1569) Return True if self is nilpotent, i.e., some power of self is 0.
 
is_one(...)
File: sage/structure/element.pyx (starting at line 1239)
 
is_unit(...)
File: sage/structure/element.pyx (starting at line 1564)
 
multiplicative_order(...)
File: sage/structure/element.pyx (starting at line 1555) Return the multiplicative order of self, if self is a unit, or raise \code{ArithmeticError} otherwise.
 
order(...)
File: sage/structure/element.pyx (starting at line 1543) Return the additive order of self.

Inherited from ModuleElement: __add__, __iadd__, __isub__, __neg__, __radd__, __rsub__, __sub__, _add_, _iadd_, _ilmul_, _isub_, _lmul_, _neg_, _rmul_, _sub_

Inherited from ModuleElement (private): _lmul_nonscalar, _rmul_nonscalar

Inherited from Element: __cmp__, __eq__, __ge__, __gt__, __hash__, __init__, __le__, __lt__, __ne__, __nonzero__, __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 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]

__div__(...)

 
File: sage/structure/element.pyx (starting at line 1471)

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

__idiv__(...)

 
File: sage/structure/element.pyx (starting at line 1516)

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

__imul__(...)

 
File: sage/structure/element.pyx (starting at line 1402)

Overrides: ModuleElement.__imul__

__mul__(...)

 
File: sage/structure/element.pyx (starting at line 1254)

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

AUTHOR:

    Gonzalo Tornaria (2007-06-25) - write base-extending test cases and fix them

TEST CASES:

    (scalar * vector)

    sage: x, y = var('x, y')

    sage: parent(ZZ(1)*vector(ZZ,[1,2]))
    Ambient free module of rank 2 over the principal ideal domain Integer Ring
    sage: parent(QQ(1)*vector(ZZ,[1,2]))
    Vector space of dimension 2 over Rational Field
    sage: parent(ZZ(1)*vector(QQ,[1,2]))
    Vector space of dimension 2 over Rational Field
    sage: parent(QQ(1)*vector(QQ,[1,2]))
    Vector space of dimension 2 over Rational Field

    sage: parent(QQ(1)*vector(ZZ[x],[1,2]))
    Ambient free module of rank 2 over the principal ideal domain Univariate Polynomial Ring in x over Rational Field
    sage: parent(ZZ[x](1)*vector(QQ,[1,2]))
    Ambient free module of rank 2 over the principal ideal domain Univariate Polynomial Ring in x over Rational Field

    sage: parent(QQ(1)*vector(ZZ[x][y],[1,2]))
    Ambient free module of rank 2 over the integral domain Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field
    sage: parent(ZZ[x][y](1)*vector(QQ,[1,2]))
    Ambient free module of rank 2 over the integral domain Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field

    sage: parent(QQ[x](1)*vector(ZZ[x][y],[1,2]))
    Ambient free module of rank 2 over the integral domain Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field
    sage: parent(ZZ[x][y](1)*vector(QQ[x],[1,2]))
    Ambient free module of rank 2 over the integral domain Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field

    sage: parent(QQ[y](1)*vector(ZZ[x][y],[1,2]))
    Ambient free module of rank 2 over the integral domain Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field
    sage: parent(ZZ[x][y](1)*vector(QQ[y],[1,2]))
    Ambient free module of rank 2 over the integral domain Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field

    sage: parent(ZZ[x](1)*vector(ZZ[y],[1,2]))
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in x over Integer Ring' and 'Ambient free module of rank 2 over the integral domain Univariate Polynomial Ring in y over Integer Ring'
    sage: parent(ZZ[x](1)*vector(QQ[y],[1,2]))
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in x over Integer Ring' and 'Ambient free module of rank 2 over the principal ideal domain Univariate Polynomial Ring in y over Rational Field'
    sage: parent(QQ[x](1)*vector(ZZ[y],[1,2]))
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in x over Rational Field' and 'Ambient free module of rank 2 over the integral domain Univariate Polynomial Ring in y over Integer Ring'
    sage: parent(QQ[x](1)*vector(QQ[y],[1,2]))
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in x over Rational Field' and 'Ambient free module of rank 2 over the principal ideal domain Univariate Polynomial Ring in y over Rational Field'

    (scalar * matrix)

    sage: parent(ZZ(1)*matrix(ZZ,2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Integer Ring
    sage: parent(QQ(1)*matrix(ZZ,2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Rational Field
    sage: parent(ZZ(1)*matrix(QQ,2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Rational Field
    sage: parent(QQ(1)*matrix(QQ,2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Rational Field

    sage: parent(QQ(1)*matrix(ZZ[x],2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational Field
    sage: parent(ZZ[x](1)*matrix(QQ,2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational Field

    sage: parent(QQ(1)*matrix(ZZ[x][y],2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field
    sage: parent(ZZ[x][y](1)*matrix(QQ,2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field

    sage: parent(QQ[x](1)*matrix(ZZ[x][y],2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field
    sage: parent(ZZ[x][y](1)*matrix(QQ[x],2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field

    sage: parent(QQ[y](1)*matrix(ZZ[x][y],2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field
    sage: parent(ZZ[x][y](1)*matrix(QQ[y],2,2,[1,2,3,4]))
    Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field

    sage: parent(ZZ[x](1)*matrix(ZZ[y],2,2,[1,2,3,4]))
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in x over Integer Ring' and 'Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Integer Ring'
    sage: parent(ZZ[x](1)*matrix(QQ[y],2,2,[1,2,3,4]))
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in x over Integer Ring' and 'Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Rational Field'
    sage: parent(QQ[x](1)*matrix(ZZ[y],2,2,[1,2,3,4]))
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in x over Rational Field' and 'Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Integer Ring'
    sage: parent(QQ[x](1)*matrix(QQ[y],2,2,[1,2,3,4]))
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in x over Rational Field' and 'Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in y over Rational Field'

Overrides: ModuleElement.__mul__

__new__(T, S, ...)

 


Returns:
a new object with type S, a subtype of T

Overrides: ModuleElement.__new__

__rmul__(x, y)

 
y*x

Overrides: ModuleElement.__rmul__

_mul_(...)

 
File: sage/structure/element.pyx (starting at line 1395)

Python classes should override this function to implement multiplication.
See extensive documentation at the top of element.pyx.        

abs(...)

 
File: sage/structure/element.pyx (starting at line 1580)

Return the absolute value of self.  (This just calls the __abs__
method, so it is equivalent to the abs() built-in function.)

EXAMPLES:
    sage: RR(-1).abs()
    1.00000000000000
    sage: ZZ(-1).abs()
    1
    sage: CC(I).abs()
    1.00000000000000
    sage: Mod(-15, 37).abs()
    Traceback (most recent call last):
    ...
    ArithmeticError: absolute valued not defined on integers modulo n.

additive_order(...)

 
File: sage/structure/element.pyx (starting at line 1549)

Return the additive order of self.

Overrides: ModuleElement.additive_order

order(...)

 
File: sage/structure/element.pyx (starting at line 1543)

Return the additive order of self.

Overrides: ModuleElement.order