NZMATH
1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
![]() ![]() |
Public Member Functions | |
def | __init__ (self, coeffring, number_of_variables=1) |
def | getCoefficientRing (self) |
def | getQuotientField (self) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __hash__ (self) |
def | __repr__ (self) |
def | __str__ (self) |
def | __contains__ (self, element) |
def | issubring (self, other) |
def | issuperring (self, other) |
def | getCommonSuperring (self, other) |
def | getCharacteristic (self) |
def | createElement (self, seed) |
def | gcd (self, a, b) |
def | extgcd (self, a, b) |
def | getInstance (cls, coeffring, number_of_variables=1) |
![]() | |
def | __init__ (self) |
def | isdomain (self) |
def | isnoetherian (self) |
def | isufd (self) |
def | ispid (self) |
def | iseuclidean (self) |
def | isfield (self) |
def | registerModuleAction (self, action_ring, action) |
def | hasaction (self, action_ring) |
def | getaction (self, action_ring) |
Public Attributes | |
number_of_variables | |
![]() | |
properties | |
Properties | |
one = property(_get_one, None, None, "multiplicative unit") | |
zero = property(_get_zero, None, None, "additive unit") | |
Private Member Functions | |
def | _zero_polynomial (self) |
def | _constant_polynomial (self, seed) |
def | _prepared_polynomial (self, preparation) |
def | _get_one (self) |
def | _get_zero (self) |
Private Attributes | |
_coefficient_ring | |
_one | |
_zero | |
Static Private Attributes | |
dictionary | _instances = {} |
The class of uni-/multivariate polynomial ring. There's no need to specify the variable names.
def nzmath.poly.ring.PolynomialRing.__init__ | ( | self, | |
coeffring, | |||
number_of_variables = 1 |
|||
) |
def nzmath.poly.ring.PolynomialRing.__contains__ | ( | self, | |
element | |||
) |
`in' operator is provided for checking the element be in the ring.
Definition at line 93 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring.
def nzmath.poly.ring.PolynomialRing.__eq__ | ( | self, | |
other | |||
) |
equality test
Reimplemented from nzmath.ring.Ring.
Definition at line 55 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
Referenced by nzmath.poly.ring.PolynomialRing.__ne__(), nzmath.quad.ReducedQuadraticForm.__ne__(), nzmath.ring.Ring.__ne__(), nzmath.real.RealField.__ne__(), nzmath.ring.Ideal.__ne__(), and nzmath.prime.FactoredInteger.__ne__().
def nzmath.poly.ring.PolynomialRing.__hash__ | ( | self | ) |
hash(self)
Reimplemented from nzmath.ring.Ring.
Definition at line 73 of file ring.py.
References nzmath.matrix.Matrix.__class__, nzmath.matrix.RingMatrix.__class__, nzmath.matrix.RingSquareMatrix.__class__, nzmath.matrix.FieldMatrix.__class__, nzmath.matrix.MatrixRing.__class__, nzmath.matrix.Subspace.__class__, nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
def nzmath.poly.ring.PolynomialRing.__ne__ | ( | self, | |
other | |||
) |
not equal
Reimplemented from nzmath.ring.Ring.
Definition at line 67 of file ring.py.
References nzmath.group.Group.__eq__(), nzmath.poly.ratfunc.RationalFunction.__eq__(), nzmath.poly.multivar.TermIndices.__eq__(), nzmath.poly.ring.PolynomialRing.__eq__(), nzmath.poly.formalsum.FormalSumContainerInterface.__eq__(), nzmath.factor.misc.FactoredInteger.__eq__(), nzmath.imaginary.Complex.__eq__(), nzmath.poly.array.ArrayPoly.__eq__(), nzmath.group.GroupElement.__eq__(), nzmath.matrix.Matrix.__eq__(), nzmath.intresidue.IntegerResidueClass.__eq__(), nzmath.finitefield.FinitePrimeField.__eq__(), nzmath.imaginary.ComplexField.__eq__(), nzmath.poly.array.ArrayPolyMod.__eq__(), nzmath.module.Module.__eq__(), nzmath.permute.Permute.__eq__(), nzmath.intresidue.IntegerResidueClassRing.__eq__(), nzmath.poly.formalsum.DictFormalSum.__eq__(), nzmath.algfield.NumberField.__eq__(), nzmath.poly.formalsum.ListFormalSum.__eq__(), nzmath.poly.multiutil.PolynomialRingAnonymousVariables.__eq__(), nzmath.finitefield.ExtendedFieldElement.__eq__(), nzmath.permute.ExPermute.__eq__(), nzmath.permute.PermGroup.__eq__(), nzmath.finitefield.ExtendedField.__eq__(), and nzmath.matrix.MatrixRing.__eq__().
def nzmath.poly.ring.PolynomialRing.__repr__ | ( | self | ) |
Return 'PolynomialRing(Ring, #vars)'
Definition at line 79 of file ring.py.
References nzmath.matrix.Matrix.__class__, nzmath.matrix.RingMatrix.__class__, nzmath.matrix.RingSquareMatrix.__class__, nzmath.matrix.FieldMatrix.__class__, nzmath.matrix.MatrixRing.__class__, nzmath.matrix.Subspace.__class__, nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
def nzmath.poly.ring.PolynomialRing.__str__ | ( | self | ) |
Return R[][]
Definition at line 87 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
|
private |
Return a constant polynomial made from a constant seed. seed should not be zero.
Definition at line 190 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
Referenced by nzmath.poly.ring.PolynomialRing.createElement().
|
private |
Definition at line 215 of file ring.py.
References nzmath.imaginary.ComplexField._one, nzmath.poly.ring.PolynomialRing._one, nzmath.algfield.NumberField._one, nzmath.intresidue.IntegerResidueClassRing._one, nzmath.finitefield.FinitePrimeField._one, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._one, nzmath.finitefield.ExtendedField._one, and nzmath.matrix.MatrixRing._one.
|
private |
Definition at line 223 of file ring.py.
References nzmath.imaginary.ComplexField._zero, nzmath.poly.ring.PolynomialRing._zero, nzmath.intresidue.IntegerResidueClassRing._zero, nzmath.algfield.NumberField._zero, nzmath.finitefield.FinitePrimeField._zero, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._zero, nzmath.finitefield.ExtendedField._zero, and nzmath.matrix.MatrixRing._zero.
|
private |
Return a polynomial from given preparation, which is suited for the first argument of uni-/multi-variable polynomials.
Definition at line 203 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
Referenced by nzmath.poly.ring.PolynomialRing.createElement().
|
private |
Return the zero polynomial in the polynomial ring.
Definition at line 179 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
Referenced by nzmath.poly.ring.PolynomialRing.createElement().
def nzmath.poly.ring.PolynomialRing.createElement | ( | self, | |
seed | |||
) |
Return an element in the ring made from seed.
Reimplemented from nzmath.ring.Ring.
Definition at line 166 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing._constant_polynomial(), nzmath.poly.ring.PolynomialRing._prepared_polynomial(), and nzmath.poly.ring.PolynomialRing._zero_polynomial().
Referenced by nzmath.finitefield.FiniteField.random_element(), and nzmath.finitefield.FiniteField.TonelliShanks().
def nzmath.poly.ring.PolynomialRing.extgcd | ( | self, | |
a, | |||
b | |||
) |
def nzmath.poly.ring.PolynomialRing.gcd | ( | self, | |
a, | |||
b | |||
) |
Return the greatest common divisor of given polynomials. The polynomials must be in the polynomial ring. If the coefficient ring is a field, the result is monic.
Definition at line 231 of file ring.py.
Referenced by nzmath.rational.IntegerRing.lcm().
def nzmath.poly.ring.PolynomialRing.getCharacteristic | ( | self | ) |
Return characteristic of the ring.
Reimplemented from nzmath.ring.Ring.
Definition at line 160 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring.
def nzmath.poly.ring.PolynomialRing.getCoefficientRing | ( | self | ) |
Return the coefficient ring.
Definition at line 41 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring.
Referenced by nzmath.poly.uniutil.DomainPolynomial.discriminant(), nzmath.poly.uniutil.FieldPolynomial.discriminant(), nzmath.poly.multiutil.PseudoDivisionProvider.exact_division(), nzmath.poly.multiutil.GcdProvider.gcd(), nzmath.poly.multiutil.PseudoDivisionProvider.pseudo_divmod(), nzmath.poly.multiutil.PseudoDivisionProvider.pseudo_floordiv(), nzmath.poly.multiutil.PseudoDivisionProvider.pseudo_mod(), nzmath.poly.uniutil.SubresultantGcdProvider.resultant(), nzmath.poly.uniutil.FieldPolynomial.resultant(), nzmath.poly.uniutil.SubresultantGcdProvider.subresultant_extgcd(), and nzmath.poly.uniutil.DomainPolynomial.to_field_polynomial().
def nzmath.poly.ring.PolynomialRing.getCommonSuperring | ( | self, | |
other | |||
) |
Return common superring of two rings.
Reimplemented from nzmath.ring.Ring.
Definition at line 140 of file ring.py.
References nzmath.matrix.Matrix.__class__, nzmath.matrix.RingMatrix.__class__, nzmath.matrix.RingSquareMatrix.__class__, nzmath.matrix.FieldMatrix.__class__, nzmath.matrix.MatrixRing.__class__, nzmath.matrix.Subspace.__class__, nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.issuperring(), nzmath.imaginary.ComplexField.issuperring(), nzmath.finitefield.FinitePrimeField.issuperring(), nzmath.algfield.NumberField.issuperring(), nzmath.intresidue.IntegerResidueClassRing.issuperring(), nzmath.poly.multiutil.PolynomialRingAnonymousVariables.issuperring(), nzmath.finitefield.ExtendedField.issuperring(), nzmath.matrix.MatrixRing.issuperring(), nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
def nzmath.poly.ring.PolynomialRing.getInstance | ( | cls, | |
coeffring, | |||
number_of_variables = 1 |
|||
) |
Return an instance of the class with specified coefficient ring and number of variables.
Definition at line 255 of file ring.py.
References nzmath.poly.ring.PolynomialRing._instances, nzmath.finitefield.FinitePrimeField._instances, nzmath.intresidue.IntegerResidueClassRing._instances, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._instances, and nzmath.matrix.MatrixRing._instances.
def nzmath.poly.ring.PolynomialRing.getQuotientField | ( | self | ) |
Return the quotient field of the ring if coefficient ring has its quotient field. Otherwise, an exception will be raised.
Reimplemented from nzmath.ring.CommutativeRing.
Definition at line 47 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
def nzmath.poly.ring.PolynomialRing.issubring | ( | self, | |
other | |||
) |
reports whether another ring contains this polynomial ring.
Reimplemented from nzmath.ring.Ring.
Definition at line 105 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
Referenced by nzmath.ring.Ring.getCommonSuperring(), nzmath.rational.RationalField.getCommonSuperring(), and nzmath.rational.IntegerRing.getCommonSuperring().
def nzmath.poly.ring.PolynomialRing.issuperring | ( | self, | |
other | |||
) |
reports whether this polynomial ring contains another ring.
Reimplemented from nzmath.ring.Ring.
Definition at line 123 of file ring.py.
References nzmath.poly.ring.PolynomialRing._coefficient_ring, nzmath.poly.multiutil.RingElementProvider._coefficient_ring, nzmath.poly.multiutil.PolynomialRingAnonymousVariables._coefficient_ring, nzmath.poly.ring.PolynomialRing.number_of_variables, nzmath.poly.ratfunc.RationalFunction.number_of_variables, nzmath.poly.multiutil.NestProvider.number_of_variables, nzmath.poly.multivar.BasicPolynomial.number_of_variables, and nzmath.poly.multiutil.PolynomialRingAnonymousVariables.number_of_variables.
Referenced by nzmath.ring.Ring.getCommonSuperring(), nzmath.poly.ring.PolynomialRing.getCommonSuperring(), nzmath.poly.ring.RationalFunctionField.getCommonSuperring(), nzmath.rational.RationalField.getCommonSuperring(), nzmath.rational.IntegerRing.getCommonSuperring(), nzmath.real.RealField.issubring(), and nzmath.poly.ring.RationalFunctionField.issuperring().
|
private |
Definition at line 30 of file ring.py.
Referenced by nzmath.poly.ring.PolynomialRing.__contains__(), nzmath.poly.ring.PolynomialRing.__eq__(), nzmath.poly.uniutil.RingPolynomial.__getitem__(), nzmath.poly.ring.PolynomialRing.__hash__(), nzmath.poly.ring.PolynomialRing.__repr__(), nzmath.poly.uniutil.RingPolynomial.__repr__(), nzmath.poly.ring.PolynomialRing.__str__(), nzmath.poly.ring.PolynomialRing._constant_polynomial(), nzmath.poly.ring.PolynomialRing._prepared_polynomial(), nzmath.poly.ring.PolynomialRing._zero_polynomial(), nzmath.poly.ring.PolynomialRing.createElement(), nzmath.poly.ring.PolynomialRing.getCharacteristic(), nzmath.poly.ring.PolynomialRing.getCoefficientRing(), nzmath.poly.uniutil.RingPolynomial.getCoefficientRing(), nzmath.poly.ring.PolynomialRing.getCommonSuperring(), nzmath.poly.ring.PolynomialRing.getQuotientField(), nzmath.poly.uniutil.RingElementProvider.getRing(), nzmath.poly.uniutil.RingPolynomial.ismonic(), nzmath.poly.ring.PolynomialRing.issubring(), nzmath.poly.ring.PolynomialRing.issuperring(), and nzmath.poly.uniutil.RingElementProvider.set_coefficient_ring().
|
staticprivate |
Definition at line 18 of file ring.py.
Referenced by nzmath.poly.ring.PolynomialRing.getInstance(), and nzmath.poly.ring.RationalFunctionField.getInstance().
|
private |
Definition at line 218 of file ring.py.
Referenced by nzmath.poly.ring.PolynomialRing._get_one(), nzmath.poly.ring.RationalFunctionField._get_one(), nzmath.real.RealField._getOne(), nzmath.ring.ResidueClassRing._getOne(), nzmath.rational.RationalField._getOne(), and nzmath.rational.IntegerRing._getOne().
|
private |
Definition at line 226 of file ring.py.
Referenced by nzmath.poly.ring.PolynomialRing._get_zero(), nzmath.poly.ring.RationalFunctionField._get_zero(), nzmath.real.RealField._getZero(), nzmath.ring.ResidueClassRing._getZero(), nzmath.rational.RationalField._getZero(), and nzmath.rational.IntegerRing._getZero().
nzmath.poly.ring.PolynomialRing.number_of_variables |
Definition at line 39 of file ring.py.
Referenced by nzmath.poly.ring.PolynomialRing.__eq__(), nzmath.poly.ring.RationalFunctionField.__eq__(), nzmath.poly.ring.PolynomialRing.__hash__(), nzmath.poly.ring.RationalFunctionField.__hash__(), nzmath.poly.ring.PolynomialRing.__repr__(), nzmath.poly.ring.RationalFunctionField.__repr__(), nzmath.poly.ring.PolynomialRing.__str__(), nzmath.poly.ring.RationalFunctionField.__str__(), nzmath.poly.ring.PolynomialRing._constant_polynomial(), nzmath.poly.ring.PolynomialRing._prepared_polynomial(), nzmath.poly.ring.PolynomialRing._zero_polynomial(), nzmath.poly.ring.PolynomialRing.getCommonSuperring(), nzmath.poly.ring.RationalFunctionField.getCommonSuperring(), nzmath.poly.ring.PolynomialRing.getQuotientField(), nzmath.poly.ring.PolynomialRing.issubring(), nzmath.poly.ring.RationalFunctionField.issubring(), nzmath.poly.ring.PolynomialRing.issuperring(), nzmath.poly.ring.RationalFunctionField.issuperring(), nzmath.poly.multiutil.RingElementProvider.set_coefficient_ring(), and nzmath.poly.ring.RationalFunctionField.unnest().
|
static |
Definition at line 221 of file ring.py.
Referenced by nzmath.ring.Field.gcd(), nzmath.finitefield.FiniteField.Legendre(), nzmath.finitefield.FiniteField.order(), nzmath.finitefield.FiniteField.sqrt(), and nzmath.finitefield.FiniteField.TonelliShanks().
|
static |
Definition at line 229 of file ring.py.
Referenced by nzmath.ring.Field.gcd().