The class is for algebraic number represented by matrix.
polynomial must be a monic irreducible polynomial over Z defining the number field. coefficient must be a rational number list or an integer list.
Ex.1
>>> a=algfield.MatAlgNumber([1, 2], [-2, 0, 1]) >>> print a MatAlgNumber([1, 2]+[4, 1], [-2, 0, 1])
Ex.2
>>> b=algfield.MatAlgNumber([Rational(1, 2), Rational(3, 2)], [-2, 0, 1]) >>> print b MatAlgNumber([Rational(1, 2), Rational(3, 2)]+[Rational(3, 1),Rational(1, 2)], [-2, 0, 1])
coefficient of the algebraic number.
degree of the defining polynomial.
represent matrix of the algebraic number.
defining polynomial of the field including the algebraic number.
field defined by the polynomial.
Return the inverse of the algebraic number.
Compute the trace of the algebraic number.
Compute the norm of the algebraic number.
Return the algebraic number field contained the algebraic number.
Change class to BasicAlgNumber.
Change class to ApproxAlgNuber with approx.
operator | explanation |
a + b | Return a + b. |
a - b | Return a - b. |
a * b | Return a * b. a must be algebraic number or integer. |
a / b | Return a / b. b must not be zero unit. |
a ** b | Return a ** b. b must be integer. |