Module: sage.rings.number_field.number_field_element
Module-level Functions
x) |
Class: NumberFieldElement
self, parent, f) |
INPUT: parent -- a number field f -- defines an element of a number field.
The following examples illustrate creation of elements of number fields, and some basic arithmetic.
First we define a polynomial over Q.
sage: x = PolynomialRing(Q).0 sage: f = x^2 + 1
Next we use f to define the number field.
sage: K = NumberField(f, "a"); K Number Field in a with defining polynomial x^2 + 1 sage: a = K.gen() sage: a^2 -1 sage: (a+1)^2 2*a sage: a^2 -1 sage: z = K(5); 1/z 1/5
We create a cube root of 2.
sage: K = NumberField(x^3 - 2, "b") sage: b = K.gen() sage: b^3 2 sage: (b^2 + b + 1)^3 12*b^2 + 15*b + 19
This example illustrates save and load:
sage: K, a = NumberField(x^17 - 2, 'a').objgen() sage: s = a^15 - 19*a + 3 sage: loads(s.dumps()) == s True
Functions: charpoly,
list,
matrix,
minpoly,
multiplicative_order,
norm,
polynomial,
trace
self) |
The matrix of right multiplication by the element on the power
basis
for the number field. Thus
the rows of this matrix give the images of each of the
.
Special Functions: __cmp__,
__getitem__,
__int__,
__invert__,
__long__,
__neg__,
__pow__,
__repr__,
_add_,
_div_,
_im_gens_,
_integer_,
_latex_,
_mul_,
_pari_,
_pari_init_,
_rational_,
_set_multiplicative_order,
_sub_
self, other) |
Returns the product of self and other as elements of a number field.
self, [var=None]) |
Return PARI C-library object representation of self.
self, [var=None]) |
Return GP/PARI string representation of self.
See About this document... for information on suggesting changes.