[BACK]Return to refcard.tex CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / pari-2.2 / doc

Annotation of OpenXM_contrib/pari-2.2/doc/refcard.tex, Revision 1.2

1.2     ! noro        1: % $Id: refcard.tex,v 1.10 2002/09/07 21:09:29 karim Exp $
1.1       noro        2: % This file is intended to be processed by plain TeX (TeX82).
                      3: % Reference Card for PARI-GP version 2.1
                      4:
                      5: % Copyright (c) 1997-2000 Karim Belabas.
                      6: % Permission is granted to copy, distribute and/or modify this document
                      7: % under the terms of the GNU Free Documentation License
                      8:
                      9: % Based on an earlier version by Joseph H. Silverman who kindly let me
                     10: % use his original file.
                     11: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                     12: % The original copyright notice read:
                     13: %
                     14: %% Copyright (c) 1993,1994 Joseph H. Silverman. May be freely distributed.
                     15: %% Created Tuesday, July 27, 1993
                     16: %% Thanks to Stephen Gildea for the multicolumn macro package
                     17: %% which I modified from his GNU emacs reference card
                     18: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                     19: \def\TITLE{Pari-GP reference card}
1.2     ! noro       20: \def\versionnumber{2.13}% Version of this reference card
        !            21: \def\PARIversion{2.2.5}% Version of PARI described on this reference card
        !            22: \def\year{2002}
        !            23: \def\month{August}
        !            24:
