Package sympycore :: Package polynomials :: Module algebra :: Class PolynomialRing
[hide private]
[frames] | no frames]

Class PolynomialRing

source code


Base class to polynomial rings that holds polynomial information using pairs (<exponents>: <coefficient>) stored in Python dictionary.

Suitable for representing sparse multivariate polynomials.



Nested Classes [hide private]
  __metaclass__
Factory of polynomial rings with symbols and coefficient ring.
  ring
Represents an element of a symbolic algebra.
Instance Methods [hide private]
 
__add__(self, other) source code
call graph 
 
__call__(self, *args) source code
call graph 
 
__div__(self, other) source code
call graph 
 
__divmod__(self, other) source code
call graph 
 
__eq__(self, other) source code
call graph 
 
__mod__(self, other) source code
call graph 
 
__mul__(self, other) source code
 
__neg__(self) source code
call graph 
 
__pow__(self, other) source code
call graph 
 
__rmul__(self, other) source code
 
as_algebra(self, target_cls)
Convert algebra to another algebra.
source code
 
as_primitive(self) source code
call graph 
 
diff(self, index=0) source code
call graph 

Inherited from basealgebra.ring.CommutativeRing: __pos__, __radd__, __rdiv__, __rpow__, __rsub__, __rtruediv__, __sub__, __truediv__, as_Add_args, as_Factors_args, as_Log_args, as_Mul_args, as_Pow_args, as_Terms_args

Inherited from basealgebra.ring.CommutativeRing (private): _matches

Inherited from basealgebra.algebra.BasicAlgebra: __repr__, __str__, as_primitve, as_tree, has, match, matches, subs

Inherited from basealgebra.algebra.BasicAlgebra (private): _subs

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]
 
Add(cls, *seq)
Compute sum over seq containing algebra elements.
source code
call graph 
 
Mul(cls, *seq)
Compute product over seq containing algebra elements.
source code
call graph 
 
Number(cls, obj)
Return number element of a polynomial ring.
source code
call graph 
 
Pow(cls, base, exp)
Compute power from base and exponent.
source code
call graph 
 
Symbol(cls, obj)
Return symbol element of a polynomial ring.
source code
call graph 
 
convert_coefficient(cls, obj, typeerror=True)
Convert obj to coefficient algebra.
source code
call graph 

Inherited from basealgebra.ring.CommutativeRing: Div, Factors, Log, Sub, Terms

Inherited from basealgebra.algebra.BasicAlgebra: convert, convert_exponent, get_predefined_symbols

Static Methods [hide private]
 
__new__(cls, data={})
Returns: a new object with type S, a subtype of T
source code
call graph 
Class Variables [hide private]
  _degree = None
  _ldegree = None
  nvars = 0
  one = PolynomialRing('1')
  variables = ()
  zero = PolynomialRing('0')

Inherited from basealgebra.ring.CommutativeRing (private): _symbols

Inherited from basealgebra.algebra.BasicAlgebra (private): _str_value

Properties [hide private]
  coeff
  data
  degree
  ldegree

Inherited from basealgebra.algebra.BasicAlgebra: args, func, symbols

Inherited from object: __class__

Method Details [hide private]

Add(cls, *seq)
Class Method

source code 
call graph 
Compute sum over seq containing algebra elements.
Overrides: basealgebra.ring.CommutativeRing.Add
(inherited documentation)

Mul(cls, *seq)
Class Method

source code 
call graph 
Compute product over seq containing algebra elements.
Overrides: basealgebra.ring.CommutativeRing.Mul
(inherited documentation)

Number(cls, obj)
Class Method

source code 
call graph 

Return number element of a polynomial ring.

Examples:

r = PolynomialRing['x']
r.Number(2) -> r({0:2})
Overrides: basealgebra.algebra.BasicAlgebra.Number

Pow(cls, base, exp)
Class Method

source code 
call graph 

Compute power from base and exponent.

Argument base must be an algebra element and exponent must be an element of exponent algebra.

Overrides: basealgebra.ring.CommutativeRing.Pow
(inherited documentation)

Symbol(cls, obj)
Class Method

source code 
call graph 

Return symbol element of a polynomial ring. The result may be an instance of a super polynomial ring.

Examples:

r = PolynomialRing['x']
r.Symbol('x') -> r({1:1})
r.Symbol('y') -> PolynomialRing['x','y']({(0,1):1})
Overrides: basealgebra.algebra.BasicAlgebra.Symbol

__add__(self, other)
(Addition operator)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__add__

__div__(self, other)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__div__

__mul__(self, other)

source code 
Overrides: basealgebra.ring.CommutativeRing.__mul__

__neg__(self)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__neg__

__new__(cls, data={})
Static Method

source code 
call graph 
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__
(inherited documentation)

__pow__(self, other)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__pow__

__rmul__(self, other)

source code 
Overrides: basealgebra.ring.CommutativeRing.__rmul__

as_algebra(self, target_cls)

source code 

Convert algebra to another algebra.

This method uses default conversation via primitive algebra that might not be the most efficient. For efficiency, algebras should redefine this method to implement direct conversation.

Overrides: basealgebra.algebra.BasicAlgebra.as_algebra
(inherited documentation)

convert_coefficient(cls, obj, typeerror=True)
Class Method

source code 
call graph 
Convert obj to coefficient algebra.
Overrides: basealgebra.algebra.BasicAlgebra.convert_coefficient
(inherited documentation)

Property Details [hide private]

coeff

Get Method:
unreachable.coeff(self)

degree

Get Method:
unreachable.degree(self)

ldegree

Get Method:
unreachable.ldegree(self)