PARI-GP Reference Card PARI Types & Input Formats Lists, Sets & Sorting (PARI-GP Version 2.2.5) T INT

Total Page:16

File Type:pdf, Size:1020Kb

PARI-GP Reference Card PARI Types & Input Formats Lists, Sets & Sorting (PARI-GP Version 2.2.5) T INT PARI-GP Reference Card PARI Types & Input Formats Lists, Sets & Sorting (PARI-GP version 2.2.5) t INT. Integers ±n sort x by kth component vecsort(x, {k}, {fl = 0}) Note: optional arguments are surrounded by braces {}. t REAL. Real Numbers ±n.ddd Sets (= row vector of strings with strictly increasing entries) Starting & Stopping GP t INTMOD. Integers modulo m Mod(n, m) intersection of sets x and y setintersect(x, y) t FRAC. Rational Numbers n/m set of elements in x not belonging to y setminus(x, y) to enter GP, just type its name: gp t COMPLEX. Complex Numbers x + y ∗ I union of sets x and y setunion(x, y) to exit GP, type \q or quit t PADIC. p-adic Numbers x + O(p^k) look if y belongs to the set x setsearch(x, y, {fl}) Help t QUAD. Quadratic Numbers x + y ∗ quadgen(D) Lists t POLMOD. Polynomials modulo g Mod(f, g) create empty list of maximal length n listcreate(n) describe function ?function t POL. Polynomials a ∗ x^n + ··· + b delete all components of list l listkill(l) extended description ??keyword t SER. Power Series f + O(x^k) append x to list l listput(l, x, {i}) list of relevant help topics ???pattern t QFI/t QFR. Imag/Real bin. quad. forms Qfb(a, b, c, {d}) insert x in list l at position i listinsert(l, x, i) Input/Output & Defaults t RFRAC. Rational Functions f/g sort the list l listsort(l, {fl}) t VEC/t COL. Row/Column Vectors [x, y, z], [x, y, z] output previous line, the lines before %, %‘, %‘‘, etc. ~ t MAT. Matrices [x, y;z, t;u, v] Programming & User Functions output from line n %n t LIST. Lists List([x, y, z]) Control Statements (X: formal parameter in expression seq) separate multiple statements on line ; t STR. Strings "aaa" eval. seq for a ≤ X ≤ b for(X = a, b, seq) extend statement on additional lines \ eval. seq for X dividing n fordiv(n, X, seq) extend statements on several lines {seq ; seq ;} 1 2 Standard Operators eval. seq for primes a ≤ X ≤ b forprime(X = a, b, seq) comment /* ... */ basic operations +, - , *, /, ^ eval. seq for a ≤ X ≤ b stepping s forstep(X = a, b, s, seq) one-line comment, rest of line ignored \\ ... i=i+1, i=i-1, i=i*j, ... i++, i--, i*=j,... multivariable for forvec(X = v, seq) set default d to val default({d}, {val}, {fl}) euclidean quotient, remainder x\/y, x\y, x%y, divrem(x, y) if a 6= 0, evaluate seq , else seq if(a, {seq }, {seq }) mimic behaviour of GP 1.39 default(compatible,3) 1 2 1 2 shift x left or right n bits x<<n, x>>n or shift(x, n) evaluate seq until a 6= 0 until(a, seq) Metacommands comparison operators <=, <, >=, >, ==, != while a 6= 0, evaluate seq while(a, seq) boolean operators (or, and, not) ||, &&, ! exit n innermost enclosing loops ({n}) toggle timer on/off # break sign of x = −1, 0, 1 sign(x) start new iteration of nth enclosing loop ({n}) print time for last result ## next maximum/minimum of x and y max, min(x, y) return x from current subroutine (x) print %n in raw format \a n return integer or real factorial of x x! or fact(x) error recovery (try seq ) ({err}, {seq }, {seq }) print %n in pretty format \b n 1 trap 2 1 derivative of f w.r.t. x f’ Input/Output print defaults \d set debug level to n \g n Conversions prettyprint args with/without newline printp(), printp1() print args with/without newline print(), print1() set memory debug level to n \gm n Change Objects enable/disable logfile {filename} read a string from keyboard input() \l make x a vector, matrix, set, list, string Vec,Mat,Set,List,Str print %n in pretty matrix format reorder priority of variables x, y, z reorder({[x, y, z]}) \m create PARI object (x mod y) Mod(x, y) set output mode (raw, default, prettyprint) n output args in TEX format printtex(args) \o make x a polynomial of v Pol(x, {v}) set n significant digits n write args to file write, write1, writetex(file, args) \p as above, starting with constant term Polrev(x, {v}) set n terms in series n read file into GP read({file}) \ps make x a power series of v Ser(x, {v}) quit GP Interface with User and System \q PARI type of object x type(x, {t}) print the list of PARI types allocates a new stack of s bytes allocatemem({s}) \t object x with precision n prec(x, {n}) print the list of user-defined functions execute system command a system(a) \u evaluate f replacing vars by their value eval(f) read file into GP \r filename as above, feed result to GP extern(a) Select Pieces of an Object write %n to file \w n filename install function from library install(f, code, {gpf }, {lib}) length of x #x or length(x) alias old to new alias(new, old) GP Within Emacs n-th component of x component(x, n) new name of function f in GP 2.0 whatnow(f) n-th component of vector/list x x n to enter GP from within Emacs: M-x gp, C-u M-x gp [ ] User Defined Functions word completion hTABi (m, n)-th component of matrix x x[m, n] name(formal vars) = local(local vars); seq row m or column n of matrix x x m, , x , n help menu window M-\c [ ] [ ] struct.member = seq numerator of x (x) describe function M-? numerator kill value of variable or function x kill(x) lowest denominator of x denominator(x) display TEX’d PARI manual M-x gpman declare global variables global(x, ...) Conjugates and Lifts set prompt string M-\p Iterations, Sums & Products break line at column 100, insert \ M-\\ conjugate of a number x conj(x) PARI metacommand \letter M-\letter conjugate vector of algebraic number x conjvec(x) numerical integration intnum(X = a, b, expr, {fl}) norm of x, product with conjugate norm(x) sum expr over divisors of n sumdiv(n, X, expr) Reserved Variable Names square of L2 norm of vector x norml2(x) sum X = a to X = b, initialized at x sum(X = a, b, expr, {x}) π = 3.14159 ··· Pi lift of x from Mods lift, centerlift(x) sum of series expr suminf(X = a, expr) Euler’s constant = .57721 ··· Euler sum of alternating/positive series sumalt, sumpos square root of −1 I Random Numbers product a ≤ X ≤ b, initialized at x prod(X = a, b, expr, {x}) big-oh notation O random integer between 0 and N − 1 random({N}) product over primes a ≤ X ≤ b prodeuler(X = a, b, expr) get random seed getrand() infinite product a ≤ X ≤ ∞ prodinf(X = a, expr) c 2003 Karim Belabas. Permissions on back. v2.16 set random seed to s setrand(s) real root of expr between a and b solve(X = a, b, expr) Vectors & Matrices PARI-GP Reference Card Elementary Arithmetic Functions dimensions of matrix x matsize(x) (PARI-GP version 2.2.5) vector of binary digits of |x| binary(x) concatenation of x and y concat(x, {y}) Polynomials & Rational Functions give bit number n of integer x bittest(x, n) extract components of x vecextract(x, y, {z}) ceiling of x ceil(x) degree of f poldegree(f) transpose of vector or matrix x mattranspose(x) or x~ floor of x floor(x) adjoint of the matrix x matadjoint(x) coefficient of degree n of f polcoeff(f, n) fractional part of x frac(x) eigenvectors of matrix x mateigen(x) round coeffs of f to nearest integer round(f, {&e}) round x to nearest integer round(x, {&e}) characteristic polynomial of x charpoly(x, {v}, {fl}) gcd of coefficients of f content(f) truncate x truncate(x, {&e}) trace of matrix x trace(x) replace x by y in f subst(f, x, y) gcd/LCM of x and y gcd(x, y), lcm(x, y) Constructors & Special Matrices discriminant of polynomial f poldisc(f) gcd of entries of a vector/matrix content(x) row vec. of expr eval’ed at 1 ≤ X ≤ n vector(n, {X}, {expr}) resultant of f and g polresultant(f, g, {fl}) Primes and Factorization col. vec. of expr eval’ed at 1 ≤ X ≤ n vectorv(n, {X}, {expr}) as above, give [u, v, d], xu + yv = d bezoutres(x, y) add primes in v to the prime table addprimes(v) matrix 1 ≤ X ≤ m, 1 ≤ Y ≤ n matrix(m, n, {X}, {Y }, {expr}) derivative of f w.r.t. x deriv(f, x) the nth prime prime(n) diagonal matrix whose diag. is x matdiagonal(x) formal integral of f w.r.t. x intformal(f, x) vector of first n primes primes(n) deg f n × n identity matrix matid(n) reciprocal poly x f(1/x) polrecip(f) smallest prime ≥ x nextprime(x) Hessenberg form of square matrix x mathess(x) interpolating poly at a polinterpolate(X, {Y }, {a}, {&e}) largest prime ≤ x precprime(x) −1 n × n Hilbert matrix Hij = (i + j − 1) mathilbert(n) initialize t for Thue equation solver thueinit(f) factorization of x factor(x, {lim}) solve Thue equation f(x, y) = a thue(t, a, {sol}) n × n Pascal triangle P = i matpascal(n − 1) reconstruct x from its factorization factorback(fa, {nf}) ij j Roots and Factorization companion matrix to polynomial x matcompanion(x) Divisors number of real roots of f, a < x ≤ b polsturm(f, {a}, {b}) Gaussian elimination number of distinct prime divisors omega(x) complex roots of f polroots(f) determinant of matrix x matdet(x, {fl}) number of prime divisors with mult bigomega(x) symmetric powers of roots of f up to n polsym(f, n) number of divisors of x numdiv(x) kernel of matrix x matker(x, {fl}) roots of f mod p polrootsmod(f, p, {fl}) intersection of column spaces of x and y matintersect(x, y) row vector of divisors of x divisors(x) factor f factor(f, {lim}) sum of (k-th powers of) divisors of x sigma(x, {k}) solve M ∗ X = B (M invertible) matsolve(M, B) factorization of f mod p factormod(f, p, {fl}) as solve, modulo D (col.
Recommended publications
  • User's Guide to Pari-GP
    User's Guide to PARI / GP C. Batut, K. Belabas, D. Bernardi, H. Cohen, M. Olivier Laboratoire A2X, U.M.R. 9936 du C.N.R.S. Universit´eBordeaux I, 351 Cours de la Lib´eration 33405 TALENCE Cedex, FRANCE e-mail: [email protected] Home Page: http://www.parigp-home.de/ Primary ftp site: ftp://megrez.math.u-bordeaux.fr/pub/pari/ last updated 5 November 2000 for version 2.1.0 Copyright c 2000 The PARI Group Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions, or translations, of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. PARI/GP is Copyright c 2000 The PARI Group PARI/GP 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. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Table of Contents Chapter 1: Overview of the PARI system . 5 1.1 Introduction . 5 1.2 The PARI types . 6 1.3 Operations and functions . 9 Chapter 2: Specific Use of the GP Calculator . 13 2.1 Defaults and output formats . 14 2.2 Simple metacommands . 20 2.3 Input formats for the PARI types . 23 2.4 GP operators .
    [Show full text]
  • On the Computation of the HNF of a Module Over the Ring of Integers of A
    On the computation of the HNF of a module over the ring of integers of a number field Jean-Fran¸cois Biasse Department of Mathematics and Statistics University of South Florida Claus Fieker Fachbereich Mathematik Universit¨at Kaiserslautern Postfach 3049 67653 Kaiserslautern - Germany Tommy Hofmann Fachbereich Mathematik Universit¨at Kaiserslautern Postfach 3049 67653 Kaiserslautern - Germany Abstract We present a variation of the modular algorithm for computing the Hermite normal form of an K -module presented by Cohen [7], where K is the ring of integers of a numberO field K. An approach presented in [7] basedO on reductions modulo ideals was conjectured to run in polynomial time by Cohen, but so far, no such proof was available in the literature. In this paper, we present a modification of the approach of [7] to prevent the coefficient swell and we rigorously assess its complexity with respect to the size of the input and the invariants of the field K. Keywords: Number field, Dedekind domain, Hermite normal form, relative extension of number fields arXiv:1612.09428v1 [math.NT] 30 Dec 2016 2000 MSC: 11Y40 1. Introduction Algorithms for modules over the rational integers such as the Hermite nor- mal form algorithm are at the core of all methods for computations with rings Email addresses: [email protected] (Jean-Fran¸cois Biasse), [email protected] (Claus Fieker), [email protected] (Tommy Hofmann) Preprint submitted to Elsevier April 22, 2018 and ideals in finite extensions of the rational numbers. Following the growing interest in relative extensions, that is, finite extensions of number fields, the structure of modules over Dedekind domains became important.
    [Show full text]
  • An Application of the Hermite Normal Form in Integer Programming
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector An Application of the Hermite Normal Form in Integer Programming Ming S. Hung Graduate School of Management Kent State University Kent, Ohio 44242 and Walter 0. Rom School of Business Administration Cleveland State University Cleveland, Ohio 44115 Submitted by Richard A. Brualdi ABSTRACT A new algorithm for solving integer programming problems is developed. It is based on cuts which are generated from the Hermite normal form of the basis matrix at a continuous extreme point. INTRODUCTION We present a new cutting plane algorithm for solving an integer program. The cuts are derived from a modified version of the usual column tableau used in integer programming: Rather than doing a complete elimination on the rows corresponding to the nonbasic variables, these rows are transformed into the Her-mite normal form. There are two major advantages with our cutting plane algorithm: First, it uses all integer operations in the computa- tions. Second, the cuts are deep, since they expose vertices of the integer hull. The Her-mite normal form (HNF), along with the basic properties of the cuts, is developed in Section I. Sections II and III apply the HNF to systems of equations and integer programs. A proof of convergence for the algorithm is presented in Section IV. Section V discusses some preliminary computa- tional experience. LINEAR ALGEBRA AND ITS APPLlCATlONS 140:163-179 (1990) 163 0 Else&r Science Publishing Co., Inc., 1990 655 Avenue of the Americas, New York, NY 10010 0024-3795/90/$3.50 164 MING S.
    [Show full text]
  • Fast, Deterministic Computation of the Hermite Normal Form and Determinant of a Polynomial Matrix✩
    Journal of Complexity 42 (2017) 44–71 Contents lists available at ScienceDirect Journal of Complexity journal homepage: www.elsevier.com/locate/jco Fast, deterministic computation of the Hermite normal form and determinant of a polynomial matrixI George Labahn a,∗, Vincent Neiger b, Wei Zhou a a David R. Cheriton School of Computer Science, University of Waterloo, Waterloo ON, Canada N2L 3G1 b ENS de Lyon (Laboratoire LIP, CNRS, Inria, UCBL, Université de Lyon), Lyon, France article info a b s t r a c t Article history: Given a nonsingular n × n matrix of univariate polynomials over Received 19 July 2016 a field K, we give fast and deterministic algorithms to compute Accepted 18 March 2017 its determinant and its Hermite normal form. Our algorithms use Available online 12 April 2017 ! Oe.n dse/ operations in K, where s is bounded from above by both the average of the degrees of the rows and that of the columns Keywords: of the matrix and ! is the exponent of matrix multiplication. The Hermite normal form soft- notation indicates that logarithmic factors in the big- Determinant O O Polynomial matrix are omitted while the ceiling function indicates that the cost is Oe.n!/ when s D o.1/. Our algorithms are based on a fast and deterministic triangularization method for computing the diagonal entries of the Hermite form of a nonsingular matrix. ' 2017 Elsevier Inc. All rights reserved. 1. Introduction n×n For a given nonsingular polynomial matrix A in KTxU , one can find a unimodular matrix U 2 n×n KTxU such that AU D H is triangular.
    [Show full text]
  • A Formal Proof of the Computation of Hermite Normal Form in a General Setting?
    REGULAR-MT: A Formal Proof of the Computation of Hermite Normal Form In a General Setting? Jose Divason´ and Jesus´ Aransay Universidad de La Rioja, Logrono,˜ La Rioja, Spain fjose.divason,[email protected] Abstract. In this work, we present a formal proof of an algorithm to compute the Hermite normal form of a matrix based on our existing framework for the formal- isation, execution, and refinement of linear algebra algorithms in Isabelle/HOL. The Hermite normal form is a well-known canonical matrix analogue of reduced echelon form of matrices over fields, but involving matrices over more general rings, such as Bezout´ domains. We prove the correctness of this algorithm and formalise the uniqueness of the Hermite normal form of a matrix. The succinct- ness and clarity of the formalisation validate the usability of the framework. Keywords: Hermite normal form, Bezout´ domains, parametrised algorithms, Linear Algebra, HOL 1 Introduction Computer algebra systems are neither perfect nor error-free, and sometimes they return erroneous calculations [18]. Proof assistants, such as Isabelle [36] and Coq [15] allow users to formalise mathematical results, that is, to give a formal proof which is me- chanically checked by a computer. Two examples of the success of proof assistants are the formalisation of the four colour theorem by Gonthier [20] and the formal proof of Godel’s¨ incompleteness theorems by Paulson [39]. They are also used in software [33] and hardware verification [28]. Normally, there exists a gap between the performance of a verified program obtained from a proof assistant and a non-verified one.
    [Show full text]
  • 3. Gaussian Elimination
    3. Gaussian Elimination The standard Gaussian elimination algorithm takes an m × n matrix M over a field F and applies successive elementary row operations (i) multiply a row by a field element (the in- verse of the left-most non-zero) (ii) subtract a multiple of one from another (to create a new left-most zero) (iii) exchange two rows (to bring a new non- zero pivot to the top) to produce M ′ in reduced row echelon form: • any all-zero rows at bottom • one at left-most position in non-zero row • number of leading zeroes strictly increas- ing. 76 Comments − Complexity O(n3) field operations if m<n. − With little more bookkeeping we can ob- tain LUP decomposition: write M = LUP with L lower triangular, U upper triangular, P a permutation matrix. − Standard applications: • solving system M·x = b of m linear equa- tions in n − 1 unknowns xi, by applying Gaussian elimination to the augmented matrix M|b; • finding the inverse M −1 of a square in- vertible n × n matrix M, by applying Gaussian elimination to the matrix M|In; • finding the determinant det M of a square matrix, for example by using det M = det L det U det P . • find bases for row space, column space (image), null space, find rank or dimen- sion, dependencies between vectors: min- imal polynomials. 77 Fraction-free Gaussian elimination When computing over a domain (rather than a field) one encounters problems entirely analo- gous to that for the Euclidean algorithm: avoid- ing fractions (and passing to the quotient field) leads to intermediate expression swell.
    [Show full text]
  • Computational Group Theory With
    computational group theory with GAP 1 GAP in SageMath the GAP system combinatorics and list manipulations integer matrices and normal forms 2 Computing with Groups permutation groups group libraries algebraic extensions 3 Rubik Magic’s Cube building a GUI six rotations as group actions analyzing Rubik’s magic cube with GAP MCS 507 Lecture 36 Mathematical, Statistical and Scientific Software Jan Verschelde, 18 November 2019 Scientific Software (MCS 507) computational group theory with GAP L-36 18November2019 1/45 computational group theory with GAP 1 GAP in SageMath the GAP system combinatorics and list manipulations integer matrices and normal forms 2 Computing with Groups permutation groups group libraries algebraic extensions 3 Rubik Magic’s Cube building a GUI six rotations as group actions analyzing Rubik’s magic cube with GAP Scientific Software (MCS 507) computational group theory with GAP L-36 18November2019 2/45 the GAP system GAP stands for Groups, Algorithms and Programming. GAP is free software, under the GNU Public License. Development began at RWTH Aachen (Joachim Neubüser), version 2.4 was released in 1988, 3.1 in 1992. Coordination was transferred to St. Andrews (Steve Linton) in 1997, version 4.1 was released in 1999. Release 4.4 was coordinated in Fort Collins (Alexander Hulpke). We run GAP explicitly in SageMath via 1 the class Gap, do help(gap); or 2 opening a Terminal Session with GAP, type gap_console(); in a SageMath terminal. Scientific Software (MCS 507) computational group theory with GAP L-36 18November2019 3/45 using
    [Show full text]
  • A Pari/GP Tutorial by Robert B
    1 A Pari/GP Tutorial by Robert B. Ash, Jan. 2007 The Pari/GP home page is located at http://pari.math.u-bordeaux.fr/ 1. Pari Types There are 15 types of elements (numbers, polynomials, matrices etc.) recognized by Pari/GP (henceforth abbreviated GP). They are listed below, along with instructions on how to create an element of the given type. After typing an instruction, hit return to execute. A semicolon at the end of an instruction suppresses the output. To activate the program, type gp, and to quit, type quit or q \ 1. Integers Type the relevant integer, with a plus or minus sign if desired. 2. Rational Numbers Type a rational number as a fraction a/b, with a and b integers. 3. Real Numbers Type the number with a decimal point to make sure that it is a real number rather than an integer or a rational number. Alternatively, use scientific notation, for example, 8.46E17 The default precision is 28 significant digits. To change the precision, for example to 32 digits, type p 32. \ 4. Complex Numbers Type a complex number as a + b I or a + I b, where a and b are real numbers, rational numbers or integers. ∗ ∗ 5. Integers Modulo n To enter n mod m, type Mod(n, m). 6. Polynomials Type a polynomial in the usual way, but don’t forget that must be used for multiplica- tion. For example, type xˆ3 + 3*xˆ2 -1/7*x +8. ∗ 7. Rational Functions Type a ratio P/Q of polynomials P and Q.
    [Show full text]
  • Equivalences for Linearizations of Matrix Polynomials
    Equivalences for Linearizations of Matrix Polynomials Robert M. Corless∗1, Leili Rafiee Sevyeri†1, and B. David Saunders‡2 1David R. Cheriton School of Computer Science, University of Waterloo ,Canada 2Department of Computer and Information Sciences University of Delaware Abstract One useful standard method to compute eigenvalues of matrix poly- nomials P (z) ∈ Cn×n[z] of degree at most ℓ in z (denoted of grade ℓ, for short) is to first transform P (z) to an equivalent linear matrix poly- nomial L(z) = zB − A, called a companion pencil, where A and B are usually of larger dimension than P (z) but L(z) is now only of grade 1 in z. The eigenvalues and eigenvectors of L(z) can be computed numerically by, for instance, the QZ algorithm. The eigenvectors of P (z), including those for infinite eigenvalues, can also be recovered from eigenvectors of L(z) if L(z) is what is called a “strong linearization” of P (z). In this paper we show how to use algorithms for computing the Hermite Normal Form of a companion matrix for a scalar polynomial to direct the dis- covery of unimodular matrix polynomial cofactors E(z) and F (z) which, via the equation E(z)L(z)F (z) = diag(P (z), In,..., In), explicitly show the equivalence of P (z) and L(z). By this method we give new explicit constructions for several linearizations using different polynomial bases. We contrast these new unimodular pairs with those constructed by strict arXiv:2102.09726v1 [math.NA] 19 Feb 2021 equivalence, some of which are also new to this paper.
    [Show full text]
  • A Tutorial for PARI / GP
    A Tutorial for PARI / GP C. Batut, K. Belabas, D. Bernardi, H. Cohen, M. Olivier Laboratoire A2X, U.M.R. 9936 du C.N.R.S. Universit´eBordeaux I, 351 Cours de la Lib´eration 33405 TALENCE Cedex, FRANCE e-mail: [email protected] Home Page: http://pari.math.u-bordeaux.fr/ Primary ftp site: ftp://pari.math.u-bordeaux.fr/pub/pari/ last updated September 17, 2002 (this document distributed with version 2.2.7) Copyright c 2000–2003 The PARI Group ° Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions, or translations, of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. PARI/GP is Copyright c 2000–2003 The PARI Group ° PARI/GP 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. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. This booklet is intended to be a guided tour and a tutorial to the GP calculator. Many examples will be given, but each time a new function is used, the reader should look at the appropriate section in the User’s Manual for detailed explanations. Hence although this chapter can be read independently (for example to get rapidly acquainted with the possibilities of GP without having to read the whole manual), the reader will profit most from it by reading it in conjunction with the reference manual.
    [Show full text]
  • A Fast Las Vegas Algorithm for Computing the Smith Normal Form of a Polynomial Matrix
    A Fast Las Vegas Algorithm for Computing the Smith Normal Form of a Polynomial Matrix Arne Storjohann and George Labahn Department of Computer Science University of Waterloo Waterloo, Ontario, Canada N2L 3G1 Submitted by Richard A. Brualdi ABSTRACT A Las Vegas probabilistic algorithm is presented that ¯nds the Smith normal form S 2 Q[x]n£n of a nonsingular input matrix A 2 Z [x]n£n. The algorithm requires an expected number of O~(n3d(d + n2 log jjAjj)) bit operations (where jjAjj bounds the magnitude of all integer coe±cients appearing in A and d bounds the degrees of entries of A). In practice, the main cost of the computation is obtaining a non-unimodular triangularization of a polynomial matrix of same dimension and with similar size entries as the input matrix. We show how to accomplish this in O~(n5d(d + log jjAjj) log jjAjj) bit operations using standard integer, polynomial and matrix arithmetic. These complexity results improve signi¯cantly on previous algorithms in both a theoretical and practical sense. 1. INTRODUCTION The Smith normal form is a diagonalization of a matrix over a principal ideal domain. The concept originated with the work of Smith [17] in 1861 for the special case of integer matrices. Applications of the Smith normal form include, for example, solving systems of Diophantine equations over the domain of entries [4], integer programming [9], determining the canon- ical decomposition of ¯nitely generated abelian groups [8], determining the LINEAR ALGEBRA AND ITS APPLICATIONS xxx:1{xxx (1993) 1 °c Elsevier Science Publishing Co., Inc., 1993 655 Avenue of the Americas, New York, NY 10010 0024- 3795/93/$6.00 2 similarity of two matrices and computing additional normal forms such as Frobenius and Jordan normal forms [5, 12].
    [Show full text]
  • A Tutorial for Pari/GP
    A Tutorial for PARI / GP (version 2.7.0) The PARI Group Institut de Math´ematiquesde Bordeaux, UMR 5251 du CNRS. Universit´eBordeaux 1, 351 Cours de la Lib´eration F-33405 TALENCE Cedex, FRANCE e-mail: [email protected] Home Page: http://pari.math.u-bordeaux.fr/ Copyright c 2000{2014 The PARI Group Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions, or translations, of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. PARI/GP is Copyright c 2000{2014 The PARI Group PARI/GP 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. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Table of Contents 1. Greetings! . 4 2. Warming up . 7 3. The Remaining PARI Types . 9 4. Elementary Arithmetic Functions . 14 5. Performing Linear Algebra . 15 6. Using Transcendental Functions . 17 7. Using Numerical Tools . 20 8. Polynomials . 22 9. Power series . 25 10. Working with Elliptic Curves . 25 11. Working in Quadratic Number Fields . 30 12. Working in General Number Fields . 35 12.1. Elements . 35 12.2. Ideals . 39 12.3. Class groups and units, bnf ..................................41 12.4. Class field theory, bnr .....................................43 12.5.
    [Show full text]