NZMATH
1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
![]() ![]() |
Public Member Functions | |
def | __init__ (self, row, column=0, compo=0, coeff_ring=0) |
def | __pow__ (self, other) |
def | toFieldMatrix (self) |
def | getRing (self) |
def | isOrthogonalMatrix (self) |
def | isAlternatingMatrix (self) |
def | isSingular (self) |
def | trace (self) |
def | determinant (self) |
def | cofactor (self, i, j) |
def | commutator (self, other) |
def | characteristicMatrix (self) |
def | characteristicPolynomial (self) |
def | adjugateMatrix (self) |
def | cofactorMatrix (self) |
def | smithNormalForm (self) |
def | extsmithNormalForm (self) |
![]() | |
def | isUpperTriangularMatrix (self) |
def | isLowerTriangularMatrix (self) |
def | isDiagonalMatrix (self) |
def | isScalarMatrix (self) |
def | isSymmetricMatrix (self) |
![]() | |
def | __getitem__ (self, index) |
def | __setitem__ (self, key, value) |
def | __eq__ (self, other) |
def | __hash__ (self) |
def | __ne__ (self, other) |
def | __nonzero__ (self) |
def | __contains__ (self, item) |
def | __repr__ (self) |
def | __str__ (self) |
def | __call__ (self, arg) |
def | map (self, function) |
def | reduce (self, function, initializer=None) |
def | copy (self) |
def | set (self, compo) |
def | setRow (self, m, arg) |
def | setColumn (self, n, arg) |
def | getRow (self, i) |
def | getColumn (self, j) |
def | swapRow (self, m1, m2) |
def | swapColumn (self, n1, n2) |
def | insertRow (self, i, arg) |
def | insertColumn (self, j, arg) |
def | extendRow (self, arg) |
def | extendColumn (self, arg) |
def | deleteRow (self, i) |
def | deleteColumn (self, j) |
def | transpose (self) |
def | getBlock (self, i, j, row, column=None) |
def | subMatrix (self, I, J=None) |
def | toMatrix (self, flag=True) |
![]() | |
def | __add__ (self, other) |
def | __sub__ (self, other) |
def | __mul__ (self, other) |
def | __rmul__ (self, other) |
def | __mod__ (self, other) |
def | __pos__ (self) |
def | __neg__ (self) |
def | getCoefficientRing (self) |
def | toSubspace (self, isbasis=None) |
def | hermiteNormalForm (self, non_zero=False) |
def | exthermiteNormalForm (self, non_zero=False) |
def | kernelAsModule (self) |
![]() | |
def | __init__ (self, *args, **kwd) |
def | __eq__ (self, other) |
def | __hash__ (self) |
def | __ne__ (self, other) |
Public Attributes | |
coeff_ring | |
row | |
![]() | |
row | |
column | |
compo | |
coeff_ring | |
![]() | |
row | |
coeff_ring | |
Static Public Attributes | |
def | isAntisymmetricMatrix = isAlternatingMatrix |
def | isSkewsymmetricMatrix = isAlternatingMatrix |
def | cofactors = cofactorMatrix |
def | SNF = smithNormalForm |
def | elementary_divisor = smithNormalForm |
def | extSNF = extsmithNormalForm |
![]() | |
def | HNF = hermiteNormalForm |
def | extHNF = exthermiteNormalForm |
Private Member Functions | |
def | _characteristicPolyList (self) |
Private Attributes | |
__class__ | |
RingSquareMatrix is a class for square matrices whose elements are in ring.
def nzmath.matrix.RingSquareMatrix.__init__ | ( | self, | |
row, | |||
column = 0 , |
|||
compo = 0 , |
|||
coeff_ring = 0 |
|||
) |
RingSquareMatrix(row [, column ,components, coeff_ring]) RingSquareMatrix must be row == column .
Reimplemented from nzmath.matrix.SquareMatrix.
Reimplemented in nzmath.matrix.FieldSquareMatrix.
Definition at line 865 of file matrix.py.
References nzmath.matrix.Matrix._initialize().
def nzmath.matrix.RingSquareMatrix.__pow__ | ( | self, | |
other | |||
) |
powering self to integer.
Definition at line 872 of file matrix.py.
References nzmath.matrix.Matrix.coeff_ring, nzmath.factor.misc.FactoredInteger.copy(), nzmath.imaginary.Complex.copy(), nzmath.matrix.Matrix.copy(), nzmath.quad.ReducedQuadraticForm.inverse(), nzmath.permute.Permute.inverse(), nzmath.imaginary.Complex.inverse(), nzmath.intresidue.IntegerResidueClass.inverse(), nzmath.group.GroupElement.inverse(), nzmath.permute.ExPermute.inverse(), nzmath.algfield.BasicAlgNumber.inverse(), nzmath.ring.QuotientFieldElement.inverse(), nzmath.finitefield.ExtendedFieldElement.inverse(), nzmath.module.Ideal.inverse(), nzmath.algfield.MatAlgNumber.inverse(), nzmath.rational.Integer.inverse(), nzmath.matrix.FieldSquareMatrix.inverse(), nzmath.matrix.Matrix.row, nzmath.lattice.LatticeElement.row, and nzmath.matrix.unitMatrix().
|
private |
for characteristicPolynomial, adjugateMatrix Assume self.row >= 2.
Definition at line 1003 of file matrix.py.
References nzmath.matrix.Matrix.coeff_ring, nzmath.matrix.Matrix.row, nzmath.lattice.LatticeElement.row, nzmath.finitefield.ExtendedFieldElement.trace(), nzmath.algfield.BasicAlgNumber.trace(), nzmath.algfield.MatAlgNumber.trace(), nzmath.matrix.RingSquareMatrix.trace(), nzmath.elliptic.ECoverGF.trace(), and nzmath.matrix.unitMatrix().
Referenced by nzmath.matrix.RingSquareMatrix.adjugateMatrix().
def nzmath.matrix.RingSquareMatrix.adjugateMatrix | ( | self | ) |
Return adjugate(classical adjoint) matrix.
Definition at line 1034 of file matrix.py.
References nzmath.matrix.RingSquareMatrix._characteristicPolyList(), nzmath.matrix.Matrix.coeff_ring, nzmath.matrix.Matrix.row, nzmath.lattice.LatticeElement.row, and nzmath.matrix.unitMatrix().
Referenced by nzmath.matrix.RingSquareMatrix.cofactorMatrix().
def nzmath.matrix.RingSquareMatrix.characteristicMatrix | ( | self | ) |
Return the characteristic matrix (i.e. xI-A) of self.
Definition at line 995 of file matrix.py.
References nzmath.matrix.Matrix.coeff_ring, nzmath.matrix.Matrix.row, nzmath.lattice.LatticeElement.row, and nzmath.matrix.unitMatrix().
def nzmath.matrix.RingSquareMatrix.characteristicPolynomial | ( | self | ) |
def nzmath.matrix.RingSquareMatrix.cofactor | ( | self, | |
i, | |||
j | |||
) |
Return (i, j)-cofactor of self.
Definition at line 979 of file matrix.py.
References nzmath.matrix.RingSquareMatrix.determinant(), and nzmath.matrix.Matrix.subMatrix().
def nzmath.matrix.RingSquareMatrix.cofactorMatrix | ( | self | ) |
Return cofactor matrix.
Definition at line 1046 of file matrix.py.
References nzmath.matrix.RingSquareMatrix.adjugateMatrix(), and nzmath.matrix.Matrix.transpose().
def nzmath.matrix.RingSquareMatrix.commutator | ( | self, | |
other | |||
) |
def nzmath.matrix.RingSquareMatrix.determinant | ( | self | ) |
Return determinant of self.
Reimplemented in nzmath.matrix.FieldSquareMatrix.
Definition at line 946 of file matrix.py.
References nzmath.matrix.Matrix.coeff_ring, nzmath.factor.misc.FactoredInteger.copy(), nzmath.imaginary.Complex.copy(), nzmath.matrix.Matrix.copy(), nzmath.bigrange.range(), nzmath.matrix.Matrix.row, and nzmath.lattice.LatticeElement.row.
Referenced by nzmath.matrix.RingSquareMatrix.cofactor(), and nzmath.matrix.RingSquareMatrix.isSingular().
def nzmath.matrix.RingSquareMatrix.extsmithNormalForm | ( | self | ) |
Find the Smith Normal Form M for square matrix, Computing U,V which satisfied M=U*self*V. Return matrices tuple,(U,V,M).
Definition at line 1116 of file matrix.py.
References nzmath.matrix.Matrix.coeff_ring, nzmath.factor.misc.FactoredInteger.copy(), nzmath.imaginary.Complex.copy(), nzmath.matrix.Matrix.copy(), nzmath.bigrange.range(), and nzmath.matrix.unitMatrix().
def nzmath.matrix.RingSquareMatrix.getRing | ( | self | ) |
Return matrix ring of self.
Reimplemented from nzmath.ring.RingElement.
Definition at line 904 of file matrix.py.
References nzmath.matrix.RingMatrix.getCoefficientRing(), nzmath.matrix.Matrix.row, and nzmath.lattice.LatticeElement.row.
Referenced by nzmath.poly.multiutil.RingPolynomial.__add__(), nzmath.ring.QuotientFieldElement.__add__(), nzmath.poly.uniutil.RingPolynomial.__add__(), nzmath.ring.QuotientFieldElement.__eq__(), nzmath.poly.uniutil.FieldPolynomial.__pow__(), nzmath.poly.multiutil.RingPolynomial.__radd__(), nzmath.poly.uniutil.RingPolynomial.__radd__(), nzmath.poly.multiutil.RingPolynomial.__rsub__(), nzmath.ring.QuotientFieldElement.__rsub__(), nzmath.poly.uniutil.RingPolynomial.__rsub__(), nzmath.ring.QuotientFieldElement.__rtruediv__(), nzmath.poly.multiutil.RingPolynomial.__sub__(), nzmath.ring.QuotientFieldElement.__sub__(), nzmath.poly.uniutil.RingPolynomial.__sub__(), nzmath.ring.QuotientFieldElement.__truediv__(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider._small_index_mod_pow(), nzmath.ring.CommutativeRingElement.exact_division(), nzmath.poly.uniutil.DivisionProvider.extgcd(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.factor(), nzmath.poly.uniutil.DivisionProvider.mod_pow(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.mod_pow(), nzmath.poly.uniutil.PseudoDivisionProvider.monic_pow(), nzmath.ring.CommutativeRingElement.mul_module_action(), and nzmath.poly.uniutil.SubresultantGcdProvider.subresultant_gcd().
def nzmath.matrix.RingSquareMatrix.isAlternatingMatrix | ( | self | ) |
Check whether self is alternating matrix or not. Alternating (skew symmetric, or antisymmetric) matrix satisfies M=-M^T.
Definition at line 917 of file matrix.py.
References nzmath.matrix.Matrix.column, nzmath.lattice.LatticeElement.column, nzmath.bigrange.range(), nzmath.matrix.Matrix.row, and nzmath.lattice.LatticeElement.row.
def nzmath.matrix.RingSquareMatrix.isOrthogonalMatrix | ( | self | ) |
Check whether self is orthogonal matrix or not. Orthogonal matrix satisfies M*M^T equals unit matrix.
Definition at line 910 of file matrix.py.
References nzmath.matrix.Matrix.coeff_ring, nzmath.matrix.Matrix.row, nzmath.lattice.LatticeElement.row, nzmath.matrix.Matrix.transpose(), nzmath.factor.mpqs.Elimination.transpose(), and nzmath.matrix.unitMatrix().
def nzmath.matrix.RingSquareMatrix.isSingular | ( | self | ) |
Check determinant == 0 or not.
Definition at line 931 of file matrix.py.
References nzmath.matrix.RingSquareMatrix.determinant().
def nzmath.matrix.RingSquareMatrix.smithNormalForm | ( | self | ) |
Find the Smith Normal Form for square non-singular integral matrix. Return the list of diagonal elements.
Definition at line 1054 of file matrix.py.
References nzmath.matrix.Matrix.coeff_ring, nzmath.factor.misc.FactoredInteger.copy(), nzmath.imaginary.Complex.copy(), nzmath.matrix.Matrix.copy(), and nzmath.bigrange.range().
def nzmath.matrix.RingSquareMatrix.toFieldMatrix | ( | self | ) |
RingSquareMatrix -> FieldSquareMatrix
Reimplemented from nzmath.matrix.RingMatrix.
def nzmath.matrix.RingSquareMatrix.trace | ( | self | ) |
Return trace of self.
Definition at line 937 of file matrix.py.
References nzmath.matrix.Matrix.coeff_ring, nzmath.bigrange.range(), nzmath.matrix.Matrix.row, and nzmath.lattice.LatticeElement.row.
Referenced by nzmath.matrix.RingSquareMatrix._characteristicPolyList().
|
private |
Definition at line 901 of file matrix.py.
Referenced by nzmath.imaginary.Complex.__add__(), nzmath.vector.Vector.__add__(), nzmath.real.Real.__add__(), nzmath.poly.multivar.TermIndices.__add__(), nzmath.intresidue.IntegerResidueClass.__add__(), nzmath.module.Module.__add__(), nzmath.ring.QuotientFieldElement.__add__(), nzmath.ring.Ideal.__add__(), nzmath.ring.ResidueClass.__add__(), nzmath.poly.multivar.BasicPolynomial.__call__(), nzmath.imaginary.Complex.__div__(), nzmath.intresidue.IntegerResidueClass.__div__(), nzmath.quad.ReducedQuadraticForm.__eq__(), nzmath.real.RealField.__eq__(), nzmath.poly.multivar.TermIndices.__hash__(), nzmath.poly.ring.PolynomialRing.__hash__(), nzmath.rational.Rational.__hash__(), nzmath.poly.multivar.BasicPolynomial.__hash__(), nzmath.poly.multiutil.PolynomialRingAnonymousVariables.__hash__(), nzmath.poly.multiutil.OrderProvider.__init__(), nzmath.poly.termorder.TermOrderInterface.__init__(), nzmath.poly.uniutil.OrderProvider.__init__(), nzmath.poly.uniutil.DivisionProvider.__init__(), nzmath.poly.multiutil.RingElementProvider.__init__(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.__init__(), nzmath.poly.uniutil.VariableProvider.__init__(), nzmath.poly.uniutil.RingElementProvider.__init__(), nzmath.vector.Vector.__mod__(), nzmath.quad.ReducedQuadraticForm.__mul__(), nzmath.intresidue.IntegerResidueClass.__mul__(), nzmath.vector.Vector.__mul__(), nzmath.imaginary.Complex.__mul__(), nzmath.real.Real.__mul__(), nzmath.factor.misc.FactoredInteger.__mul__(), nzmath.poly.multivar.TermIndices.__mul__(), nzmath.ring.QuotientFieldElement.__mul__(), nzmath.ring.Ideal.__mul__(), nzmath.ring.ResidueClass.__mul__(), nzmath.prime.FactoredInteger.__mul__(), nzmath.rational.Integer.__mul__(), nzmath.vector.Vector.__neg__(), nzmath.intresidue.IntegerResidueClass.__neg__(), nzmath.imaginary.Complex.__neg__(), nzmath.ring.QuotientFieldElement.__neg__(), nzmath.imaginary.Complex.__pos__(), nzmath.intresidue.IntegerResidueClass.__pos__(), nzmath.ring.ResidueClass.__pos__(), nzmath.quad.ReducedQuadraticForm.__pow__(), nzmath.factor.misc.FactoredInteger.__pow__(), nzmath.permute.Permute.__pow__(), nzmath.imaginary.Complex.__pow__(), nzmath.intresidue.IntegerResidueClass.__pow__(), nzmath.ring.QuotientFieldElement.__pow__(), nzmath.finitefield.ExtendedFieldElement.__pow__(), nzmath.prime.FactoredInteger.__pow__(), nzmath.real.Real.__radd__(), nzmath.imaginary.Complex.__rdiv__(), nzmath.intresidue.IntegerResidueClass.__rdiv__(), nzmath.algfield.NumberField.__repr__(), nzmath.poly.ratfunc.RationalFunction.__repr__(), nzmath.poly.ring.PolynomialRing.__repr__(), nzmath.real.RealField.__repr__(), nzmath.imaginary.ComplexField.__repr__(), nzmath.finitefield.FinitePrimeField.__repr__(), nzmath.module.Module.__repr__(), nzmath.poly.ring.PolynomialIdeal.__repr__(), nzmath.rational.Rational.__repr__(), nzmath.poly.multiutil.RingPolynomial.__repr__(), nzmath.poly.univar.BasicPolynomial.__repr__(), nzmath.poly.formalsum.DictFormalSum.__repr__(), nzmath.algfield.BasicAlgNumber.__repr__(), nzmath.poly.multiutil.PolynomialRingAnonymousVariables.__repr__(), nzmath.poly.ring.RationalFunctionField.__repr__(), nzmath.poly.formalsum.ListFormalSum.__repr__(), nzmath.finitefield.ExtendedFieldElement.__repr__(), nzmath.poly.multiutil.PolynomialIdeal.__repr__(), nzmath.algfield.MatAlgNumber.__repr__(), nzmath.finitefield.ExtendedField.__repr__(), nzmath.module.Ideal_with_generator.__repr__(), nzmath.poly.uniutil.RingPolynomial.__repr__(), nzmath.vector.Vector.__rmul__(), nzmath.real.Real.__rmul__(), nzmath.rational.Integer.__rmul__(), nzmath.imaginary.Complex.__rsub__(), nzmath.real.Real.__rsub__(), nzmath.intresidue.IntegerResidueClass.__rsub__(), nzmath.ring.QuotientFieldElement.__rsub__(), nzmath.real.Real.__rtruediv__(), nzmath.ring.QuotientFieldElement.__rtruediv__(), nzmath.vector.Vector.__sub__(), nzmath.imaginary.Complex.__sub__(), nzmath.real.Real.__sub__(), nzmath.poly.multivar.TermIndices.__sub__(), nzmath.intresidue.IntegerResidueClass.__sub__(), nzmath.ring.QuotientFieldElement.__sub__(), nzmath.ring.ResidueClass.__sub__(), nzmath.quad.ReducedQuadraticForm.__truediv__(), nzmath.vector.Vector.__truediv__(), nzmath.real.Real.__truediv__(), nzmath.ring.QuotientFieldElement.__truediv__(), nzmath.module.Module._module_mul(), nzmath.finitefield.ExtendedFieldElement._op(), nzmath.module.Module._rational_mul(), nzmath.module.Module._scalar_mul(), nzmath.module.Module.change_base_module(), nzmath.poly.multivar.BasicPolynomial.combine_similar_terms(), nzmath.imaginary.Complex.conjugate(), nzmath.poly.univar.PolynomialInterface.construct_with_default(), nzmath.poly.formalsum.DictFormalSum.construct_with_default(), nzmath.poly.multivar.BasicPolynomial.construct_with_default(), nzmath.poly.formalsum.ListFormalSum.construct_with_default(), nzmath.vector.Vector.copy(), nzmath.factor.misc.FactoredInteger.copy(), nzmath.imaginary.Complex.copy(), nzmath.module.Module.copy(), nzmath.prime.FactoredInteger.copy(), nzmath.module.Ideal_with_generator.copy(), nzmath.poly.multivar.BasicPolynomial.erase_variable(), nzmath.poly.multiutil.PseudoDivisionProvider.exact_division(), nzmath.poly.multivar.TermIndices.gcd(), nzmath.poly.ring.PolynomialRing.getCommonSuperring(), nzmath.poly.multiutil.PolynomialRingAnonymousVariables.getCommonSuperring(), nzmath.module.Module.intersect(), nzmath.quad.ReducedQuadraticForm.inverse(), nzmath.imaginary.Complex.inverse(), nzmath.intresidue.IntegerResidueClass.inverse(), nzmath.ring.QuotientFieldElement.inverse(), nzmath.finitefield.ExtendedFieldElement.inverse(), nzmath.module.Module.issubmodule(), nzmath.module.Module.issupermodule(), nzmath.poly.multivar.TermIndices.lcm(), nzmath.poly.termorder.TermOrderInterface.leading_coefficient(), nzmath.poly.termorder.TermOrderInterface.leading_term(), nzmath.prime.TestPrime.next(), nzmath.poly.multivar.TermIndices.pop(), nzmath.poly.univar.BasicPolynomial.square(), and nzmath.poly.multiutil.NestProvider.unnest().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |