Pari.Number_field
type elt = number_field ty
val create : Rational.t Polynomial.t -> t
create 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 = true
val sign : t -> Signed.Long.t * Signed.Long.t
val elt : Rational.t array -> elt
divrem 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 = true
val splitting :
[< `F of t | `P of Integer.t Polynomial.t ] ->
Integer.t Polynomial.t
splitting (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.long
val nfmaxord_to_nf :
nfmaxord_t Ctypes.structure Ctypes_static.ptr ->
'a ty ->
Signed.long ->
'a ty
val nfinit_basic :
nfmaxord_t Ctypes.structure Ctypes_static.ptr ->
'a ty ->
unit
val nfinit_complete :
nfmaxord_t Ctypes.structure Ctypes_static.ptr ->
Signed.long ->
Signed.long ->
'a ty
val nftyp : 'a ty -> Signed.long
val mf_get_dim : 'a ty -> Signed.long
val mf_get_space : 'a ty -> Signed.long
val nfmaxord :
nfmaxord_t Ctypes.structure Ctypes_static.ptr ->
'a ty ->
Signed.long ->
unit
val nfpow_u : 'a ty -> 'a ty -> pari_ulong -> 'a ty
val nf_get_varn : 'a ty -> Signed.long
val nf_get_degree : 'a ty -> Signed.long
val nf_get_r1 : 'a ty -> Signed.long
val nf_get_r2 : 'a ty -> Signed.long
val nfhyperellpadicfrobenius :
'a ty ->
'a ty ->
pari_ulong ->
Signed.long ->
'a ty
module Infix : sig ... end