GP(1)
π GP(1) β the PARI calculator, but make it make sense π
okay bestie, buckle up, because this is gp, the PARI calculator, and she is not like your phone's calculator app. this is the general commands manual version, and I'm gonna walk you through every single thing in here, no skips, no cap. π
β¨ NAME β¨
gp β literally The PARI calculator. that's the whole name. iconic behavior. π
β¨ SYNOPSIS β¨
gp [-s stacksize] [-p primelimit] [--emacs] [-f|--fast] [-q|--quiet]
[-D|--default key=val] [--help] [--test] [--texmacs] [--version]
[--version-short] [ file1 file2 ...]
look at her. so many little flags. a whole wardrobe. π
β¨ DESCRIPTION β¨
so gp invokes the PARI-GP calculator gp. and gp?? it's an advanced programmable calculator β she specializes in number theory, and the way she works is: she computes symbolically as long as she possibly can, goes numerically when she has to, and she is absolutely packed with arithmetic functions. we're talking factorizations, elliptic curves, Galois theory, class field theory, modular forms, etc. etc. etc. a whole buffet. π
commands are written in the GP scripting language, and you either type them in interactively or load them from files. main character energy, honestly.
and okay, important: if files file1, file2, ... are sitting there at the end of the command line, they get loaded on startup. but they must be written in the GP language, bestie. no exceptions. π
β¨ OPTIONS β¨
first up, the general vibe check: command line options come in both short form (-f) and POSIX-like (--fast). and here's a cute little trick β numeric arguments can be followed by a modifier k, M or G at your convenience, and in that case the argument gets multiplied by 10^3, 10^6, or 10^9 respectively. slay. β¨
-f,--fastβ Fast start (or factory settings). She will not read.gprc(see below) upon startup. no baggage, fresh start, we love that for her.-plimit β [DEPRECATED] okay so upon startup,gpcomputes a table of small primes used in number-theoretic applications. If primelimit is set, the table includes primes up to that bound instead of the default (=500000). > heads up bestie: it is now mostly useless to change this value. let her cook with the default. π-q,--quietβ Quiet mode. No headers, no history numbers, and she will not say goodbye. (rude but valid.) π-D,--default key=valβ performsdefault(key, val)on startup, overriding values from thegprcpreferences file. important:valmust be a constant value and is not allowed to involve any computation β like,1+1is forbidden, bestie, don't try it. any number of these default-setting statements may appear on the command line. and a key may be set multiple times β the last setting takes precedence. periodt.-slimit β Size of thegpinternal stack allocated on startup. Whengpruns out of space, it interrupts the current computation and raises a stack overflow exception. If this happens frequently, start with a bigger stack. The stack size can also be increased from withingp, usingdefault(parisize,limit); it's convenient to setparisizefrom your.gprcso that the setting is persistent across sessions; a value of80MBis sensible. We strongly advise to also setparisizemaxto a positive, much larger, value in your.gprc(about what you believe your machine can stand, usually half the available RAM or so): this strives to fit computation in theparisizerange but allows it to temporarily go beyond it (up toparisizemax). Note that computations with a smaller stack may be more efficient due to better data locality. Finally,threadsizeandthreadsizemaxplay analogous roles in the parallel version ofgp. π--emacsβgpcan be run in an Emacs shell (see GP User's manual for details). This flag is then required for smooth interaction with the PariEmacs package (pari.el). It is set automatically by thepari.elpackage, and will produce display oddities if you set it outside of an Emacs session. > don't be messy with this one. π--helpβ print a summary of available command-line options.--testβ rungpin test mode: suppress printing of history numbers and wrap long output lines (to get readable diff output). For benches only. β--texmacsβgpcan be run from a TeXmacs frontend. This flag is set by TeXmacs, to enable special purpose communication channels. Do not set it yourself. > fr fr, hands off. π--versionβ output version info (banner) then exit.--version-shortβ output version number then exit.
β¨ USE β¨
?β to get online help. πΈ??β to get extended online help (more precisely, to call the external help program,gphelpby default).quit(or\q), orEOF(Ctrl-D) β to quitgp. bye bestie π«Ά
and the following works only when gp was linked with the GNU readline library:
- arrow keys β for editing and viewing the input history. β¬οΈβ¬οΈ
TABβ for automatic completion. β¨
β¨ MANUALS β¨
the following material is included in the standard distribution (originally in TeX format) and can also be downloaded at
http://pari.math.u-bordeaux.fr/doc.html
or viewed online at
http://pari.math.u-bordeaux.fr/dochtml/html/
- The User's Guide to PARI/GP (
users.dvi) - The User's Guide to the PARI library (
library.dvi) - The Developer's Guide to the PARI library (
develop.dvi) - PARI/GP, a tutorial (
tutorial.dvi) - PARI/GP reference cards (
refcard*.dvi)
β¨ FILES β¨
gpβ main executable.$HOME/.gprcβ (or$GPRCif set) user preference file, read at beginning of execution by eachgpshell. A defaultgprcgprc.dftis provided with the distribution. If this file cannot be found,/etc/gprcis checked instead.<logfile>β a file used to log in all commands and results; default:pari.log(you need to set thelogdefault in yourgprcor interactively).<psfile>β a file used to dump PostScript drawings; default:pari.ps.<histfile>β a file wheregpwill keep a history of all input commands (you need to set thehistfiledefault in thegprcfile).gphelpβ default external help program (as above).*.gpβ GP programs.
β¨ ENVIRONMENT β¨
$GPRCβ place to look for the user's preference file (gprc); if the file does not exist, we then check in$HOME/.gprc,/etc/gprc, and finally for a file namedgprcin PARI'sdatadir.$GP_DATA_DIRβ directory containing data installed by optional PARI packages. For example, the Galois resolvents files in directorygaldata/needed by thepolgaloisfunction, in degrees 8 to 11; or the modular polynomials inseadata/used by theellapfunction for large base fields. This environment variable overrides PARI'sdatadir, defined at Configure time.$GP_POSTSCRIPT_VIEWERβ an application able to display PostScript files, used by theplotpsgraphic engine. This engine is a fallback used to output hi-res plots even when no compatible graphical library was available on your platform at Configure time. (Dumps the graph to a temporary file, then open the file.)$GP_SVG_VIEWERβ an application able to display SVG images files, used by theplotsvggraphic engine. This engine is a fallback used to output hi-res plots even when no compatible graphical library was available on your platform at Configure time. (Dumps the graph to a temporary file, then open the file.)$GPHELPβ name of the external help program invoked by??and???shortcuts.$GPTMPDIRβ name of the directory where temporary files will be generated.
β¨ HOME PAGE β¨
PARI's home page resides at
http://pari.math.u-bordeaux.fr/
β¨ MAILING LISTS β¨
there are a number of mailing lists devoted to the PARI/GP package, and most feedback should be directed to those. See
http://pari.math.u-bordeaux.fr/lists.html
for details. the most important ones are:
- pari-announce (moderated): for us to announce major version changes.
- pari-dev: for everything related to the development of PARI, including suggestions, technical questions, bug reports or patch submissions.
- pari-users: for discuss about everything else, in particular ask for help.
to subscribe, send empty messages with a Subject: containing the word "subscribe" respectively to
pari-announce-request@pari.math.u-bordeaux.fr
pari-users-request@pari.math.u-bordeaux.fr
pari-dev-request@pari.math.u-bordeaux.fr
β¨ BUG REPORTS β¨
bugs should be submitted online to our Bug Tracking System, available from PARI's home page, or directly from the URL
http://pari.math.u-bordeaux.fr/Bugs/
further instructions can be found on that page.
β¨ TRIVIA β¨
okay this section is my favorite, get comfy. π
despite the leading G, GP has nothing to do with GNU. the first version was originally called GPC, for Great Programmable Calculator. when people started calling it "the GPC Calculator", the trailing C was dropped. the way that history just happened to them. π
PARI has nothing to do with the French capital. the name is a pun about the project's early stages when the authors started to implement a library for "Pascal ARIthmetic" in the PASCAL programming language. they quickly switched to C. glow-up. β¨
for the benefit of non-native French speakers, here's a slightly expanded explanation: Blaise Pascal (1623-1662) was a famous French mathematician and philosopher who was one of the founders of probability and devised one of the first "arithmetic machines". he once proposed the following "proof" of the existence of God for the unbelievers: whether He exists or not I lose nothing by believing in Him, whereas if He does and I misbehave... this is the so-called "pari de Pascal" (Pascal's Wager).
note that PARI also means "fairy" in Persian. π§β¨ obsessed.
β¨ AUTHORS β¨
PARI was originally written by Christian Batut, Dominique Bernardi, Henri Cohen, and Michel Olivier in Laboratoire A2X (Universite Bordeaux I, France), and was maintained by Henri Cohen up to version 1.39.15 (1995), and by Karim Belabas since then.
a great number of people have contributed to the successive improvements which eventually resulted in the present version. See the AUTHORS file in the distribution. π
β¨ SEE ALSO β¨
gap(1), gphelp(1), perl(1), readline(3), sage(1), tex(1), texmacs(1),
β¨ COPYING β¨
this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
you should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
okay that's the whole thing, bestie, every last crumb. π«Ά this page is dated 11 September 2017, and it's the General Commands Manual entry for GP(1) β so go forth, load your .gprc, set your parisizemax, and compute some number theory. you got this. π
πβ¨
π¦ where this page comes from
- ubuntu jammy: pari-gp 2.13.3-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms