[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.1.1.1

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

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