PARI-GP Reference Card
(PARI-GP version 2.6.1)
Note: optional arguments are surrounded by braces{}.
To start the calculator, type its name in the terminal: gp To exitgp, typequit,\q, or<C-D>at prompt.
Help
describe function ?function
extended description ??keyword
list of relevant help topics ???pattern
Input/Output
previous result, the result before %,%‘,%‘‘, etc.
n-th result since startup %n separate multiple statements on line ; extend statement on additional lines \
extend statements on several lines {seq1; seq2;}
comment /* . . . */
one-line comment, rest of line ignored \\ . . .
Metacommands & Defaults
set defaultdtoval default({d},{val},{flag})
toggle timer on/off #
print time for last result ##
print defaults \d
set debug level ton \g n
set memory debug level ton \gm n set output mode (raw=0, default=1) \o n
setnsignificant digits \p n
setnterms in series \ps n
quit GP \q
print the list of PARI types \t print the list of user-defined functions \u
read file into GP \r filename
Debugger / break loop
get out of break loop break or <C-D>
go upnframes dbg up({n})
examine objecto dbg x(o)
PARI Types & Input Formats
t INT/t REAL. Integers, Reals ±n, ±n.ddd t INTMOD. Integers modulom Mod(n, m) t FRAC. Rational Numbers n/m t FFELT. Elt in finite fieldFq ffgen(q) t COMPLEX. Complex Numbers x+y∗I t PADIC.p-adic Numbers x+O(p^k) t QUAD. Quadratic Numbers x+y∗quadgen(D) t POLMOD. Polynomials modulog Mod(f, g)
t POL. Polynomials a∗x^n+· · ·+b
t SER. Power Series f+O(x^k)
t QFI/t QFR. Imag/Real bin. quad. formsQfb(a, b, c,{d}) t RFRAC. Rational Functions f /g
t VEC/t COL. Row/Column Vectors [x, y, z], [x, y, z]~
t MAT. Matrices [x, y;z, t;u, v]
t LIST. Lists List([x, y, z])
t STR. Strings "abc"
Reserved Variable Names
π= 3.14. . .,γ= 0.57. . .,C= 0.91. . . Pi,Euler,Catalan
square root of−1 I
big-oh notation O
c
2013 Karim Belabas. Permissions on back. v2.27
Information about an Object
PARI type of objectx type(x)
length ofx/ size ofxin memory #x,sizebyte(x) real orp-adic precision ofx precision(x),padicprec
Operators
basic operations +, - , *, /, ^
i=i+1,i=i-1,i=i*j,. . . i++, i--, i*=j,. . . euclidean quotient, remainder x\/y, x\y, x%y,divrem(x, y) shiftxleft or rightnbits x<<n, x>>n or shift(x,±n) comparison operators <=,<,>=,>,==,!=,===,lex,cmp boolean operators (or, and, not) ||, &&,!
bit operations bitand,bitneg,bitor,bitxor
sign ofx=−1,0,1 sign(x)
maximum/minimum ofxandy max, min(x, y) integer or real factorial ofx x! or factorial(x)
derivative off w.r.t.x f’
apply differential operator diffop restorexas a formal variable x=’x simultaneous assignmentx←v1,y←v2 [x,y] = v
Select Components
n-th component ofx component(x, n)
n-th component of vector/listx x[n]
componentsa, a+ 1, . . . , bof vectorx x[a..b]
(m, n)-th component of matrixx x[m, n]
rowmor columnnof matrixx x[m,], x[, n]
numerator/denominator ofx numerator(x),denominator
Conversions
to vector, matrix, set, list, string Col/Vec,Mat,Set,List,Str create PARI object (xmody) Mod(x, y)
makexa polynomial ofv Pol(x,{v}) asPol/Vec, starting with constant term Polrev,Vecrev makexa power series ofv Ser(x,{v}) string from bytes / from format+args Strchr,Strprintf convertxto simplest possible type simplify(x) objectxwith precisionn precision(x, n) Conjugates and Lifts
conjugate of a numberx conj(x)
conjugate vector of algebraic numberx conjvec(x) norm ofx, product with conjugate norm(x) square ofL2norm of vectorx norml2(x)
lift ofxfrom Mods lift, centerlift(x)
Lists, Sets & Sorting
sortxbyk-th component vecsort(x,{k},{f l= 0}) min.mofx(m=x[i]), max. vecmin(x,{&i}),vecmax doesybelong tox, sorted wrt.f vecsearch(x, y,{f}) Sets(= row vector of strings with strictly increasing entries) intersection of setsxandy setintersect(x, y) set of elements inxnot belonging toy setminus(x, y)
union of setsxandy setunion(x, y)
doesybelong to the setx setsearch(x, y,{flag})
isxa set ? setisset(x)
Lists. create empty list:L= List()
appendxto listL listput(L, x,{i})
removei-th component from listL listpop(L,{i}) insertxin listLat positioni listinsert(L, x, i) sort the listLin place listsort(L,{flag})
Programming
Functions and closures fun(vars) = my(local vars); seq fun = (vars) -> my(local vars); seq
Control Statements(X: formal parameter in expressionseq) eval.seqfora≤X≤b for(X=a, b,seq) eval.seqforX dividingn fordiv(n, X,seq) eval.seqfor primesa≤X≤b forprime(X=a, b,seq) eval.seqfora≤X≤bsteppings forstep(X=a, b, s,seq)
multivariablefor forvec(X=v,seq)
loop over partitions ofn forpart(p=nseq) loop over vectorsv,q(v)≤B,q >0 forqfvec(v, q, b,seq) loop over subgrpsH of abelian grpG forsubgroup(H=G) evaluatesequntila6= 0 until(a,seq) whilea6= 0, evaluateseq while(a,seq) exitninnermost enclosing loops break({n}) start new iteration ofn-th enclosing loopnext({n}) returnxfrom current subroutine return({x})
raise an exception error()
ifa6= 0, evaluateseq1, elseseq2 if(a,{seq1},{seq2}) tryseq1, evaluateseq2on error iferr(seq1, E,seq2) select fromvaccording tof select(f, v) applyf to all entries inv apply(f, v) Input/Output
print with/without\n, TEX format print,print1,printtex
formatted printing printf()
writeargsto file write, write1, writetex(file,args) writexin binary format writebin(file, x)
read file into GP read({file})
read file, return as vector of lines readvec({file}) read a string from keyboard input() Interface with User and System
allocates a new stack ofsbytes allocatemem({s})
aliasoldtonew alias(new,old)
install function from library install(f, code,{gpf},{lib}) execute system commanda system(a)
as above, feed result to GP extern(a) as above, return GP string externstr(a) get$VARfrom environment getenv("VAR")
measure time in ms. gettime()
timeout command aftersseconds alarm(s,expr)
Iterations, Sums & Products
numerical integration intnum(X=a, b,expr,{flag}) sumexprover divisors ofn sumdiv(n, X,expr) sumdiv, withexprmultiplicative sumdivmult(n, X,expr) sumX=atoX=b, initialized atx sum(X=a, b,expr,{x})
sum of seriesexpr suminf(X=a,expr)
sum of alternating/positive series sumalt, sumpos sum of series usingintnum sumnum
producta≤X≤b, initialized atx prod(X=a, b,expr,{x}) product over primesa≤X≤b prodeuler(X=a, b,expr) infinite producta≤X≤ ∞ prodinf(X=a,expr) real root ofexprbetweenaandb solve(X=a, b,expr)
Random Numbers
random integer/prime in [0, N[ random(N),randomprime
get/set random seed getrand,setrand(s)
Vectors & Matrices
dimensions of matrixx matsize(x)
concatenation ofxandy concat(x,{y}) extract components ofx vecextract(x, y,{z}) transpose of vector or matrixx mattranspose(x) or x~ adjoint of the matrixx matadjoint(x) eigenvectors/values of matrixx mateigen(x) characteristic/minimal polynomial ofx charpoly(x),minpoly trace/determinant of matrixx trace(x),matdet
Frobenius form ofx matfrobenius(x)
QR decomposition matqr(x)
Constructors & Special Matrices
row vec. ofexpreval’ed at 1≤i≤n vector(n,{i},{expr}) col. vec. ofexpreval’ed at 1≤i≤n vectorv(n,{i},{expr}) matrix 1≤i≤m, 1≤j≤n matrix(m, n,{i},{j},{expr})
define matrix by blocks matconcat(B)
diagonal matrix with diagonalx matdiagonal(x)
n×nidentity matrix matid(n)
Hessenberg form of square matrixx mathess(x) n×nHilbert matrixHij= (i+j−1)−1mathilbert(n) companion matrix to polynomialx matcompanion(x) Sylvester matrix ofx polsylvestermatrix(x) Gaussian elimination
kernel of matrixx matker(x,{flag})
intersection of column spaces ofxandy matintersect(x, y) solveM∗X=B(M invertible) matsolve(M, B) as solve, moduloD(col. vector) matsolvemod(M, D, B) one sol ofM∗X=B matinverseimage(M, B) basis for image of matrixx matimage(x) supplement columns ofxto get basis matsupplement(x) rows, cols to extract invertible matrix matindexrank(x)
rank of the matrixx matrank(x)
Lattices & Quadratic Forms
upper triangular Hermite Normal Form mathnf(x) HNF ofxwheredis a multiple of det(x) mathnfmod(x, d) elementary divisors ofx matsnf(x) LLL-algorithm applied to columns ofx qflll(x,{flag}) likeqflll,xis Gram matrix of lattice qflllgram(x,{flag}) LLL-reduced basis for kernel ofx matkerint(x) Z-lattice←→Q-vector space matrixqz(x, p) signature of quad formty∗x∗y qfsign(x) decomp into squares ofty∗x∗y qfgaussred(x) eigenvals/eigenvecs for real symmetricx qfjacobi(x) find up tomsols ofty∗x∗y≤b qfminim(x, b, m)
perfection rank ofx qfperfection(x)
v,v[i] :=number of sols ofty∗x∗y=i qfrep(x, B,{flag})
automorphism group ofq qfauto(q)
find isomorphism betweenqandQ qfisom(q, Q)
Formal & p-adic Series
truncate power series orp-adic number truncate(x)
valuation ofxatp valuation(x, p)
Dirichlet and Power Series
Taylor expansion around 0 off w.r.t.x taylor(f, x) Pakbktk fromP
aktk andP
bktk serconvol(a, b) f=P
aktkfromP
(ak/k!)tk serlaplace(f) reverse power seriesF soF(f(x)) =x serreverse(f) Dirichlet series multiplication / division dirmul, dirdiv(x, y) Dirichlet Euler product (bterms) direuler(p=a, b,expr)
PARI-GP Reference Card
(PARI-GP version 2.6.1)
Polynomials & Rational Functions
degree off poldegree(f)
coeff. of degreenoff, leading coeff. polcoeff(f, n),pollead gcd of coefficients off content(f)
replacexbyy subst(f, x, y)
evaluatef replacing vars by their value eval(f)
replace polynomial expr.T(x) byyinf substpol(f, T , y) replacex1, . . . , xnbyy1, . . . , yninf substvec(f, x, y) discriminant of polynomialf poldisc(f) resultantR= Resv(f, g) polresultant(f, g,{v}) [u, v, R],xu+yv= Resv(f, g) polresultantext(x, y,{v}) derivative off w.r.t.x deriv(f,{x}) formal integral off w.r.t.x intformal(f,{x}) formal sum offw.r.t.x sumformal(f,{x}) reciprocal polyxdegff(1/x) polrecip(f) interpol. pol. eval. ata polinterpolate(X,{Y},{a},{&e}) initializetfor Thue equation solver thueinit(f) solve Thue equationf(x, y) =a thue(t, a,{sol}) Roots and Factorization
number of real roots off,a < x≤b polsturm(f,{a},{b})
complex roots off polroots(f)
symmetric powers of roots off up ton polsym(f, n)
factorf factor(f,{lim})
factorfmodp/ roots factormod(f, p),polrootsmod factorfoverFpa/ roots factorff(f, p, a),polrootsff factorfoverQp / roots factorpadic(f, p, r),polrootspadic find irreducibleT∈Fp[x], degT=n ffinit(p, n,{x})
#{monic irred. T∈Fq[x],degT =n} ffnbirred(q, n) p-adic root off cong. toamodp padicappr(f, a) Newton polygon offfor primep newtonpoly(f, p) extensions ofQpof degreeN padicfields(p, N) Special Polynomials
n-th cyclotomic polynomial in var. v polcyclo(n,{v}) d-th degree subfield ofQ(ζn) polsubcyclo(n, d,{v}) Pn,Tn/Un,Hn pollegendre,polchebyshev,polhermite
Transcendental and
p-adic Functions
real, imaginary part ofx real(x), imag(x) absolute value, argument ofx abs(x), arg(x) square/nth root ofx sqrt(x), sqrtn(x, n,{&z})
trig functions sin, cos, tan, cotan
inverse trig functions asin, acos, atan
hyperbolic functions sinh, cosh, tanh
inverse hyperbolic functions asinh, acosh, atanh exponential / natural log ofx exp,log
Euler Γ function, log Γ, Γ0/Γ gamma,lngamma,psi incomplete gamma function (y= Γ(s)) incgam(s, x,{y}) exponential integralR∞
x e−t/t dt eint1(x) error function 2/√
πR∞
x e−t2dt erfc(x)
dilogarithm ofx dilog(x)
m-th polylogarithm ofx polylog(m, x,{flag}) U-confluent hypergeometric function hyperu(a, b, u) BesselJn(x),Jn+1/2(x) besselj(n, x), besseljh(n, x) BesselIν,Kν,Hν1,Hν2,Nν (bessel)i,k,h1,h2,n LambertW:xs.t. xex=y lambertw(y) Teichmuller character ofp-adicx teichmuller(x)
Elementary Arithmetic Functions
vector of binary digits of|x| binary(x) bit numbernof integerx bittest(x, n) Hamming weight of integerx hammingweight(x) ceiling/floor/fractional part ceil,floor,frac roundxto nearest integer round(x,{&e})
truncatex truncate(x,{&e})
gcd/LCM ofxandy gcd(x, y), lcm(x, y)
gcd of entries of a vector/matrix content(x) Primes and Factorization
add primes invto prime table addprimes(v) Chebyshevπ(x),n-th primepn primepi(x), prime(n) vector of firstnprimes primes(n)
smallest prime≥x nextprime(x)
largest prime≤x precprime(x)
factorization ofx factor(x,{lim})
n=df2,dsquarefree/fundamental core(n,{f l}),coredisc recoverxfrom its factorization factorback(f,{e}) Divisors
number of prime divisorsω(n) / Ω(n) omega(n),bigomega divisors ofn/ number of divisorsτ(n) divisors(n),numdiv sum of (k-th powers of) divisors ofn sigma(n,{k}) Special Functions and Numbers
binomial coefficient xy
binomial(x, y) Bernoulli numberBn as real/rational bernreal(n),bernfrac Bernoulli polynomialBn(x) bernpol(n,{x})
n-th Fibonacci number fibonacci(n)
Stirling numberss(n, k) andS(n, k) stirling(n, k,{flag}) number of partitions ofn numbpart(n)
M¨obiusµ-function moebius(x)
Hilbert symbol ofxandy(atp) hilbert(x, y,{p}) Kronecker-Legendre symbol (xy) kronecker(x, y)
Dedekind sums(h, k) sumdedekind(h, k)
Multiplicative groups(Z/NZ)∗, F∗q
Eulerφ-function eulerphi(x)
multiplicative order ofx(divideso) znorder(x,{o}),fforder primitive root modq/x.mod znprimroot(q),ffprimroot(x)
structure of (Z/nZ)∗ znstar(n)
discrete logarithm ofxin baseg znlog(x, g,{o}),fflog Miscellaneous
integer square /n-th root ofx sqrtint(x), sqrtnint(x, n)
solvez≡xandz≡y chinese(x, y)
minimalu, vsoxu+yv= gcd(x, y) gcdext(x, y) continued fraction ofx contfrac(x,{b},{lmax}) last convergent of continued fractionx contfracpnqn(x) rational approximation tox bestappr(x, k),bestapprPade
True-False Tests
isxthe disc. of a quadratic field? isfundamental(x)
isxa prime? isprime(x)
isxa strong pseudo-prime? ispseudoprime(x)
isxsquare-free? issquarefree(x)
isxa square? issquare(x,{&n})
isxa perfect power? ispower(x,{k},{&n}) ispolirreducible? polisirreducible(pol)
Based on an earlier version by Joseph H. Silverman September 2013 v2.27. Copyright c2013 K. Belabas Permission is granted to make and distribute copies of this card provided the copyright and this permission notice are preserved on all copies.
Send comments and corrections tohKarim.Belabas@math.u-bordeaux.fri
PARI-GP Reference Card (2)
(PARI-GP version 2.6.1)
Elliptic Curves
Elliptic curve initially given by 5-tuplev=[a1, a2, a3, a4, a6].
Initializeellstruct E = ellinit(v,{Domain}) Points are[x,y], the origin is[0]. Struct members accessed asE.member:
•All domains: E.a1,a2,a3,a4,a6,b2,b4,b6,b8,c4,c6,disc,j
•Edefined overRorC
x-coords. of points of order 2 E.roots periods / quasi-periods E.omega,E.eta volume of complex lattice E.area
•Edefined overQp
residual characteristic E.p
If|j|p>1: Tate’s [u2, u, q,[a, b]] E.tate
•Edefined overFq
characteristic E.p
#E(Fq)/cyclic structure/generators E.no,E.cyc,E.gen
•Edefined overQ
generators ofE(Q) (requireelldata) E.gen [a1, a2, a3, a4, a6] fromj-invariant ellfromj(j) change curveEusingv=[u, r, s, t] ellchangecurve(E, v) change pointzusingv=[u, r, s, t] ellchangepoint(z, v) add pointsP+Q/P−Q elladd(E, P, Q),ellsub
negate point ellneg(E, P)
computen·z ellmul(E, z, n)
n-division polynomialfn(x) elldivpol(E, n,{x})
check ifzis onE ellisoncurve(E, z)
order of torsion pointz ellorder(E, z) y-coordinates of point(s) forx ellordinate(E, x) point [℘(z), ℘0(z)] corresp. toz ellztopoint(E, z) complexzsuch thatp= [℘(z), ℘0(z)] ellpointtoz(E, p) Curves over finite fields, Pairings
random point onE random(E)
#E(Fq) ellcard(E)
structureZ/d1Z×Z/d2ZofE(Fq) ellgroup(E) Weil pairing ofm-torsion ptsx, y ellweilpairing(E, x, y, m) Tate pairing ofx, y;x m-torsion elltatepairing(E, x, y, m) Discrete log, findns.t.P = [n]Q elllog(E, P, Q,{ord}) Curves over Q and theL-function
canonical bilinear form taken atz1,z2 ellbil(E, z1, z2) canonical height ofz ellheight(E, z,{flag}) height regulator matrix for pts inx ellheightmatrix(E, x) cond, min mod, Tamagawa num[N, v, c] ellglobalred(E) reduction ofy2+Qy=P (genus 2) genus2red(Q, P,{p}) Kodaira type ofp-fiber ofE elllocalred(E, p) minimal model ofE/Q ellminimalmodel(E,{&v}) p-th coeffapofL-function,pprime ellap(E, p) k-th coeffakofL-function ellak(E, k) vector of firstn ak’s inL-function ellan(E, n)
L(E, s) elllseries(E, s)
L(r)(E,1) ellL1(E, r)
return a Heegner point onEof rank 1 ellheegner(E) order of vanishing at 1 ellanalyticrank(E,{eps}) root number forL(E, .) atp ellrootno(E,{p}) torsion subgroup with generators elltors(E) modular parametrization ofE elltaniyama(E)
c
2013 Karim Belabas. Permissions on back. v2.27
Elldata package, Cremona’s database:
db code↔[conductor,class,index] ellconvertname(s) generators of Mordell-Weil group ellgenerators(E)
look upEin database ellidentify(E)
all curves matching criterion ellsearch(N) loop over curves with cond. fromatob forell(E, a, b,seq)
Elliptic & Modular Functions
w= [ω1, ω2] orell struct (E.omega),τ=ω1/ω2. arithmetic-geometric mean agm(x, y) ellipticj-function 1/q+ 744 +· · · ellj(x)
Weierstrassσ/℘/ζfunction ellsigma(w, z),ellwp,ellzeta periods/quasi-periods ellperiods(E,{flag}),elleta(w) (2iπ/ω2)kEk(τ) elleisnum(w, k,{flag}) modified Dedekindηfunc. Q
(1−qn) eta(x,{flag}) Jacobi sine theta function theta(q, z) k-th derivative at z=0 oftheta(q, z) thetanullk(q, k)
Weber’sffunctions weber(x,{flag})
Riemann’s zetaζ(s) =P
n−s zeta(s)
Binary Quadratic Forms
createax2+bxy+cy2(distanced) Qfb(a, b, c,{d}) reducex(s=√
D,l=bsc) qfbred(x,{flag},{D},{l},{s}) composition of forms x*y orqfbnucomp(x, y, l) n-th power of form x^n orqfbnupow(x, n) composition without reduction qfbcompraw(x, y) n-th power without reduction qfbpowraw(x, n) prime form of disc. xabove primep qfbprimeform(x, p) class number of disc. x qfbclassno(x) Hurwitz class number of disc. x qfbhclassno(x) SolveQ(x, y) =pin integers,pprime qfbsolve(Q, p)
Quadratic Fields
quadratic numberω=√
xor (1 +√
x)/2 quadgen(x)
minimal polynomial ofω quadpoly(x)
discriminant ofQ(√
D) quaddisc(x)
regulator of real quadratic field quadregulator(x) fundamental unit in realQ(x) quadunit(x) class group ofQ(√
D) quadclassunit(D,{flag},{t}) Hilbert class field ofQ(√
D) quadhilbert(D,{flag}) ray class field modulof ofQ(√
D) quadray(D, f,{flag})
General Number Fields: Initializations
A number fieldKis given by a monic irreduciblef∈Z[X].
init number field structurenf nfinit(f,{flag}) nf members:
polynomial definingnf,f(θ) = 0 nf.pol number of real/complex places nf.r1/r2/sign
discriminant ofnf nf.disc
T2matrix nf.t2
vector of roots off nf.roots
integral basis ofZK as powers ofθ nf.zk
different nf.diff
codifferent nf.codiff
index nf.index
recomputenf using current precision nfnewprec(nf) init relativernf given byg= 0 overK rnfinit(nf, g)
initbnf structure bnfinit(f,{flag})
bnf members: same asnf, plus
underlyingnf bnf.nf
classgroup bnf.clgp
regulator bnf.reg
fundamental units bnf.fu
torsion units bnf.tu
compute abnf from smallbnf bnfinit(sbnf) addS-class group and units, yieldbnf s bnfsunit(nf, S) init class field structurebnr bnrinit(bnf, m,{flag}) bnr members: same asbnf, plus
underlyingbnf bnr.bnf
big ideal structure bnr.bid
modulus bnr.mod
structure of (ZK/m)∗ bnr.zkst
Basic Number Field Arithmetic (nf )
Elements aret INT,t FRAC,t POL,t POLMOD, ort COL(on inte- gral basisnf.zk). Basic operations (prefixnfelt): (nfelt)add, mul,pow,div,diveuc,mod,divrem,val,trace,norm
expressxon integer basis nfalgtobasis(nf, x) express elementxas a polmod nfbasistoalg(nf, x) reverse polmoda=A(X) modT(X) modreverse(a) integral basis of field def. byf= 0 nfbasis(f) field discriminant of fieldf= 0 nfdisc(f)
smallest poly definingf= 0 (slow) polredabs(f,{flag}) small poly definingf= 0 (fast) polredbest(f,{flag}) are fieldsf= 0 andg= 0 isomorphic? nfisisom(f, g) is fieldf= 0 a subfield ofg= 0? nfisincl(f, g) compositum off= 0,g= 0 polcompositum(f, g,{flag}) subfields (of degreed) ofnf nfsubfields(nf,{d})
roots of unity innf nfrootsof1(nf)
roots ofgbelonging tonf nfroots({nf}, g)
factorginnf nffactor(nf, g)
factorgmod primeprinnf nffactormod(nf, g, pr) conjugates of a rootθofnf nfgaloisconj(nf,{flag}) apply Galois automorphismstox nfgaloisapply(nf, s, x) quadratic Hilbert symbol (atp) nfhilbert(nf, a, b,{p}) Linear and algebraic relations
poly of degree≤kwith rootx∈C algdep(x, k) alg. dep. with pol. coeffs for seriess seralgdep(s, x, y) small linear rel. on coords of vectorx lindep(x) Dedekind Zeta FunctionζK, HeckeLseries ζK as Dirichlet series,N(I)< b dirzetak(nf, b) initnfz for fieldf= 0 zetakinit(f)
computeζK(s) zetak(nfz, s,{flag})
Artin root number ofK bnrrootnumber(bnr,chi,{flag}) L(1, χ), for allχtrivial onH bnrL1(bnr,{H},{flag})
Class Groups & Units (bnf, bnr)
a1,{a2},{a3}usuallybnr, subgporbnf, module,{subgp}
remove GRH assumption frombnf bnfcertify(bnf) expo. of idealxon class gp bnfisprincipal(bnf, x,{flag}) expo. of idealxon ray class gpbnrisprincipal(bnr, x,{flag}) expo. ofxon fund. units bnfisunit(bnf, x) as above forS-units bnfissunit(bnfs, x) signs of real embeddings ofbnf.fu bnfsignunit(bnf)
narrow class group bnfnarrow(bnf)
Class Field Theory
ray class number for mod.m bnrclassno(bnf, m) discriminant of class field ext bnrdisc(a1,{a2},{a3}) ray class numbers,llist of mods bnrclassnolist(bnf, l) discriminants of class fieldsbnrdisclist(bnf, l,{arch},{flag}) decode output frombnrdisclist bnfdecodemodule(nf, f a) is modulus the conductor? bnrisconductor(a1,{a2},{a3}) conductor of characterchi bnrconductorofchar(bnr, chi) conductor of extension bnrconductor(a1,{a2},{a3},{flag}) conductor of extension def. byg rnfconductor(bnf, g) Artin group of ext. def’d byg rnfnormgroup(bnr, g) subgroups ofbnr, index<=b subgrouplist(bnr, b,{flag}) rel. eq. for class field def’d bysub rnfkummer(bnr, sub,{d}) same, using Stark units (real field) bnrstark(bnr, sub,{flag})
Ideals:
elements, primes, or matrix of generators in HNF isidan ideal innf ? nfisideal(nf, id) isxprincipal inbnf ? bnfisprincipal(bnf, x) give[a, b], s.t. aZK+bZK=x idealtwoelt(nf, x,{a}) put ideala(aZK+bZK) in HNF form idealhnf(nf, a,{b})norm of idealx idealnorm(nf, x)
minimum of idealx(directionv) idealmin(nf, x, v) LLL-reduce the idealx(directionv) idealred(nf, x,{v}) Ideal Operations
add idealsxandy idealadd(nf, x, y)
multiply idealsxandy idealmul(nf, x, y,{flag}) intersection of idealsxandy idealintersect(nf, x, y,{flag}) n-th power of idealx idealpow(nf, x, n,{flag})
inverse of idealx idealinv(nf, x)
divide idealxbyy idealdiv(nf, x, y,{flag}) Find (a, b)∈x×y,a+b= 1 idealaddtoone(nf, x,{y}) coprime integralA, Bsuch thatx=A/Bidealnumden(nf, x) Primes and Multiplicative Structure
factor idealxinnf idealfactor(nf, x) expand ideal factorization innf idealfactorback(nf, f, e) decomposition of primepinnf idealprimedec(nf, p) valuation ofxat prime idealpr idealval(nf, x, pr) weak approximation theorem innf idealchinese(nf, x, y) givebid=structure of (ZK/id)∗ idealstar(nf, id,{flag}) discrete log ofxin (ZK/bid)∗ ideallog(nf, x, bid) idealstarof all ideals of norm≤b ideallist(nf, b,{flag}) add Archimedean places ideallistarch(nf, b,{ar},{flag}) initprmodstructure nfmodprinit(nf, pr) kernel of matrixM in (ZK/pr)∗ nfkermodpr(nf, M, prmod) solveM x=Bin (ZK/pr)∗ nfsolvemodpr(nf, M, B, prmod)
Galois theory over
QGalois group of fieldQ[x]/(f) polgalois(f) initializes a Galois group structureG galoisinit(pol,{den}) action ofpin nfgaloisconj form galoispermtopol(G,{p}) identify as abstract group galoisidentify(G) export a group for GAP/MAGMA galoisexport(G,{flag}) subgroups of the Galois groupG galoissubgroups(G) is subgroupHnormal? galoisisnormal(G, H) subfields from subgroups galoissubfields(G,{flag},{v}) fixed field galoisfixedfield(G,perm,{flag},{v}) Frobenius at maximal idealP idealfrobenius(nf, G, P) ramification groups atP idealramgroups(nf, G, P)
PARI-GP Reference Card (2)
(PARI-GP version 2.6.1)
isGabelian? galoisisabelian(G,{flag})
abelian number fields/Q galoissubcyclo(N,H,{flag},{v}) query thegalpolpackage galoisgetpol(a,b,{s})
Relative Number Fields (rnf )
ExtensionL/Kis defined byT ∈K[x].
absolute equation ofL rnfequation(nf, T ,{flag})
isL/Kabelian? rnfisabelian(nf, T)
relativenfalgtobasis rnfalgtobasis(rnf, x) relativenfbasistoalg rnfbasistoalg(rnf, x)
relativeidealhnf rnfidealhnf(rnf, x)
relativeidealmul rnfidealmul(rnf, x, y) relativeidealtwoelt rnfidealtwoelt(rnf, x) Lifts and Push-downs
absolute→relative repres. forx rnfeltabstorel(rnf, x) relative→absolute repres. forx rnfeltreltoabs(rnf, x) liftxto the relative field rnfeltup(rnf, x) pushxdown to the base field rnfeltdown(rnf, x) idem forxideal: (rnfideal)reltoabs,abstorel,up,down Norms
absolute norm of idealx rnfidealnormabs(rnf, x) relative norm of idealx rnfidealnormrel(rnf, x) solutions ofNK/Q(y) =x∈Z bnfisintnorm(bnf, x) isx∈Qa norm fromK? bnfisnorm(bnf, x,{flag}) initializeT for norm eq. solver rnfisnorminit(K, pol,{flag}) isa∈Ka norm fromL? rnfisnorm(T , a,{flag}) Maximal order ZL as a ZK-module
relativepolred rnfpolred(nf, T)
relativepolredabs rnfpolredabs(nf, T)
characteristic poly. ofamodT rnfcharpoly(nf, T , a,{v}) relative Dedekind criterion, primepr rnfdedekind(nf, T , pr) discriminant of relative extension rnfdisc(nf, T) pseudo-basis ofZL rnfpseudobasis(nf, T) General ZK-modules: M= [matrix,vec.of ideals]⊂L
relative HNF / SNF nfhnf(nf, M),nfsnf
reduced basis forM rnflllgram(nf, T , M) determinant of pseudo-matrixM rnfdet(nf, M)
Steinitz class ofM rnfsteinitz(nf, M)
ZK-basis ofMifZK-free, or 0 rnfhnfbasis(bnf, M) n-basis ofM, or (n+ 1)-generating set rnfbasis(bnf, M) isM a freeZK-module? rnfisfree(bnf, M)
Graphic Functions
crude graph ofexprbetweenaandb plot(X=a, b, expr) High-resolution plot(immediate plot)
plotexprbetweenaandb ploth(X=a, b, expr,{flag},{n}) plot points given by listslx,ly plothraw(lx, ly,{flag})
terminal dimensions plothsizes()
Rectwindow functions
init windoww, with sizex,y plotinit(w, x, y)
erase windoww plotkill(w)
copywtow2with offset (dx, dy) plotcopy(w, w2, dx, dy)
clips contents ofw plotclip(w)
scale coordinates inw plotscale(w, x1, x2, y1, y2) plothinw plotrecth(w, X=a, b, expr,{flag},{n}) plothrawinw plotrecthraw(w, data,{flag}) draw windoww1at (x1, y1),. . . plotdraw([[w1, x1, y1], . . .]) Low-level Rectwindow Functions
set current drawing color inwtoc plotcolor(w, c) current position of cursor inw plotcursor(w) writesat cursor’s position plotstring(w, s) move cursor to (x, y) plotmove(w, x, y) move cursor to (x+dx, y+dy) plotrmove(w, dx, dy) draw a box to (x2, y2) plotbox(w, x2, y2) draw a box to (x+dx, y+dy) plotrbox(w, dx, dy) draw polygon plotlines(w, lx, ly,{flag})
draw points plotpoints(w, lx, ly)
draw line to (x+dx, y+dy) plotrline(w, dx, dy) draw point (x+dx, y+dy) plotrpoint(w, dx, dy) draw point (x+dx, y+dy) plotrpoint(w, dx, dy) Postscript Functions
asploth psploth(X=a, b, expr,{flag},{n}) asplothraw psplothraw(lx, ly,{flag}) asplotdraw psdraw([[w1, x1, y1], . . .])
Based on an earlier version by Joseph H. Silverman September 2013 v2.27. Copyright c2013 K. Belabas Permission is granted to make and distribute copies of this card provided the copyright and this permission notice are preserved on all copies.
Send comments and corrections tohKarim.Belabas@math.u-bordeaux.fri