Pari.Number_fieldtype elt = number_field tyval create : Rational.t Polynomial.t -> tcreate p returns the number field Q(X)/(p) for a monic irreducible polynomial p over the field Q of the rationals.
are_isomorphic a b returns true if and only if number fields a and b are isomorphic.
# let q =
Polynomial.create
[|
Rational.of_int 1;
Rational.of_int (-111);
Rational.of_int 6064;
Rational.of_int (-189804);
|];;
val q : Rational.t Polynomial.t = <abstr>
# let zero = Polynomial.create [| Rational.of_int 0 |];;
val zero : Rational.t Polynomial.t = <abstr>
# let qq = Polynomial.create [| q; q; zero; zero |];;
val qq : Rational.t Polynomial.t Polynomial.t = <abstr>
# Polynomial.to_string qq;;
- : string =
"(x^3 - 111*x^2 + 6064*x - 189804)*y^3 + (x^3 - 111*x^2 + 6064*x - 189804)*y^2"
# Polynomial.is_irreducible q;;
- : bool = true
# let qmin = Polynomial.minimal q;;
val qmin : Rational.t Polynomial.t = <abstr>
# Polynomial.to_string qmin;;
- : string = "x^3 - x^2 - 60*x - 364"
# Number_field.(are_isomorphic (create q) (create qmin));;
- : bool = trueval sign : t -> Signed.Long.t * Signed.Long.tval elt : Rational.t array -> eltdivrem nf a b returns the pair (divisor, remainder) from the euclidean division of a by b.
# let gaussian_integers =
(* Gaussian integers: the ring Z[i] (here we work in the field Q(i)) *)
Number_field.create
(Polynomial.create [| Rational.of_int 1; Rational.of_int 0; Rational.of_int 1 |]);;
val gaussian_integers : Number_field.t = <abstr>
# let a = Number_field.elt [| Rational.of_int 6; Rational.of_int 8 |];;
val a : Number_field.elt = <abstr>
# let b = Number_field.elt [| Rational.of_int 1; Rational.of_int 5 |];;
val b : Number_field.elt = <abstr>
# let q, r = (* Euclidean division of 6 + 8i by 1 + 5i. *)
Number_field.divrem gaussian_integers a b;;
val q : Number_field.elt = <abstr>
val r : Number_field.elt = <abstr>
# Number_field.(equal a (add gaussian_integers (mul gaussian_integers b q) r));;
- : bool = trueval splitting :
[< `F of t | `P of Integer.t Polynomial.t ] ->
Integer.t Polynomial.tsplitting (nf|p) given the number field nf = Q(x)/(p) or polynomial p, returns the polynomial over Q for the splitting field of p, that is the smallest field over which p is totally split.
val nf_get_prec : 'a ty -> Signed.longval nfmaxord_to_nf :
nfmaxord_t Ctypes.structure Ctypes_static.ptr ->
'a ty ->
Signed.long ->
'a tyval nfinit_basic :
nfmaxord_t Ctypes.structure Ctypes_static.ptr ->
'a ty ->
unitval nfinit_complete :
nfmaxord_t Ctypes.structure Ctypes_static.ptr ->
Signed.long ->
Signed.long ->
'a tyval nftyp : 'a ty -> Signed.longval mf_get_dim : 'a ty -> Signed.longval mf_get_space : 'a ty -> Signed.longval nfmaxord :
nfmaxord_t Ctypes.structure Ctypes_static.ptr ->
'a ty ->
Signed.long ->
unitval nfpow_u : 'a ty -> 'a ty -> pari_ulong -> 'a tyval nf_get_varn : 'a ty -> Signed.longval nf_get_degree : 'a ty -> Signed.longval nf_get_r1 : 'a ty -> Signed.longval nf_get_r2 : 'a ty -> Signed.longval nfhyperellpadicfrobenius :
'a ty ->
'a ty ->
pari_ulong ->
Signed.long ->
'a tymodule Infix : sig ... end