1.1       noro       25: % ignore parimacro.tex's \magnification setting
                     26: \let\oldmagnification\magnification
                     27: \catcode`@=11
                     28: \def\magnification{\count@}%
                     29: \catcode`@=12
                     30: \input parimacro.tex
                     31: \let\magnification\oldmagnification
                     32: \ifPDF
                     33:   \input pdfmacs.tex
                     34:   \pdfpagewidth=11.69in
                     35:   \pdfpageheight=8.26in
                     36: \fi
                     37: %**start of header
                     38: \newcount\columnsperpage
                     39: % The final reference card has six columns, three on each side.
                     40: % This file can be used to produce it in any of three ways:
                     41: % 1 column per page
                     42: %    produces six separate pages, each of which needs to be reduced to 80%.
                     43: %    This gives the best resolution.
                     44: % 2 columns per page
                     45: %    produces three already-reduced pages.
                     46: %    You will still need to cut and paste.
                     47: % 3 columns per page
                     48: %    produces two pages which must be printed sideways to make a
                     49: %    ready-to-use 8.5 x 11 inch reference card.
                     50: %    For this you need a dvi device driver that can print sideways.
                     51: % [For 2 or 3 columns, you'll need 6 and 8 point fonts.]
                     52: % Which mode to use is controlled by setting \columnsperpage above.
                     53: %
                     54: % Specify how many columns per page you want here:
                     55: \columnsperpage=3
                     56:
                     57: % You shouldn't need to modify anything below this line.
                     58: %
                     59: % Author:
                     60: %  Karim Belabas
                     61: %  Universite Paris Sud
                     62: %  Departement de Mathematiques (bat. 425)
                     63: %  F-91405 Orsay
1.2     ! noro       64: %  email: Karim.Belabas@math.u-psud.fr
1.1       noro       65: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                     66: % (original reference card by Joseph H. Silverman)
                     67: % (original reference card macros due to Stephen Gildea)
                     68: % Original Thanks and History:
                     69: %
                     70: %% Thanks:
                     71: %%  I would like to thank Jim Delaney, Kevin Buzzard, Dan Lieman,
                     72: %%  and Jaap Top for sending me corrections.
                     73: %%
                     74: %% History:
                     75: %%  Version 1.0 - July 1993, first general distribution
                     76: %%  Version 1.1 - April 1994, corrected six typos
                     77: %%  Version 1.2 - January 1995, minor corrections and additions
                     78: %%  Version 1.3 - January 1996, minor corrections and additions
                     79: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                     80: % Version 2.0 - November 1997, general distribution for GP 2.0
                     81: % Version 2.1 - January 1998, set nf,bnf,etc in a sensible font, updated default
                     82: % Version 2.2 - March 1998, some new functions (modpr, bnrstark), updated
                     83: %   concat, removed spurious tabs.
                     84: % Version 2.3 - May 1998, added write1, corrected my email address.
                     85: % Version 2.4 - July 1998, removed vecindexsort, added ellrootno, updated
                     86: %   elllseries
                     87: % Version 2.5 - October 1998, updated elliptic functions. Added quadray and
                     88: % user member functions
                     89: % Version 2.6 - December 1998, added local() keyword
                     90: % Version 2.7 - February 1999, added some pointer '&' arguments. Removed
                     91: %   rounderror
                     92: % Version 2.8 - April 1999, removed \k, added \l filename
                     93: % Version 2.9 - April 2000, added \o¸ updated control statements
                     94: % Version 2.10 - June 2000, updated polinterpolate
                     95: % Version 2.11 - November 2000, changed Copyright
1.2     ! noro       96: % From version 2.12 onward, History will be catered for by CVS.
1.1       noro       97: %% Thanks to Bill Allombert, Henri Cohen, Gerhard Niklasch, and Joe
                     98: %% Silverman for many comments and corrections.
                     99:
                    100: \def\version{\month\ \year\ v\versionnumber}
                    101:
                    102: \def\shortcopyrightnotice{\vskip .5ex plus 2 fill
                    103:   \centerline{\small \copyright\ \year\ Karim Belabas.
                    104:   Permissions on back.  v\versionnumber}}
                    105:
                    106: \def\<#1>{$\langle${#1}$\rangle$}
                    107: \def\copyrightnotice{\vskip 1ex plus 2 fill
                    108: \begingroup\small
                    109: \centerline{Based on an earlier version by Joseph H. Silverman}
                    110: \centerline{\version. Copyright \copyright\ \year\ K. Belabas}
                    111: \centerline{GP copyright by The PARI Group}
                    112:
                    113: Permission is granted to make and distribute copies of this card provided the
                    114: copyright and this permission notice are preserved on all copies.
                    115:
                    116: Send comments and corrections to \<Karim.BELABAS@math.u-psud.fr>
                    117: \endgroup}
                    118:
                    119: % make \bye not \outer so that the \def\bye in the \else clause below
                    120: % can be scanned without complaint.
                    121: \def\bye{\par\vfill\supereject\end}
                    122:
                    123: \newdimen\intercolumnskip
                    124: \newbox\columna
                    125: \newbox\columnb
                    126:
                    127: \def\ncolumns{\the\columnsperpage}
                    128:
                    129: \message{[\ncolumns\space
                    130:   column\if 1\ncolumns\else s\fi\space per page]}
                    131:
                    132: \def\scaledmag#1{ scaled \magstep #1}
                    133:
                    134: % This multi-way format was designed by Stephen Gildea
                    135: % October 1986.
                    136: \if 1\ncolumns
                    137:   \hsize 4in
                    138:   \vsize 10in
                    139:   \voffset -.7in
                    140:   \font\titlefont=\fontname\tenbf \scaledmag3
                    141:   \font\headingfont=\fontname\tenbf \scaledmag2
                    142:   \font\smallfont=\fontname\sevenrm
                    143:   \font\smallsy=\fontname\sevensy
                    144:
                    145:   \footline{\hss\folio}
                    146:   \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
                    147: \else
                    148:   \hsize 3.2in
                    149: %  \vsize 7.95in
                    150:   \vsize 7.90in
                    151:   \hoffset -.75in
                    152: %  \voffset -.745in
                    153:   \voffset -.815in
                    154:   \font\titlefont=cmbx10 \scaledmag2
                    155:   \font\headingfont=cmbx10 \scaledmag1
                    156:   \font\smallfont=cmr6
                    157:   \font\smallsy=cmsy6
                    158:   \font\eightrm=cmr8
                    159:   \font\eightbf=cmbx8
                    160:   \font\eightit=cmti8
                    161:   \font\eighttt=cmtt8
                    162:   \font\eightsy=cmsy8
                    163:   \font\eightsl=cmsl8
                    164:   \font\eighti=cmmi8
                    165:   \font\eightex=cmex10 at 8pt
                    166:   \textfont0=\eightrm
                    167:   \textfont1=\eighti
                    168:   \textfont2=\eightsy
                    169:   \textfont3=\eightex
                    170:   \def\rm{\fam0 \eightrm}
                    171:   \def\bf{\eightbf}
                    172:   \def\it{\eightit}
                    173:   \def\tt{\eighttt}
                    174:   \normalbaselineskip=.8\normalbaselineskip
                    175:   \normallineskip=.8\normallineskip
                    176:   \normallineskiplimit=.8\normallineskiplimit
                    177:   \normalbaselines\rm %make definitions take effect
                    178:
                    179:   \if 2\ncolumns
                    180:     \let\maxcolumn=b
                    181:     \footline{\hss\rm\folio\hss}
                    182:     \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
                    183:   \else \if 3\ncolumns
                    184:     \let\maxcolumn=c
                    185:     \nopagenumbers
                    186:   \else
                    187:     \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
                    188:     \errmessage{Illegal number of columns per page}
                    189:   \fi\fi
                    190:
                    191:   \intercolumnskip=.46in
                    192:   \def\abc{a}
                    193:   \output={%
                    194:       % This next line is useful when designing the layout.
                    195:       %\immediate\write16{Column \folio\abc\space starts with \firstmark}
                    196:       \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
                    197:       \else\if a\abc
                    198:         \global\setbox\columna\columnbox \global\def\abc{b}
                    199:         %% in case we never use \columnb (two-column mode)
                    200:         \global\setbox\columnb\hbox to -\intercolumnskip{}
                    201:       \else
                    202:         \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
                    203:   \def\multicolumnformat{\shipout\vbox{\makeheadline
                    204:       \hbox{\box\columna\hskip\intercolumnskip
                    205:         \box\columnb\hskip\intercolumnskip\columnbox}
                    206:       \makefootline}\advancepageno}
                    207:   \def\columnbox{\leftline{\pagebody}}
                    208:
                    209:   \def\bye{\par\vfill\supereject
                    210:     \if a\abc \else\null\vfill\eject\fi
                    211:     \if a\abc \else\null\vfill\eject\fi
                    212:     \end}
                    213: \fi
                    214:
                    215: % we won't be using math mode much, so redefine some of the characters
                    216: % we might want to talk about
                    217: %\catcode`\^=12
                    218: %\catcode`\_=12
                    219: %\catcode`\~=12
                    220:
                    221: \chardef\\=`\\
                    222: \chardef\{=`\{
                    223: \chardef\}=`\}
                    224:
                    225: \hyphenation{}
                    226:
                    227: \parindent 0pt
                    228: \parskip 0pt
                    229:
                    230: \def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
                    231:
                    232: \outer\def\newcolumn{\vfill\eject}
                    233:
                    234: \outer\def\title#1{{\titlefont\centerline{#1}}}
                    235:
                    236: \outer\def\section#1{\par\filbreak
                    237:   \vskip 1.4ex plus .4ex minus .5ex
                    238:   {\headingfont #1}\mark{#1}%
                    239:   \vskip .7ex plus .3ex minus .5ex
                    240: }
                    241:
                    242: \outer\def\subsec#1{\filbreak
                    243:   \vskip 0.1ex plus 0.05ex
                    244:   {\bf #1}
                    245:   \vskip 0.04ex plus 0.05ex
                    246: }
                    247:
                    248: \newdimen\keyindent
                    249: \def\beginindentedkeys{\keyindent=1em}
                    250: \def\endindentedkeys{\keyindent=0em}
                    251: \def\begindoubleindentedkeys{\keyindent=2em}
                    252: \def\enddoubleindentedkeys{\keyindent=1em}
                    253: \endindentedkeys
                    254:
                    255: \def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
                    256: \def\var#1{\hbox{\it #1}}
                    257: \def\fl{\{\var{f{}l\/}\}}
                    258:
                    259: \def\key#1#2{\leavevmode\hbox to \hsize{\vtop
                    260:   {\hsize=.75\hsize\rightskip=1em
                    261:   \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
                    262:
                    263: \newbox\libox
                    264: \setbox\libox\hbox{\kbd{M-x }}
                    265: \newdimen\liwidth
                    266: \liwidth=\wd\libox
                    267:
                    268: \def\li#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
                    269:   {\hskip\keyindent\relax#1\hfil}%
                    270:   \hskip -\liwidth minus 1fil
                    271:   \kbd{#2}\hfil}}
                    272:
                    273: \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
                    274:   &\kbd{#3}\quad\cr}
                    275:
                    276: \def\mod{\;\hbox{\rm mod}\;}
                    277: \def\expr{\hbox{\it expr}}
                    278: \def\seq{\hbox{\it seq}}
                    279: \def\args{\hbox{\it args}}
                    280: \def\file{\hbox{\it file}}
                    281: \def\QQ{\hbox{\bf Q}}
                    282: \def\ZZ{\hbox{\bf Z}}
                    283: \def\RR{\hbox{\bf R}}
                    284: \def\FF{\hbox{\bf F}}
                    285: \def\CC{\hbox{\bf C}}
                    286: \def\deg{\mathop{\rm deg}}
                    287: \def\bs{\char'134}
                    288: \def\pow{\^{}\hskip0pt}
                    289: \def\til{\raise-0.3em\hbox{\~{}}}
                    290: \def\typ#1{\kbd{t\_#1}}
                    291: %**end of header
                    292:
                    293: \title{PARI-GP Reference Card}
                    294: \centerline{(PARI-GP version \PARIversion)}
                    295: Note: optional arguments are surrounded by braces {\tt \{\}}.
                    296:
                    297: \section{Starting \& Stopping GP}
                    298: \key{to enter GP, just type its name:}{gp}
                    299: \key{to exit GP, type}{\\q {\rm or }quit}
                    300:
                    301: \section{Help}
                    302: \li{describe function}{?{\rm function}}
                    303: \li{extended description}{??{\rm keyword}}
                    304: \li{list of relevant help topics}{???{\rm pattern}}
                    305:
                    306: \section{Input/Output \& Defaults}
                    307: \li{output previous line, the lines before}
                    308:   {\%{\rm, }\%`{\rm, }\%``{\rm, etc.}}
                    309: \key{output from line $n$}{\%$n$}
                    310: \key{separate multiple statements on line}{;}
                    311: \key{extend statement on additional lines}{\\}
                    312: \key{extend statements on several lines}{\{\seq1; \seq2;\}}
                    313: \key{comment}{/* \dots */}
                    314: \key{one-line comment, rest of line ignored}{\\\\ \dots}
                    315: \li{set default $d$ to \var{val}} {default$(\{d\},\{\var{val}\},\fl)$}
                    316: \li{mimic behaviour of GP 1.39} {default(compatible,3)}
                    317:
                    318: \section{Metacommands}
                    319: \key{toggle timer on/off}{\#}
                    320: \key{print time for last result}{\#\#}
                    321: \key{print \%$n$ in raw format}{\\a $n$}
                    322: \key{print \%$n$ in pretty format}{\\b $n$}
                    323: \key{print defaults}{\\d}
                    324: \key{set debug level to $n$}{\\g $n$}
                    325: \key{set memory debug level to $n$}{\\gm $n$}
                    326: \key{enable/disable logfile}{\\l \{filename\}}
                    327: \key{print \%$n$ in pretty matrix format}{\\m}
                    328: \key{set output mode (raw, default, prettyprint)}{\\o $n$}
                    329: \key{set $n$ significant digits}{\\p $n$}
                    330: \key{set $n$ terms in series}{\\ps $n$}
                    331: \key{quit GP}{\\q}
                    332: \key{print the list of PARI types}{\\t}
                    333: \key{print the list of user-defined functions}{\\u}
                    334: \li{read file into GP}{\\r {\rm filename}}
                    335: \li{write \%$n$ to file}{\\w $n$ {\rm filename}}
                    336:
                    337: \section{GP Within Emacs}
                    338: \li{to enter GP from within Emacs:}{M-x gp{\rm,} C-u M-x gp}
                    339: \li{word completion}{<TAB>}
                    340: \li{help menu window}{M-\\c}
                    341: \li{describe function}{M-?}
                    342: \li{display \TeX'd PARI manual}{M-x gpman}
                    343: \li{set prompt string}{M-\\p}
                    344: \li{break line at column 100, insert \kbd{\\}}{M-\\\\}
                    345: \li{PARI metacommand \kbd{\\}{\it letter}}{M-\\\hbox{\it letter}}
                    346:
                    347: \section{Reserved Variable Names}
                    348: \li{$\pi=3.14159\cdots$}{Pi}
                    349: \li{Euler's constant ${}=.57721\cdots$}{Euler}
                    350: \li{square root of $-1$}{I}
                    351: \li{big-oh notation}{O}
                    352:
                    353: % ****************************************
                    354: % This goes at the bottom of page 1
                    355: \shortcopyrightnotice
                    356: \newcolumn
                    357:
                    358: \section{PARI Types \& Input Formats}
                    359: \li{\typ{INT}. Integers}{$\pm n$}
                    360: \li{\typ{REAL}. Real Numbers}{$\pm n.ddd$}
                    361: \li{\typ{INTMOD}. Integers modulo $m$}{Mod$(n,m)$}
                    362: \li{\typ{FRAC}. Rational Numbers}{$n/m$}
                    363: \li{\typ{COMPLEX}. Complex Numbers}{$x+\kbd{I}*y$}
                    364: \li{\typ{PADIC}. $p$-adic Numbers}{$x+O(p$\pow$k)$}
                    365: \li{\typ{QUAD}. Quadratic Numbers}{$x + y\,*\;$quadgen$(D)$}
                    366: \li{\typ{POLMOD}. Polynomials modulo $g$}{Mod$(f,g)$}
                    367: \li{\typ{POL}. Polynomials}{$a*x$\pow$n+\cdots+b$}
                    368: \li{\typ{SER}. Power Series}{$f+O(x$\pow$k)$}
                    369: \li{\typ{QFI}/\typ{QFR}. Imag/Real bin.\ quad.\ forms}
                    370:   {Qfb$(a,b,c,\{d\})$}
                    371: \li{\typ{RFRAC}. Rational Functions}{$f/g$}
                    372: \li{\typ{VEC}/\typ{COL}. Row/Column Vectors}
                    373:   {$[x,y,z]${\rm,} $[x,y,z]$\til}
                    374: %\li{\typ{COL}. Column Vectors}{$[x,y,z]$\til}
                    375: \li{\typ{MAT}. Matrices}{$[x,y;z,t;u,v]$}
                    376: \li{\typ{LIST}. Lists}{List$([x,y,z])$}
                    377: \li{\typ{STR}. Strings}{"aaa"}
                    378:
                    379: \section{Standard Operators}
                    380: \li{basic operations}{+{\rm,} - {\rm,} *{\rm,} /{\rm,} \pow}
                    381: \li{\kbd{i=i+1}, \kbd{i=i-1}, \kbd{i=i*j}, \dots}
                    382:   {i++{\rm,} i--{\rm,} i*=j{\rm,}\dots}
                    383: \li{euclidean quotient, remainder}{$x$\bs/$y${\rm,} $x$\bs$y${\rm,}
                    384: $x$\%$y${\rm,} divrem$(x,y)$}
                    385: \li{shift $x$ left or right $n$ bits}{ $x$<<$n$, $x$>>$n$
                    386:   {\rm or} shift$(x,n)$}
                    387: \li{comparison operators}{<={\rm, }<{\rm, }>={\rm, }>{\rm, }=={\rm, }!=}
                    388: \li{boolean operators (or, and, not)}{||{\rm, } \&\&{\rm ,} !}
                    389: \li{sign of $x=-1,0,1$}{sign$(x)$}
                    390: \li{maximum/minimum of $x$ and $y$}{max{\rm,} min$(x,y)$}
                    391: \li{integer or real factorial of $x$}{$x$!~{\rm or} fact$(x)$}
                    392:
                    393: \section{Conversions}
                    394: %
                    395: \subsec{Change Objects}
                    396: \li{make $x$ a vector, matrix, set, list, string}
                    397:   {Vec{\rm,}Mat{\rm,}Set{\rm,}List{\rm,}Str}
                    398: \li{create PARI object $(x\mod y)$}{Mod$(x,y)$}
                    399: \li{make $x$ a polynomial of $v$}{Pol$(x,\{v\})$}
                    400: \li{as above, starting with constant term}{Polrev$(x,\{v\})$}
                    401: \li{make $x$ a power series of $v$}{Ser$(x,\{v\})$}
                    402: \li{PARI type of object $x$}{type$(x, \{t\})$}
                    403: \li{object $x$ with precision $n$}{prec$(x,\{n\})$}
                    404: \li{evaluate $f$ replacing vars by their value}{eval$(f)$}
                    405: %
                    406: \subsec{Select Pieces of an Object}
                    407: \li{length of $x$}{length$(x)$}
                    408: \li{$n$-th component of $x$}{component$(x,n)$}
                    409: \li{$n$-th component of vector/list $x$}{$x$[n]}
                    410: \li{$(m,n)$-th component of matrix $x$}{$x$[m,n]}
                    411: \li{row $m$ or column $n$ of matrix $x$}{$x$[m,]{\rm,} $x$[,n]}
                    412: \li{numerator of $x$}{numerator$(x)$}
                    413: \li{lowest denominator of $x$}{denominator$(x)$}
                    414: %
                    415: \subsec{Conjugates and Lifts}
                    416: \li{conjugate of a number $x$}{conj$(x)$}
                    417: \li{conjugate vector of algebraic number $x$}{conjvec$(x)$}
                    418: \li{norm of $x$, product with conjugate}{norm$(x)$}
                    419: \li{square of $L^2$ norm of vector $x$}{norml2$(x)$}
                    420: \li{lift of $x$ from Mods}{lift{\rm,} centerlift$(x)$}
                    421:
                    422: \section{Random Numbers}
                    423: \li{random integer between $0$ and $N-1$}{random$(\{N\})$}
                    424: \li{get random seed}{getrand$()$}
                    425: \li{set random seed to $s$}{setrand$(s)$}
                    426:
                    427: \begingroup
                    428: \outer\def\subsec#1{\filbreak
                    429:   \vskip 0.05ex plus 0.05ex
                    430:   {\bf #1}
                    431:   \vskip 0.05ex plus 0.05ex
                    432: }
                    433:
                    434: \section{Lists, Sets \& Sorting}
                    435: \li{sort $x$ by $k$th component}{vecsort$(x,\{k\},\{\fl=0\})$}
                    436:   {\bf Sets} (= row vector of strings with strictly increasing entries)\hfill\break
                    437: %
                    438: \li{intersection of sets $x$ and $y$}{setintersect$(x,y)$}
                    439: \li{set of elements in $x$ not belonging to $y$}{setminus$(x,y)$}
                    440: \li{union of sets $x$ and $y$}{setunion$(x,y)$}
                    441: \li{look if $y$ belongs to the set $x$}{setsearch$(x,y,\fl)$}
                    442: %
                    443: \subsec{Lists}
                    444: \li{create empty list of maximal length $n$}{listcreate$(n)$}
                    445: \li{delete all components of list $l$}{listkill$(l)$}
                    446: \li{append $x$ to list $l$}{listput$(l,x,\{i\})$}
                    447: \li{insert $x$ in list $l$ at position $i$}{listinsert$(l,x,i)$}
                    448: \li{sort the list $l$}{listsort$(l,\fl)$}
                    449:
                    450: \section{Programming \& User Functions}
                    451: \subsec{Control Statements {\rm ($X$: formal parameter in expression \seq)}}
                    452: \li{eval.\ \seq\ for $a\le X\le b$}{for$(X=a,b,\seq)$}
                    453: \li{eval.\ \seq\ for $X$ dividing $n$}{fordiv$(n,X,\seq)$}
                    454: \li{eval.\ \seq\ for primes $a\le X\le b$}{forprime$(X=a,b,\seq)$}
                    455: \li{eval.\ \seq\ for $a\le X\le b$ stepping $s$}{forstep$(X=a,b,s,\seq)$}
                    456: \li{multivariable {\tt for}}{forvec$(X=v,\seq)$}
                    457: \li{if $a\ne0$, evaluate \seq1, else \seq2}{if$(a,\{\seq1\},\{\seq2\})$}
                    458: \li{evaluate \seq\ until $a\ne0$}{until$(a,\seq)$}
                    459: \li{while $a\ne0$, evaluate \seq}{while$(a,\seq)$}
                    460: \li{exit $n$ innermost enclosing loops}{break$(\{n\})$}
                    461: \li{start new iteration of $n$th enclosing loop}{next$(\{n\})$}
                    462: \li{return $x$ from current subroutine}{return$(x)$}
                    463: \li{error recovery (try \seq1)}{trap$(\{err\},\{\seq2\},\{\seq1\})$}
                    464: %
                    465: \subsec{Input/Output}
                    466: \li{prettyprint args with/without newline}{printp(){\rm,} printp1()}
                    467: \li{print args with/without newline}{print(){\rm,} print1()}
                    468: \li{read a string from keyboard}{input$()$}
                    469: \li{reorder priority of variables $[x,y,z]$}{reorder$(\{[x,y,z]\})$}
                    470: \li{output \args\ in \TeX\ format}{printtex$(\args)$}
                    471: \li{write \args\ to file}{write{\rm,} write1{\rm,} writetex$(\file,\args)$}
                    472: \li{read file into GP}{read(\{\file\})}
                    473: %
                    474: \subsec{Interface with User and System}
                    475: \li{allocates a new stack of $s$ bytes}{allocatemem$(\{s\})$}
                    476: \li{execute system command $a$}{system$(a)$}
                    477: \li{as above, feed result to GP}{extern$(a)$}
                    478: \li{install function from library}{install$(f,code,\{\var{gpf\/}\},\{\var{lib}\})$}
                    479: \li{alias \var{old}\ to \var{new}}{alias$(\var{new},\var{old})$}
                    480: \li{new name of function $f$ in GP 2.0}{whatnow$(f)$}
                    481: %
                    482: \subsec{User Defined Functions}
                    483: \leavevmode
                    484:   {\tt name(formal vars) = local(local vars); \var{seq}}\hfill\break
                    485:   {\tt struct.member = \var{seq}}\hfill\break
                    486: \li{kill value of variable or function $x$}{kill$(x)$}
                    487: \li{declare global variables}{global$(x,...)$}
                    488:
                    489: \section{Iterations, Sums \& Products}
                    490: \li{numerical integration}{intnum$(X=a,b,\expr,\fl)$}
                    491: \li{sum \expr\ over divisors of $n$}{sumdiv$(n,X,\expr)$}
                    492: \li{sum $X=a$ to $X=b$, initialized at $x$}{sum$(X=a,b,\expr,\{x\})$}
                    493: \li{sum of series \expr}{suminf$(X=a,\expr)$}
                    494: \li{sum of alternating/positive series}{sumalt{\rm,} sumpos}
                    495: \li{product $a\le X\le b$, initialized at $x$}{prod$(X=a,b,\expr,\{x\})$}
                    496: \li{product over primes $a\le X\le b$}{prodeuler$(X=a,b,\expr)$}
                    497: \li{infinite product $a\le X\le\infty$}{prodinf$(X=a,\expr)$}
                    498: \li{real root of \expr\ between $a$ and $b$}{solve$(X=a,b,\expr)$}
                    499: \endgroup
                    500:
                    501: % This goes at the top of page 4 (=1st column on back of reference card)
                    502:
                    503: \section{Vectors \& Matrices}
                    504: %
                    505: \li{dimensions of matrix $x$}{matsize$(x)$}
                    506: \li{concatenation of $x$ and $y$}{concat$(x,\{y\})$}
                    507: \li{extract components of $x$}{vecextract$(x,y,\{z\})$}
                    508: \li{transpose of vector or matrix $x$}{mattranspose$(x)$ {\rm or} $x$\til}
                    509: \li{adjoint of the matrix $x$}{matadj$(x)$}
                    510: \li{eigenvectors of matrix $x$}{mateigen$(x)$}
                    511: \li{characteristic polynomial of $x$}{charpoly$(x,\{v\},\fl)$}
                    512: \li{trace of matrix $x$}{trace$(x)$}
                    513: %
                    514: \subsec{Constructors \& Special Matrices}
                    515: \li{row vec.\ of \expr\ eval'ed at $1\le X\le n$}{vector$(n,\{X\},\{\expr\})$}
                    516: \li{col.\ vec.\ of \expr\ eval'ed at $1\le X\le n$}{vectorv$(n,\{X\},\{\expr\})$}
                    517: \li{matrix $1\le X\le m$, $1\le Y\le n$}{matrix$(m,n,\{X\},\{Y\},\{\expr\})$}
                    518: \li{diagonal matrix whose diag. is $x$}{matdiagonal$(x)$}
                    519: \li{$n\times n$ identity matrix}{matid$(n)$}
                    520: \li{Hessenberg form of square matrix $x$}{mathess$(x)$}
                    521: \li{$n\times n$ Hilbert matrix $H_{ij}=(i+j-1)^{-1}$}{mathilbert$(n)$}
                    522: \li{$n\times n$ Pascal triangle $P_{ij}={i\choose j}$}{matpascal$(n-1)$}
                    523: \li{companion matrix to polynomial $x$}{matcompanion$(x)$}
                    524: %
                    525: \subsec{Gaussian elimination}
                    526: \li{determinant of matrix $x$}{matdet$(x,\fl)$}
                    527: \li{kernel of matrix $x$}{matker$(x,\fl)$}
                    528: \li{intersection of column spaces of $x$ and $y$}{matintersect$(x,y)$}
                    529: \li{solve $M*X = B$ ($M$ invertible)}{matsolve$(M,B)$}
                    530: \li{as solve, modulo $D$ (col. vector)}{matsolvemod$(M,D,B)$}
                    531: \li{one sol of $M*X = B$}{matinverseimage$(M,B)$}
                    532: \li{basis for image of matrix $x$}{matimage$(x)$}
                    533: \li{supplement columns of $x$ to get basis}{matsupplement$(x)$}
                    534: \li{rows, cols to extract invertible matrix}{matindexrank$(x)$}
                    535: \li{rank of the matrix $x$}{matrank$(x)$}
                    536:
                    537: \section{Lattices \& Quadratic Forms}
                    538: \li{upper triangular Hermite Normal Form}{mathnf$(x)$}
                    539: \li{HNF of $x$ where $d$ is a multiple of det$(x)$}{mathnfmod$(x,d)$}
                    540: \li{vector of elementary divisors of $x$}{matsnf$(x)$}
                    541: \li{LLL-algorithm applied to columns of $x$}{qflll$(x,\fl)$}
                    542: \li{like \kbd{qflll}, $x$ is Gram matrix of lattice}
                    543:   {qflllgram$(x,\fl)$}
                    544: \li{LLL-reduced basis for kernel of $x$}{matkerint$(x)$}
                    545: \li{$\ZZ$-lattice $\longleftrightarrow$ $\QQ$-vector space}{matrixqz$(x,p)$}
                    546: %
                    547: \subsec{Quadratic Forms}
                    548: \li{signature of quad form $^ty*x*y$}{qfsign$(x)$}
                    549: \li{decomp into squares of $^ty*x*y$}{qfgaussred$(x)$}
                    550: \li{find up to $m$ sols of $^ty*x*y\le b$}{qfminim$(x,b,m)$}
                    551: %\li{perfection rank of $x$}{qfperfection$(x)$}
                    552: \li{eigenvals/eigenvecs for real symmetric $x$}{qfjacobi$(x)$}
                    553:
                    554: \section{Formal \& p-adic Series}
                    555: \li{truncate power series or $p$-adic number}{truncate$(x)$}
                    556: \li{valuation of $x$ at $p$}{valuation$(x,p)$}
                    557: \subsec{Dirichlet and Power Series}
                    558: \li{Taylor expansion around $0$ of $f$ w.r.t. $x$}{taylor$(f,x)$}
                    559: \li{$\sum a_kb_kt^k$ from $\sum a_kt^k$ and $\sum b_kt^k$}{serconvol$(x,y)$}
                    560: \li{$f=\sum a_k*t^k$ from $\sum (a_k/k!)*t^k$}{serlaplace$(f)$}
                    561: \li{reverse power series $F$ so $F(f(x))=x$}{serreverse$(f)$}
                    562: \li{Dirichlet series multiplication / division}{dirmul{\rm,} dirdiv$(x,y)$}
                    563: \li{Dirichlet Euler product ($b$ terms)}{direuler$(p=a,b,\expr)$}
                    564: \subsec{$p$-adic Functions}
                    565: \li{square of $x$, good for $2$-adics}{sqr$(x)$}
                    566: \li{Teichmuller character of $x$}{teichmuller$(x)$}
                    567: \li{Newton polygon of $f$ for prime $p$}{newtonpoly$(f,p)$}
                    568:
                    569: \newcolumn
                    570: \title{PARI-GP Reference Card}
                    571: \centerline{(PARI-GP version \PARIversion)}
                    572:
                    573: \section{Polynomials \& Rational Functions}
                    574: %
                    575: \li{degree of $f$}{poldegree$(f)$}
                    576: \li{coefficient of degree $n$ of $f$}{polcoeff$(f,n)$}
                    577: \li{round coeffs of $f$ to nearest integer}{round$(f,\{\&e\})$}
                    578: \li{gcd of coefficients of $f$}{content$(f)$}
                    579: \li{replace $x$ by $y$ in $f$}{subst$(f,x,y)$}
                    580: \li{discriminant of polynomial $f$}{poldisc$(f)$}
                    581: %\li{elementary divisors of Z[a]/f'(a)Z[a]}{poldiscreduced$(f)$}
                    582: \li{resultant of $f$ and $g$}{polresultant$(f,g,\fl)$}
                    583: \li{as above, give $[u,v,d]$, $xu + yv = d$}{bezoutres$(x,y)$}
                    584: \li{derivative of $f$ w.r.t. $x$}{deriv$(f,x)$}
                    585: \li{formal integral of $f$ w.r.t. $x$}{intformal$(f,x)$}
                    586: \li{reciprocal poly $x^{\deg f}f(1/x)$}{polrecip$(f)$}
                    587: \li{interpolating poly evaluated at $a$}{polinterpolate$(X,\{Y\},\{a\},\{\&e\})$}
                    588: \li{initialize $t$ for Thue equation solver}{thueinit(f)}
                    589: \li{solve Thue equation $f(x,y)=a$}{thue$(t,a,\{sol\})$}
                    590: %
                    591: \subsec{Roots and Factorization}
                    592: \li{number of real roots of $f$, $a < x\le b$}{polsturm$(f,\{a\},\{b\})$}
                    593: \li{complex roots of $f$}{polroots$(f)$}
                    594: \li{symmetric powers of roots of $f$ up to $n$}{polsym$(f,n)$}
                    595: \li{roots of $f \mod p$}{polrootsmod$(f,p,\fl)$}
                    596: \li{factor $f$}{factor$(f,\{lim\})$}
                    597: \li{factorization of $f\mod p$}{factormod$(f,p,\fl)$}
                    598: \li{factorization of $f$ over $\FF_{p^a}$}{factorff$(f,p,a)$}
                    599: \li{$p$-adic fact. of $f$ to prec. $r$}{factorpadic$(f,p,r,\fl)$}
                    600: \li{$p$-adic roots of $f$ to prec. $r$}{polrootspadic$(f,p,r)$}
                    601: \li{$p$-adic root of $f$ cong. to $a\mod p$}{padicappr$(f,a)$}
                    602: \li{Newton polygon of $f$ for prime $p$}{newtonpoly$(f,p)$}
                    603: %
                    604: \subsec{Special Polynomials}
                    605: \li{$n$th cyclotomic polynomial in var. $v$}{polcyclo$(n,\{v\})$}
                    606: \li{$d$-th degree subfield of $\QQ(\zeta_n)$} {polsubcyclo$(n,d,\{v\})$}
                    607: \li{$n$-th Legendre polynomial}{pollegendre$(n)$}
                    608: \li{$n$-th Tchebicheff polynomial}{poltchebi$(n)$}
                    609: \li{Zagier's polynomial of index $n$,$m$}{polzagier$(n,m)$}
                    610:
                    611: \section{Transcendental Functions}
                    612: \li{real, imaginary part of $x$}{real$(x)$, imag$(x)$}
                    613: \li{absolute value, argument of $x$}{abs$(x)$, arg$(x)$}
                    614: \li{square/nth root of $x$}{sqrt$(x)$, sqrtn$(x,n,\&z)$}
                    615: \li{trig functions}{sin, cos, tan, cotan}
                    616: \li{inverse trig functions}{asin, acos, atan}
                    617: \li{hyperbolic functions}{sinh, cosh, tanh}
                    618: \li{inverse hyperbolic functions}{asinh, acosh, atanh}
                    619: \li{exponential of $x$}{exp$(x)$}
                    620: \li{natural log of $x$}{ln$(x)$ {\rm or} log$(x)$}
                    621: %
                    622: \li{gamma function $\Gamma(x)=\int_0^\infty e^{-t}t^{x-1}dt$}{gamma$(x)$}
                    623: %\li{half-integer gamma function $\Gamma(n+1/2)$}{gammah$(n)$}
                    624: \li{logarithm of gamma function}{lngamma$(x)$}
                    625: \li{$\psi(x)=\Gamma'(x)/\Gamma(x)$}{psi$(x)$}
                    626: \li{incomplete gamma function ($y=\Gamma(s)$)}{incgam$(s,x,\{y\})$}
                    627: \li{exponential integral $\int_x^\infty e^{-t}/t\,dt$}{eint1$(x)$}
                    628: \li{error function $2/\sqrt\pi\int_x^\infty e^{-t^2}dt$}{erfc$(x)$}
                    629: \li{dilogarithm of $x$}{dilog$(x)$}
                    630: \li{$m$th polylogarithm of $x$}{polylog$(m,x,\fl)$}
                    631: \li{$U$-confluent hypergeometric function}{hyperu$(a,b,u)$}
                    632: \li{$J$-Bessel function $J_{n+1/2}(x)$}{besseljh$(n,x)$}
                    633: \li{$K$-Bessel function of index \var{nu}}{besselk$(\var{nu},x)$}
                    634:
                    635: \section{Elementary Arithmetic Functions}
                    636: \li{vector of binary digits of $|x|$}{binary$(x)$}
                    637: \li{give bit number $n$ of integer $x$}{bittest$(x,n)$}
                    638: \li{ceiling of $x$}{ceil$(x)$}
                    639: \li{floor of $x$}{floor$(x)$}
                    640: \li{fractional part of $x$}{frac$(x)$}
                    641: \li{round $x$ to nearest integer}{round$(x,\{\&e\})$}
                    642: \li{truncate $x$}{truncate$(x,\{\&e\})$}
                    643: \li{gcd of $x$ and $y$}{gcd$(x,y)$}
                    644: \li{LCM of $x$ and $y$}{lcm$(x,y)$}
                    645: \li{gcd of entries of a vector/matrix}{content$(x)$}
                    646: \par
                    647: \subsec{Primes and Factorization}
                    648: \li{add primes in $v$ to the prime table}{addprimes$(v)$}
                    649: \li{the $n$th prime}{prime$(n)$}
                    650: \li{vector of first $n$ primes}{primes$(n)$}
                    651: \li{smallest prime $\ge x$}{nextprime$(x)$}
                    652: \li{largest prime $\le x$}{precprime$(x)$}
                    653: \li{factorization of $x$}{factor$(x,\{lim\})$}
                    654: \li{reconstruct $x$ from its factorization}{factorback$(fa,\{nf\})$}
                    655: \par
                    656: \subsec{Divisors}
                    657: \li{number of distinct prime divisors}{omega$(x)$}
                    658: \li{number of prime divisors  with mult}{bigomega$(x)$}
                    659: \li{number of divisors of $x$}{numdiv$(x)$}
                    660: \li{row vector of divisors of $x$}{divisors$(x)$}
                    661: \li{sum of ($k$-th powers of) divisors of $x$}{sigma$(x,\{k\})$}
                    662: \par
                    663: \subsec{Special Functions and Numbers}
                    664: \li{binomial coefficient $x\choose y$}{binomial$(x,y)$}
                    665: \li{Bernoulli number $B_n$ as real}{bernreal$(n)$}
                    666: \li{Bernoulli vector $B_0,B_2,\ldots,B_{2n}$}{bernvec$(n)$}
                    667: \li{$n$th Fibonacci number}{fibonacci$(n)$}
                    668: \li{Euler $\phi$-function}{eulerphi$(x)$}
                    669: \li{M\"obius $\mu$-function}{moebius$(x)$}
                    670: \li{Hilbert symbol of $x$ and $y$ (at $p$)}{hilbert$(x,y,\{p\})$}
                    671: \li{Kronecker-Legendre symbol $({x\over y})$}{kronecker$(x,y)$}
                    672: \par
                    673: \subsec{Miscellaneous}
                    674: \li{integer or real factorial of $x$}{$x!$ {\rm or} fact$(x)$}
                    675: \li{integer square root of $x$}{sqrtint$(x)$}
                    676: \li{solve $z\equiv x$ and $z\equiv y$}{chinese$(x,y)$}
                    677: \li{minimal $u,v$ so $xu+yv=\gcd(x,y)$}{bezout$(x,y)$}
                    678: \li{multiplicative order of $x$ (intmod)}{znorder$(x)$}
                    679: \li{primitive root mod prime power $q$}{znprimroot$(q)$}
                    680: \li{structure of $(\ZZ/n\ZZ)^*$}{znstar$(n)$}
                    681: \li{continued fraction of $x$}{contfrac$(x,\{b\},\{lmax\})$}
                    682: \li{last convergent of continued fraction $x$}{contfracpnqn$(x)$}
                    683: \li{best rational approximation to $x$}{bestappr$(x,k)$}
                    684:
                    685: \section{True-False Tests}
                    686: \li{is $x$ the disc. of a quadratic field?}{isfundamental$(x)$}
                    687: \li{is $x$ a prime?}{isprime$(x)$}
                    688: \li{is $x$ a strong pseudo-prime?}{ispseudoprime$(x)$}
                    689: \li{is $x$ square-free?}{issquarefree$(x)$}
                    690: \li{is $x$ a square?}{issquare$(x,\{\&n\})$}
                    691: \li{is \var{pol}\ irreducible?}{polisirreducible$(\var{pol})$}
                    692:
                    693: % This goes at the bottom of the second page (column 6)
                    694: \copyrightnotice
                    695: %
                    696:
                    697: %%%%%%%%%%% Extra Material (part II)
                    698: %
                    699: \newcolumn
                    700: \title{PARI-GP Reference Card (2)}
                    701: \centerline{(PARI-GP version \PARIversion)}
                    702:
                    703: \section{Elliptic Curves}
                    704: %
                    705: Elliptic curve initially given by $5$-tuple $E=$\kbd{[a1,a2,a3,a4,a6]}.
                    706: Points are \kbd{[x,y]}, the origin is \kbd{[0]}.
                    707: \hfill\break
                    708: \li{Initialize elliptic struct. $\var{ell}$, i.e create}{ellinit$(E,\fl)$}
                    709: \leavevmode\strut\hskip1em
                    710: $a_1,a_2,a_3,a_4,a_6,b_2,b_4,b_6,b_8,c_4,c_6,disc,j$. This data can be
                    711: recovered by typing \kbd{\var{ell}.a1},$\dots$,\kbd{\var{ell}.j}.
                    712: If $\var{fl}$ omitted, also
                    713: \hfill\break
                    714: \beginindentedkeys
                    715: \li{$E$ defined over $\RR$}{}
                    716: \begindoubleindentedkeys
                    717: \key{$x$-coords. of points of order $2$}{\var{ell}.roots}
                    718: \key{real and complex periods}{\var{ell}.omega}
                    719: \key{associated quasi-periods}{\var{ell}.eta}
                    720: \key{volume of complex lattice}{\var{ell}.area}
                    721: \enddoubleindentedkeys
                    722: \li{$E$ defined over $\QQ_p$, $|j|_p>1$}{}
                    723: \begindoubleindentedkeys
                    724: \key{$x$-coord. of unit $2$ torsion point}{\var{ell}.roots}
                    725: \key{Tate's $[u^2, u, q]$}{\var{ell}.tate}
                    726: \key{Mestre's $w$}{\var{ell}.w}
                    727: \endindentedkeys
                    728: \li{change curve $E$ using $v=[u,r,s,t]$}{ellchangecurve$(ell,v)$}
                    729: \li{change point $z$ using $v=[u,r,s,t]$}{ellchangepoint$(z,v)$}
1.2     ! noro      730: \li{cond, min mod, Tamagawa nmbr $[N,v,c]$}{ellglobalred$(ell)$}
1.1       noro      731: \li{Kodaira type of $p$ fiber of $E$}{elllocalred$(ell,p)$}
                    732: \li{add points $z1+z2$}{elladd$(ell,z1,z2)$}
                    733: \li{subtract points $z1-z2$}{ellsub$(ell,z1,z2)$}
                    734: \li{compute $n\cdot z$}{ellpow$(ell,z,n)$}
                    735: \li{check if $z$ is on $E$}{ellisoncurve$(ell,z)$}
                    736: \li{order of torsion point $z$}{ellorder$(ell,z)$}
                    737: \li{torsion subgroup with generators}{elltors$(ell)$}
                    738: \li{$y$-coordinates of point(s) for $x$}{ellordinate$(ell,x)$}
                    739: \li{canonical bilinear form taken at $z1$, $z2$}{ellbil$(ell,z1,z2)$}
                    740: \li{canonical height of $z$}{ellheight$(ell,z,\fl)$}
                    741: \li{height regulator matrix for pts in $x$}{ellheightmatrix$(ell,x)$}
                    742: \li{$p$th coeff $a_p$ of $L$-function, $p$ prime}{ellap$(ell,p)$}
                    743: \li{$k$th coeff $a_k$ of $L$-function}{ellak$(ell,k)$}
                    744: \li{vector of first $n$ $a_k$'s in $L$-function}{ellan$(ell,n)$}
                    745: \li{$L(E,s)$, set $A\approx1$}{elllseries$(ell,s,\{A\})$}
                    746: \li{root number for $L(E,.)$ at $p$}{ellrootno$(ell,\{p\})$}
                    747: \li{modular parametrization of $E$}{elltaniyama$(ell)$}
                    748: \li{point $[\wp(z),\wp'(z)]$ corresp. to $z$}{ellztopoint$(ell,z)$}
                    749: \li{complex $z$ such that $p=[\wp(z),\wp'(z)]$}{ellpointtoz$(ell,p)$}
                    750:
                    751: \section{Elliptic \& Modular Functions}
                    752: %
                    753: \li{arithmetic-geometric mean}{agm$(x,y)$}
                    754: \li{elliptic $j$-function $1/q+744+\cdots$}{ellj$(x)$}
                    755: \li{Weierstrass $\sigma$ function}{ellsigma$(ell,z,\fl)$}
                    756: \li{Weierstrass $\wp$ function}{ellwp$(ell,\{z\},\fl)$}
                    757: \li{Weierstrass $\zeta$ function}{ellzeta$(ell,z)$}
                    758: \li{modified Dedekind $\eta$ func. $\prod(1-q^n)$}{eta$(x,\fl)$}
                    759: \li{Jacobi sine theta function}{theta$(q,z)$}
                    760: \li{k-th derivative at z=0 of \kbd{theta}$(q,z)$}{thetanullk$(q,k)$}
                    761: \li{Weber's $f$ functions}{weber$(x,\fl)$}
                    762: \li{Riemann's zeta $\zeta(s)=\sum n^{-s}$}{zeta$(s)$}
                    763: %
                    764: \shortcopyrightnotice
                    765: \newcolumn
                    766:
                    767: \section{Graphic Functions}
                    768: \li{crude graph of \expr\ between $a$ and $b$}{plot$(X=a,b,expr)$}
                    769: \subsec{High-resolution plot {\rm (immediate plot)}}
                    770: \li{plot \expr\ between $a$ and $b$}{ploth$(X=a,b,expr,\fl,\{n\})$}
                    771: \li{plot points given by lists $lx$, $ly$}{plothraw$(lx,ly,\fl)$}
                    772: \li{terminal dimensions}{plothsizes$()$}
                    773: %
                    774: \subsec{Rectwindow functions}
                    775: \li{init window $w$, with size $x$,$y$}{plotinit$(w,x,y)$}
                    776: \li{erase window $w$}{plotkill$(w)$}
                    777: \li{copy $w$ to $w2$ with offset $(dx,dy)$}{plotcopy$(w,w2,dx,dy)$}
                    778: \li{scale coordinates in $w$}{plotscale$(w,x_1,x_2,y_1,y_2)$}
                    779: \li{\kbd{ploth} in $w$}{plotrecth$(w,X=a,b,expr,\fl,\{n\})$}
                    780: \li{\kbd{plothraw} in $w$}{plotrecthraw$(w,data,\fl)$}
                    781: \li{draw window $w_1$ at $(x_1,y_1)$, \dots} {plotdraw$([[w_1,x_1,y_1],\dots])$}
                    782: %
                    783: \subsec{Low-level Rectwindow Functions}
                    784: %\li{}{plotlinetype$(w,)$}
                    785: %\li{}{plotpointtype$(w,)$}
                    786: %\li{}{plotterm$(w,)$}
                    787: \li{set current drawing color in $w$ to $c$}{plotcolor$(w,c)$}
                    788: \li{current position of cursor in $w$}{plotcursor$(w)$}
                    789: %
                    790: \li{write $s$ at cursor's position}{plotstring$(w,s)$}
                    791: \li{move cursor to $(x,y)$}{plotmove$(w,x,y)$}
                    792: \li{move cursor to $(x+dx,y+dy)$}{plotrmove$(w,dx,dy)$}
                    793: \li{draw a box to $(x_2,y_2)$}{plotbox$(w,x_2,y_2)$}
                    794: \li{draw a box to $(x+dx,y+dy)$}{plotrbox$(w,dx,dy)$}
                    795: \li{draw polygon}{plotlines$(w,lx,ly,\fl)$}
                    796: \li{draw points}{plotpoints$(w,lx,ly)$}
                    797: \li{draw line to $(x+dx,y+dy)$}{plotrline$(w,dx,dy)$}
                    798: \li{draw point $(x+dx,y+dy)$}{plotrpoint$(w,dx,dy)$}
                    799: %
                    800: \subsec{Postscript Functions}
                    801: \li{as {\tt ploth}}{psploth$(X=a,b,expr,\fl,\{n\})$}
                    802: \li{as {\tt plothraw}}{psplothraw$(lx,ly,\fl)$}
                    803: \li{as {\tt plotdraw}}{psdraw$([[w_1,x_1,y_1],\dots])$}
                    804: \newcolumn
                    805:
                    806: \section{Binary Quadratic Forms}
                    807: %
                    808: \li{create $ax^2+bxy+cy^2$ (distance $d$) }{Qfb$(a,b,c,\{d\})$}
                    809: \li{reduce $x$ ($s =\sqrt{D}$, $l=\lfloor s\rfloor$)}
                    810:   {qfbred$(x,\fl,\{D\},\{l\},\{s\})$}
                    811: \li{composition of forms}{$x*y$ {\rm or }qfbnucomp$(x,y,l)$}
                    812: \li{$n$-th power of form}{$x$\pow$n$ {\rm or }qfbnupow$(x,n)$}
                    813: \li{composition without reduction}{qfbcompraw$(x,y)$}
                    814: \li{$n$-th power without reduction}{qfbpowraw$(x,n)$}
                    815: \li{prime form of disc. $x$ above prime $p$}{qfbprimeform$(x,p)$}
                    816: \li{class number of disc. $x$}{qfbclassno$(x)$}
                    817: \li{Hurwitz class number of disc. $x$}{qfbhclassno$(x)$}
                    818:
                    819: \section{Quadratic Fields}
                    820: %
                    821: \li{quadratic number $\omega=\sqrt x$ or $(1+\sqrt x)/2$}{quadgen$(x)$}
                    822: \li{minimal polynomial of $\omega$}{quadpoly$(x)$}
                    823: \li{discriminant of $\QQ(\sqrt{D})$}{quaddisc$(x)$}
                    824: \li{regulator of real quadratic field}{quadregulator$(x)$}
                    825: \li{fundamental unit in real $\QQ(x)$}{quadunit$(x)$}
                    826: \li{class group of $\QQ(\sqrt{D})$}{quadclassunit$(D,\fl,\{t\})$}
                    827: \li{Hilbert class field of $\QQ(\sqrt{D})$}{quadhilbert$(D,\fl)$}
                    828: \li{ray class field modulo $f$ of $\QQ(\sqrt{D})$}{quadray$(D,f,\fl)$}
                    829:
                    830: \section{General Number Fields: Initializations}
                    831: A number field $K$ is given by a monic irreducible $f\in\ZZ[X]$.\hfill\break
                    832: \li{init number field structure \var{nf}}{nfinit$(f,\fl)$}
                    833: \subsec{nf members:}
                    834: \beginindentedkeys
                    835: \key{polynomial defining \var{nf}, $f(\theta)=0$}{\var{nf}.pol}
                    836: \key{number of [real,complex] places}{\var{nf}.sign}
                    837: \key{discriminant of \var{nf}}{\var{nf}.disc}
                    838: \key{$T_2$ matrix}{\var{nf}.t2}
                    839: \key{vector of roots of $f$}{\var{nf}.roots}
                    840: \key{integral basis of $\ZZ_K$ as powers of $\theta$}{\var{nf}.zk}
                    841: \key{different}{\var{nf}.diff}
                    842: \key{codifferent}{\var{nf}.codiff}
                    843: \endindentedkeys
                    844: \li{recompute \var{nf}\ using current precision}{nfnewprec$(nf)$}
                    845: \li{init relative \var{rnf}\ given by $g=0$ over $K$}{rnfinit$(\var{nf},g)$}
                    846: %
                    847: \li{init big number field structure \var{bnf}}{bnfinit$(f,\fl)$}
                    848: \subsec{bnf members: {\rm same as \var{nf}, plus}}
                    849: \beginindentedkeys
                    850: \key{underlying \var{nf}}{\var{bnf}.nf}
                    851: \key{classgroup}{\var{bnf}.clgp}
                    852: \key{regulator}{\var{bnf}.reg}
                    853: \key{fundamental units}{\var{bnf}.fu}
                    854: \key{torsion units}{\var{bnf}.tu}
                    855: \key{$[tu,fu]$, $[fu,tu]$}{\var{bnf}.tufu{\rm/}futu}
                    856: \endindentedkeys
                    857: \li{compute a \var{bnf}\ from small \var{bnf}}{bnfmake$(\var{sbnf})$}
                    858: %
                    859: \li{add $S$-class group and units, yield \var{bnfs}}{bnfsunit$(\var{nf},S)$}
                    860: \li{init class field structure \var{bnr}}{bnrinit$(\var{bnf},m,\fl)$}
                    861: %
                    862: \subsec{bnr members: {\rm same as \var{bnf}, plus}}
                    863: \beginindentedkeys
                    864: \key{underlying \var{bnf}}{\var{bnr}.bnf}
                    865: \key{structure of $(\ZZ_K/m)^*$}{\var{bnr}.zkst}
                    866: \endindentedkeys
                    867:
                    868: \section{Simple Arithmetic Invariants (nf)}
                    869: Elements are rational numbers, polynomials, polmods, or column vectors (on
                    870: integral basis \kbd{\var{nf}.zk}).\hfill\break
                    871: \li{integral basis of field def. by $f=0$}{nfbasis$(f)$}
                    872: \li{field discriminant of field $f=0$}{nfdisc$(f)$}
                    873: \li{reverse polmod $a=A(X)\mod T(X)$}{modreverse$(a)$}
                    874: \li{Galois group of field $f=0$, $\deg f\le 11$}{polgalois$(f)$}
                    875: \li{smallest poly defining $f=0$}{polredabs$(f,\fl)$}
                    876: \li{small polys defining subfields of $f=0$}{polred$(f,\fl,\{p\})$}
                    877: \li{small polys defining suborders of $f=0$}{polredord$(f)$}
                    878: \li{poly of degree $\le k$ with root $x\in\CC$}{algdep$(x,k)$}
                    879: \li{small linear rel.\ on coords of vector $x$}{lindep$(x)$}
                    880: \li{are fields $f=0$ and $g=0$ isomorphic?}{nfisisom$(f,g)$}
                    881: \li{is field $f=0$ a subfield of $g=0$?}{nfisincl$(f,g)$}
                    882: \li{compositum of $f=0$, $g=0$}{polcompositum$(f,g,\fl)$}
                    883: %
                    884: \li{basic element operations (prefix \kbd{nfelt}):}{}
                    885: \leavevmode\strut\hskip1em
                    886: $($\kbd{nfelt}$)$\kbd{mul}, \kbd{pow}, \kbd{div}, \kbd{diveuc},
                    887: \kbd{mod}, \kbd{divrem}, \kbd{val}
                    888: \hfill\break
                    889: %
                    890: \li{express $x$ on integer basis}{nfalgtobasis$(\var{nf},x)$}
                    891: \li{express element\ $x$ as a polmod}{nfbasistoalg$(\var{nf},x)$}
                    892: \li{quadratic Hilbert symbol (at $p$)}{nfhilbert$(\var{nf},a,b,\{p\})$}
                    893: \li{roots of $g$ belonging to {\tt nf}}{nfroots$(\var{nf},g)$}
                    894: \li{factor $g$ in {\tt nf}}{nffactor$(\var{nf},g)$}
                    895: \li{factor $g$ mod prime $pr$ in {\tt nf}}{nffactormod$(\var{nf},g,pr)$}
                    896: \li{number of roots of $1$ in {\tt nf}}{nfrootsof1$(nf)$}
                    897: \li{conjugates of a root $\theta$ of {\tt nf}}{nfgaloisconj$(\var{nf},\fl)$}
                    898: \li{apply Galois automorphism $s$ to $x$}{nfgaloisapply$(\var{nf},s,x)$}
                    899: \li{subfields (of degree $d$) of {\tt nf}}{nfsubfields$(\var{nf},\{d\})$}
                    900: %
                    901: \subsec{Dedekind Zeta Function $\zeta_K$}
                    902: \li{$\zeta_K$ as Dirichlet series, $N(I)<b$}{dirzetak$(\var{nf},b)$}
                    903: \li{init \var{nfz}\ for field $f=0$}{zetakinit$(f)$}
                    904: \li{compute $\zeta_K(s)$}{zetak$(\var{nfz},s,\fl)$}
                    905: \li{Artin root number of $K$}{bnrrootnumber$(\var{bnr},\var{chi},\fl)$}
                    906:
                    907: \section{Class Groups \& Units (\var{bnf}, bnr)}
                    908: \leavevmode
                    909: $a1,\{a2\},\{a3\}$ usually $bnr,subgp$ or $\var{bnf},module,\{subgp\}$
                    910: \hfill\break
                    911: %
                    912: \li{remove GRH assumption from \var{bnf}}{bnfcertify$(\var{bnf})$}
                    913: \li{expo.~of ideal $x$ on class gp}{bnfisprincipal$(\var{bnf},x,\fl)$}
                    914: \li{expo.~of ideal $x$ on ray class gp}{bnrisprincipal$(\var{bnr},x,\fl)$}
                    915: \li{expo.~of $x$ on fund.~units}{bnfisunit$(\var{bnf},x)$}
                    916: \li{as above for $S$-units}{bnfissunit$(\var{bnfs},x)$}
                    917: \li{fundamental units of \var{bnf}}{bnfunit$(\var{bnf})$}
                    918: \li{signs of real embeddings of \kbd{\var{bnf}.fu}}{bnfsignunit$(\var{bnf})$}
                    919: %
                    920: \subsec{Class Field Theory}
                    921: \li{ray class group structure for mod.~$m$}{bnrclass$(\var{bnf},m,\fl)$}
                    922: \li{ray class number for mod.~$m$}{bnrclassno$(\var{bnf},m)$}
                    923: \li{discriminant of class field ext}{bnrdisc$(a1,\{a2\},\{a3\})$}
                    924: \li{ray class numbers, $l$ list of mods}{bnrclassnolist$(\var{bnf},l)$}
                    925: \li{discriminants of class fields}{bnrdisclist$(\var{bnf},l,\{arch\},\fl)$}
                    926: \li{decode output from \kbd{bnrdisclist}}{bnfdecodemodule$(\var{nf},fa)$}
                    927: \li{is modulus the conductor?}{bnrisconductor$(a1,\{a2\},\{a3\})$}
                    928: \li{conductor of character $chi$}{bnrconductorofchar$(\var{bnr},chi)$}
                    929: \li{conductor of extension}{bnrconductor$(a1,\{a2\},\{a3\},\fl)$}
                    930: \li{conductor of extension def.\ by $g$}{rnfconductor$(\var{bnf},g)$}
                    931: \li{Artin group of ext.\ def'd by $g$}{rnfnormgroup$(\var{bnr},g)$}
                    932: \li{subgroups of {\tt bnr}, index $<=b$}{subgrouplist$(\var{bnr},b,\fl)$}
                    933: \li{rel.\ eq.\ for class field def'd by $sub$}{rnfkummer$(\var{bnr},sub,\{d\})$}
                    934: \li{same, using Stark units (real field)}{bnrstark$(\var{bnr},sub,\fl)$}
                    935:
                    936: \newcolumn
                    937: \title{PARI-GP Reference Card (2)}
                    938: \centerline{(PARI-GP version \PARIversion)}
                    939:
                    940: \section{Ideals}
                    941: Ideals are elements, primes, or matrix of generators in HNF.\hfill\break
                    942: \li{is $id$ an ideal in {\tt nf}?}{nfisideal$(\var{nf},id)$}
                    943: \li{is $x$ principal in {\tt bnf}?}{bnfisprincipal$(\var{bnf},x)$}
                    944: \li{principal ideal generated by $x$}{idealprincipal$(\var{nf},x)$}
                    945: \li{principal idele generated by $x$}{ideleprincipal$(\var{nf},x)$}
                    946: \li{give $[a,b]$, s.t.~ $a\ZZ_K+b\ZZ_K = x$}{idealtwoelt$(\var{nf},x,\{a\})$}
                    947: \li{put ideal $a$ ($a\ZZ_K+b\ZZ_K$) in HNF form}{idealhnf$(\var{nf},a,\{b\})$}
                    948: \li{norm of ideal $x$}{idealnorm$(\var{nf},x)$}
                    949: \li{minimum of ideal $x$ (direction $v$)}{idealmin$(\var{nf},x,v)$}
                    950: \li{LLL-reduce the ideal $x$ (direction $v$)}{idealred$(\var{nf},x,\{v\})$}
                    951: %
                    952: \subsec{Ideal Operations}
                    953: \li{add ideals $x$ and $y$}{idealadd$(\var{nf},x,y)$}
                    954: \li{multiply ideals $x$ and $y$}{idealmul$(\var{nf},x,y,\fl)$}
                    955: \li{intersection of ideals $x$ and $y$}{idealintersect$(\var{nf},x,y,\fl)$}
                    956: \li{$n$-th power of ideal $x$}{idealpow$(\var{nf},x,n,\fl)$}
                    957: \li{inverse of ideal $x$}{idealinv$(\var{nf},x)$}
                    958: \li{divide ideal $x$ by $y$}{idealdiv$(\var{nf},x,y,\fl)$}
                    959: \li{Find $[a,b]\in x\times y$, $a+b=1$}{idealaddtoone$(\var{nf},x,\{y\})$}
                    960: %
                    961: \subsec{Primes and Multiplicative Structure}
                    962: \li{factor ideal $x$ in {\tt nf}}{idealfactor$(\var{nf},x)$}
                    963: \li{recover $x$ from its factorization in {\tt nf}}{factorback$(x,nf)$}
                    964: \li{decomposition of prime $p$ in {\tt nf}}{idealprimedec$(\var{nf},p)$}
                    965: \li{valuation of $x$ at prime ideal $pr$}{idealval$(\var{nf},x,pr)$}
                    966: \li{weak approximation theorem in {\tt nf}}{idealchinese$(\var{nf},x,y)$}
                    967: \li{give $bid=$structure of $(\ZZ_K/id)^*$}{idealstar$(\var{nf},id,\fl)$}
                    968: \li{discrete log of $x$ in $(\ZZ_K/bid)^*$}{ideallog$(\var{nf},x,bid)$}
                    969: \li{\kbd{idealstar} of all ideals of norm $\le b$}{ideallist$(\var{nf},b,\fl)$}
                    970: \li{add archimedean places}{ideallistarch$(\var{nf},b,\{ar\},\fl)$}
                    971: \li{init \kbd{prmod} structure}{nfmodprinit$(\var{nf},pr)$}
                    972: \li{kernel of matrix $M$ in $(\ZZ_K/pr)^*$}{nfkermodpr$(\var{nf},M,prmod)$}
                    973: \li{solve $M x = B$ in $(\ZZ_K/pr)^*$}{nfsolvemodpr$(\var{nf},M,B,prmod)$}
                    974:
                    975: \section{Relative Number Fields (rnf)}
                    976: Extension $L/K$ is defined by $g\in K[x]$. We have $order\subset L$.
                    977: \hfill\break
                    978: %
                    979: \li{absolute equation of $L$}{rnfequation$(\var{nf},g,\fl)$}
                    980: %
                    981: \subsec{Lifts and Push-downs}
                    982: \li{absolute $\rightarrow$ relative repres.\ for $x$}
                    983:   {rnfeltabstorel$(\var{rnf},x)$}
                    984: \li{relative $\rightarrow$ absolute repres.\ for $x$}
                    985:   {rnfeltreltoabs$(\var{rnf},x)$}
                    986: \li{lift $x$ to the relative field}{rnfeltup$(\var{rnf},x)$}
                    987: \li{push $x$ down to the base field}{rnfeltdown$(\var{rnf},x)$}
                    988: \leavevmode idem for $x$ ideal:
                    989: \kbd{$($rnfideal$)$reltoabs}, \kbd{abstorel}, \kbd{up}, \kbd{down}\hfill\break
                    990: %
                    991: \li{relative {\tt nfalgtobasis}}{rnfalgtobasis$(\var{rnf},x)$}
                    992: \li{relative {\tt nfbasistoalg}}{rnfbasistoalg$(\var{rnf},x)$}
                    993: \li{relative {\tt idealhnf}}{rnfidealhnf$(\var{rnf},x)$}
                    994: \li{relative {\tt idealmul}}{rnfidealmul$(\var{rnf},x,y)$}
                    995: \li{relative {\tt idealtwoelt}}{rnfidealtwoelt$(\var{rnf},x)$}
                    996: %
                    997: \subsec{Projective $\ZZ_K$-modules, maximal order}
                    998: \li{relative {\tt polred}}{rnfpolred$(\var{nf},g)$}
                    999: \li{relative {\tt polredabs}}{rnfpolredabs$(\var{nf},g)$}
                   1000: \li{characteristic poly.\ of $a$ mod $g$}{rnfcharpoly$(\var{nf},g,a,\{v\})$}
                   1001: \li{relative Dedekind criterion, prime $pr$}{rnfdedekind$(\var{nf},g,pr)$}
                   1002: \li{discriminant of relative extension}{rnfdisc$(\var{nf},g)$}
                   1003: \li{pseudo-basis of $\ZZ_L$}{rnfpseudobasis$(\var{nf},g)$}
                   1004: \li{relative HNF basis of $order$}{rnfhnfbasis$(\var{bnf},order)$}
                   1005: \li{reduced basis for $order$}{rnflllgram$(\var{nf},g,order)$}
                   1006: \li{determinant of pseudo-matrix $A$}{rnfdet$(\var{nf},A)$}
                   1007: \li{Steinitz class of $order$}{rnfsteinitz$(\var{nf},order)$}
                   1008: \li{is \var{order} a free $\ZZ_K$-module?}{rnfisfree$(\var{bnf},\var{order})$}
                   1009: \li{true basis of \var{order}, if it is free}{rnfbasis$(\var{bnf},\var{order})$}
                   1010: %
                   1011: \subsec{Norms}
                   1012: \li{absolute norm of ideal $x$}{rnfidealnormabs$(\var{rnf},x)$}
                   1013: \li{relative norm of ideal $x$}{rnfidealnormrel$(\var{rnf},x)$}
                   1014: \li{solutions of $N_{K/\QQ}(y)=x\in \ZZ$}{bnfisintnorm$(\var{bnf},x)$}
                   1015: \li{is $x\in\QQ$ a norm from $K$?}{bnfisnorm$(\var{bnf},x,\fl)$}
1.2     ! noro     1016: \li{initialize $T$ for norm eq.~solver}{rnfisnorminit$(K,pol,\fl)$}
        !          1017: \li{is $a\in K$ a norm from $L$?}{rnfisnorm$(T,a,\fl)$}
1.1       noro     1018: \vfill
                   1019: \copyrightnotice
                   1020: \bye
                   1021: % Local variables:
                   1022: % compile-command: "tex PARIRefCard"
                   1023: % End:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>