Pari.Elliptic_curvetype 'a t constraint 'a = 'b tytype 'a elt = 'a elliptic_curve ty constraint 'a = 'b tyval create :
?a1:'a ->
?a2:'a ->
?a3:'a ->
?a4:'a ->
?a6:'a ->
?dom:'a ->
unit ->
'a t optioncreate ?a1 ?a2 ?a3 ?a4 ?a6 defines the curve
Y^2 + a_1 XY + a_3 Y = X^3 + a_2 X^2 + a_4 X + a_6
Returns None if the input coefficients do not define an elliptic curve over the field from the coefficients.
val get_a1 : 'a t -> 'aval get_a2 : 'a t -> 'aval get_a3 : 'a t -> 'aval get_a4 : 'a t -> 'aval get_a6 : 'a t -> 'aval of_coordinates : x:'a -> y:'a -> 'a elt# let g = Finite_field.generator ~order:(Integer.of_int 625) (* 5^4 *);;
val g : Finite_field.t = <abstr>
# let ell = Option.get (Elliptic_curve.create ~a4:(Finite_field.pow g (Integer.of_int 4)) ~a6:(Finite_field.pow g (Integer.of_int 6)) ());;
val ell : Finite_field.t Elliptic_curve.t = <abstr>
# Integer.(to_string (Elliptic_curve.order ell));;
- : string = "675"val discriminant : 'a t -> 'aval j_invariant : 'a t -> 'aweil_pairing ell ~l p q returns the Weil pairing of the two points of l-torsion p and q on the elliptic curve ell.
# let l = Integer.of_int 3;;
val l : Integer.t = <abstr>
# let ord = Integer.of_int 103;;
val ord : Integer.t = <abstr>
# let ell = Option.get (Elliptic_curve.create ~a3:(Finite_field.prime_field_element (Integer.of_int 1) ~p:ord) ());;
val ell : Finite_field.t Elliptic_curve.t = <abstr>
# let (p, q) = Elliptic_curve.(of_coordinates ~x:(Finite_field.prime_field_element (Integer.of_int 0) ~p:ord) ~y:(Finite_field.prime_field_element (Integer.of_int 0) ~p:ord), of_coordinates ~x:(Finite_field.prime_field_element (Integer.of_int 57) ~p:ord) ~y:(Finite_field.prime_field_element (Integer.of_int 46) ~p:ord));;
val p : Finite_field.t Elliptic_curve.elt = <abstr>
val q : Finite_field.t Elliptic_curve.elt = <abstr>
# let scalar = Elliptic_curve.weil_pairing ell ~l p q;;
val scalar : Finite_field.t = <abstr>
# Finite_field.to_string scalar (* 56 mod 103 *);;
- : string = "56"
# Finite_field.(to_string (pow scalar l));;
- : string = "1"val l_division_polynomial : 'a t -> l:Signed.Long.t -> 'a ty Polynomial.t# let g = Finite_field.generator ~order:(Integer.of_int 625) (* 5^4 *);;
val g : Finite_field.t = <abstr>
# let ell = Option.get (Elliptic_curve.create ~a6:(Finite_field.pow g (Integer.of_int 6)) ());;
val ell : Finite_field.t Elliptic_curve.t = <abstr>
# let pdiv7 = (Elliptic_curve.l_division_polynomial ell ~l:(Signed.Long.of_int 7));;
val pdiv7 : Finite_field.t ty Polynomial.t = <abstr>
# Polynomial.to_string pdiv7;;
- : string =
"2*x^24 + (2*x^3 + x^2 + x + 2)*x^21 + (x^3 + x^2 + 3*x + 2)*x^18 + (2*x^3 + x^2 + 3*x)*x^15 + (2*x^3 + 4*x^2 + 3)*x^12 + (4*x^3 + x^2 + 2*x)*x^9 + (3*x^3 + 3*x^2)*x^6 + (4*x^3 + 2*x^2 + 3)*x^3 + (3*x^3 + 3*x^2 + 3*x + 1)"
# Polynomial.degree pdiv7 = ((7 * 7 - 1) / 2);;
- : bool = trueval to_string : 'a t -> stringval get_coordinates : 'a t -> [> `inf | `point of 'a * 'a ]val to_string_elt : 'a elt -> stringval ellanalyticrank : Rational.t t -> (Rational.t, [ `ROW ]) Vector.t# let ell = Option.get (Elliptic_curve.create ~a6:(Rational.of_int 6) ());;
val ell : Rational.t Elliptic_curve.t = <abstr>
# Elliptic_curve.ellanalyticrank ell |> Vector.to_string
- : string = "[0, 3.1205690727970642238215206887060527526]"val ell_is_integral : 'a ty -> intval ellq_get_cm : 'a ty -> Signed.longval ellap_cm_fast : 'a ty -> pari_ulong -> Signed.long -> Signed.longval elliscm : 'a ty -> Signed.longval elljissupersingular : 'a ty -> intval ellrootno_global : 'a ty -> Signed.longval elltors_psylow : 'a ty -> pari_ulong -> 'a tyval ellpadicfrobenius : 'a ty -> pari_ulong -> Signed.long -> 'a tyval ell_get_type : 'a ty -> Signed.longval ellqp_get_prec : 'a ty -> Signed.longval ellr_get_prec : 'a ty -> Signed.longval ellr_get_sign : 'a ty -> Signed.longval ellmodulareqn : Signed.long -> Signed.long -> Signed.long -> 'a tyval ell_is_inf : 'a ty -> int