@@ -51,7 +51,26 @@ setup.py install`` will produce an error.
51
51
Usage
52
52
-----
53
53
54
- Here is an example of some PARI/GP computations in Python
54
+ The interface as been kept as close as possible from PARI/GP. The following
55
+ computation in GP
56
+
57
+ ::
58
+
59
+ ? zeta(2)
60
+ %1 = 1.6449340668482264364724151666460251892
61
+
62
+ ? p = x^3 + x^2 + x - 1;
63
+ ? modulus = t^3 + t^2 + t - 1;
64
+ ? fq = factorff(p, 3, modulus);
65
+ ? centerlift(lift(fq))
66
+ %5 =
67
+ [ x - t 1]
68
+
69
+ [x + (t^2 + t - 1) 1]
70
+
71
+ [ x + (-t^2 - 1) 1]
72
+
73
+ translates into
55
74
56
75
::
57
76
@@ -61,12 +80,11 @@ Here is an example of some PARI/GP computations in Python
61
80
>>> pari(2).zeta()
62
81
1.64493406684823
63
82
64
- >>> pari(2197).ispower(3)
65
- (3, 13)
66
-
67
- >>> K = pari("bnfinit(x^3 - 2)")
68
- >>> K.bnfunit()
69
- [x - 1]
83
+ >>> p = pari("x^3 + x^2 + x - 1")
84
+ >>> modulus = pari("t^3 + t^2 + t - 1")
85
+ >>> fq = p.factorff(3, modulus)
86
+ >>> fq.lift().centerlift()
87
+ [x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]
70
88
71
89
The object **pari ** above is the object for the interface and acts as a
72
90
constructor. It can be called with basic Python objects like integer
@@ -76,9 +94,27 @@ the corresponding string is interpreted as if it was executed in a GP shell.
76
94
Beyond the interface object **pari ** of type **Pari **, any object you get a
77
95
handle on is of type **Gen ** (that is a wrapper around the **GEN ** type from
78
96
libpari). All PARI/GP functions are then available in their original names as
79
- *methods * like **zeta **, **ispower ** or **bnfunit ** above.
97
+ *methods * like **zeta **, **factorff **, **lift ** or **centerlift ** above.
98
+
99
+ Alternatively, the pari functions are accessible as methods of **pari **. The
100
+ same computations be done via
101
+
102
+ ::
103
+
104
+ >>> import cypari2
105
+ >>> pari = cypari2.Pari()
106
+
107
+ >>> pari.zeta(2)
108
+ 1.64493406684823
109
+
110
+ >>> p = pari("x^3 + x^2 + x - 1")
111
+ >>> modulus = pari("t^3 + t^2 + t - 1")
112
+ >>> fq = pari.factorff(p, 3, modulus)
113
+ >>> pari.centerlift(pari.lift(fq))
114
+ [x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]
80
115
81
- The complete documentation is available at http://cypari2.readthedocs.io
116
+ The complete documentation of cypari2 is available at http://cypari2.readthedocs.io and
117
+ the PARI/GP documentation at http://pari.math.u-bordeaux.fr/doc.html
82
118
83
119
Contributing
84
120
------------
0 commit comments