Open Source Computer Algebra Systems

Total Page:16

File Type:pdf, Size:1020Kb

Open Source Computer Algebra Systems Open source computer algebra systems Riccardo Guida and Sylvain Ribault IPhT Saclay Tuesday 7 May 2019 Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 1 / 9 Summary the trouble with Mathematica; a quick overview of the best Open Source Computer Algebra Systems (OSCAS) available today; a demonstration of SymPy. Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 2 / 9 The trouble with Mathematica Mathematica is the most widespread computer algebra system in our field. However, it is expensive for non-academic researchers; it is not accessible by anyone anywhere (collaborators, readers of your articles, yourself after moving to another institute or ending your grant); availability of old versions is not guaranteed, and is subject to Wolfram's commercial policy. IPhT-specific problems: We currently pay 25ke/year for only 10 system-wide licenses. We used to pay the same price for 200 licenses. Then a new salesperson came. We bought \perpetual" licenses for 11 users on MacOS. But these 32-bits licences will be unusable on the next version of MacOS (64-bits only). Upgrade cost: ∼ 700 e per \perpetual" license. Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 3 / 9 Open source software Open source software solves the problems of cost and license availability. Other advantages include: Verifiability of algorithms: no need to trust a black box. Influencing development of the software by reporting bugs, writing code yourself, or giving grant money for adding a feature you need. Anyone can check, reproduce, and improve your results, if you give them your code. Mathematica is generally more complete and advanced than the OS alternatives . but most people, most of the time, do not need the advanced features. You would not lose much by switching to open source tools, unless you are captive of a large existing body of code and/or specialized packages. (And if you are captive, you can use OSCAS for double-checking.) Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 4 / 9 IPhT Survey Which computer algebra system(s) did you use in the last 3 years? Mathematica Maple Matlab SymPy/NumPy/SciPy SageMath Maxima FriCAS Cadabra Open? 7 7 7 3 3 3 3 3 # Users 35 7 3 10 2 4 1 1 Thanks to the 42 participants! Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 5 / 9 OSCAS overview 1 SymPy SageMath Maxima FriCAS Initial release 2007 2005 1998 2007 Non-OS base { { Macsyma 1982 Axiom 1977 Contributors1 59 63 11 3 User Language Python Python-ish Maxima SPAD Interpreter CPython, CPython Common Lisp Common Lisp PyPy Expected speed C=50 C=50 to C C=5 C=5 Notebooks Jupyter, Jupyter, wxMaxima, TeX- TeXmacs TeXmacs TeXmacs macs 1Number of contributors with more than 9 commits between 2018-03-15 and 2019-03-15. Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 6 / 9 OSCAS overview 2 SymPy, SageMath, Maxima, Fricas: multi-platform, generalist OSCAS that have the usual basic features: limits, derivatives, Taylor series, basic integrals, linear algebra, special functions, polynomial equations, basic ODEs, replacements, arbitrary precision numerics, . They differ in the availability and quality of more advanced features. Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 7 / 9 OSCAS overview 3 SageMath ƃ SageMath = SageMathCore ⊕ SymPy ⊕ Maxima ⊕ · · · ⊕ FriCAS Ɨ Manifolds, number theory, combinatorics ¦ Interface to other OSCAS not always transparent Maxima Easy language not so far from Mathematica ¦ Poor development of new mathematical features FriCAS Dedicated language inspired by mathematics î New advanced mathematical features at each release Ɨ Antiderivatives, noncommutative algebra, sparse polynomials ¦ Features such as plotting are postponed to better times Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 8 / 9 SymPy overview SymPy Python = very easy and widespread language; Google/StackOverflow answer all questions ƃ SymPy is a Python module, can be combined with other modules such as NumPy, SciPy, etc î Proactive developer community (including Google-funded interns) Ɨ Generalized hypergeometrics, automatic generation and execution of code, rule-based integration tools (RUBI) Riccardo Guida and Sylvain Ribault (IPhT) OSCAS Tuesday 7 May 2019 9 / 9.
Recommended publications
  • Plotting Direction Fields in Matlab and Maxima – a Short Tutorial
    Plotting direction fields in Matlab and Maxima – a short tutorial Luis Carvalho Introduction A first order differential equation can be expressed as dx x0(t) = = f(t; x) (1) dt where t is the independent variable and x is the dependent variable (on t). Note that the equation above is in normal form. The difficulty in solving equation (1) depends clearly on f(t; x). One way to gain geometric insight on how the solution might look like is to observe that any solution to (1) should be such that the slope at any point P (t0; x0) is f(t0; x0), since this is the value of the derivative at P . With this motivation in mind, if you select enough points and plot the slopes in each of these points, you will obtain a direction field for ODE (1). However, it is not easy to plot such a direction field for any function f(t; x), and so we must resort to some computational help. There are many computational packages to help us in this task. This is a short tutorial on how to plot direction fields for first order ODE’s in Matlab and Maxima. Matlab Matlab is a powerful “computing environment that combines numeric computation, advanced graphics and visualization” 1. A nice package for plotting direction field in Matlab (although resourceful, Matlab does not provide such facility natively) can be found at http://math.rice.edu/»dfield, contributed by John C. Polking from the Dept. of Mathematics at Rice University. To install this add-on, simply browse to the files for your version of Matlab and download them.
    [Show full text]
  • A Note on Integral Points on Elliptic Curves 3
    Journal de Th´eorie des Nombres de Bordeaux 00 (XXXX), 000–000 A note on integral points on elliptic curves par Mark WATKINS Abstract. We investigate a problem considered by Zagier and Elkies, of finding large integral points on elliptic curves. By writ- ing down a generic polynomial solution and equating coefficients, we are led to suspect four extremal cases that still might have non- degenerate solutions. Each of these cases gives rise to a polynomial system of equations, the first being solved by Elkies in 1988 using the resultant methods of Macsyma, with there being a unique rational nondegenerate solution. For the second case we found that resultants and/or Gr¨obner bases were not very efficacious. Instead, at the suggestion of Elkies, we used multidimensional p-adic Newton iteration, and were able to find a nondegenerate solution, albeit over a quartic number field. Due to our methodol- ogy, we do not have much hope of proving that there are no other solutions. For the third case we found a solution in a nonic number field, but we were unable to make much progress with the fourth case. We make a few concluding comments and include an ap- pendix from Elkies regarding his calculations and correspondence with Zagier. Resum´ e.´ A` la suite de Zagier et Elkies, nous recherchons de grands points entiers sur des courbes elliptiques. En ´ecrivant une solution polynomiale g´en´erique et en ´egalisant des coefficients, nous obtenons quatre cas extr´emaux susceptibles d’avoir des so- lutions non d´eg´en´er´ees. Chacun de ces cas conduit `aun syst`eme d’´equations polynomiales, le premier ´etant r´esolu par Elkies en 1988 en utilisant les r´esultants de Macsyma; il admet une unique solution rationnelle non d´eg´en´er´ee.
    [Show full text]
  • Redberry: a Computer Algebra System Designed for Tensor Manipulation
    Redberry: a computer algebra system designed for tensor manipulation Stanislav Poslavsky Institute for High Energy Physics, Protvino, Russia SRRC RF ITEP of NRC Kurchatov Institute, Moscow, Russia E-mail: [email protected] Dmitry Bolotin Institute of Bioorganic Chemistry of RAS, Moscow, Russia E-mail: [email protected] Abstract. In this paper we focus on the main aspects of computer-aided calculations with tensors and present a new computer algebra system Redberry which was specifically designed for algebraic tensor manipulation. We touch upon distinctive features of tensor software in comparison with pure scalar systems, discuss the main approaches used to handle tensorial expressions and present the comparison of Redberry performance with other relevant tools. 1. Introduction General-purpose computer algebra systems (CASs) have become an essential part of many scientific calculations. Focusing on the area of theoretical physics and particularly high energy physics, one can note that there is a wide area of problems that deal with tensors (or more generally | objects with indices). This work is devoted to the algebraic manipulations with abstract indexed expressions which forms a substantial part of computer aided calculations with tensors in this field of science. Today, there are many packages both on top of general-purpose systems (Maple Physics [1], xAct [2], Tensorial etc.) and standalone tools (Cadabra [3,4], SymPy [5], Reduce [6] etc.) that cover different topics in symbolic tensor calculus. However, it cannot be said that current demand on such a software is fully satisfied [7]. The main difference of tensorial expressions (in comparison with ordinary indexless) lies in the presence of contractions between indices.
    [Show full text]
  • Performance Analysis of Effective Symbolic Methods for Solving Band Matrix Slaes
    Performance Analysis of Effective Symbolic Methods for Solving Band Matrix SLAEs Milena Veneva ∗1 and Alexander Ayriyan y1 1Joint Institute for Nuclear Research, Laboratory of Information Technologies, Joliot-Curie 6, 141980 Dubna, Moscow region, Russia Abstract This paper presents an experimental performance study of implementations of three symbolic algorithms for solving band matrix systems of linear algebraic equations with heptadiagonal, pen- tadiagonal, and tridiagonal coefficient matrices. The only assumption on the coefficient matrix in order for the algorithms to be stable is nonsingularity. These algorithms are implemented using the GiNaC library of C++ and the SymPy library of Python, considering five different data storing classes. Performance analysis of the implementations is done using the high-performance computing (HPC) platforms “HybriLIT” and “Avitohol”. The experimental setup and the results from the conducted computations on the individual computer systems are presented and discussed. An analysis of the three algorithms is performed. 1 Introduction Systems of linear algebraic equations (SLAEs) with heptadiagonal (HD), pentadiagonal (PD) and tridiagonal (TD) coefficient matrices may arise after many different scientific and engineering prob- lems, as well as problems of the computational linear algebra where finding the solution of a SLAE is considered to be one of the most important problems. On the other hand, special matrix’s char- acteristics like diagonal dominance, positive definiteness, etc. are not always feasible. The latter two points explain why there is a need of methods for solving of SLAEs which take into account the band structure of the matrices and do not have any other special requirements to them. One possible approach to this problem is the symbolic algorithms.
    [Show full text]
  • CAS (Computer Algebra System) Mathematica
    CAS (Computer Algebra System) Mathematica- UML students can download a copy for free as part of the UML site license; see the course website for details From: Wikipedia 2/9/2014 A computer algebra system (CAS) is a software program that allows [one] to compute with mathematical expressions in a way which is similar to the traditional handwritten computations of the mathematicians and other scientists. The main ones are Axiom, Magma, Maple, Mathematica and Sage (the latter includes several computer algebras systems, such as Macsyma and SymPy). Computer algebra systems began to appear in the 1960s, and evolved out of two quite different sources—the requirements of theoretical physicists and research into artificial intelligence. A prime example for the first development was the pioneering work conducted by the later Nobel Prize laureate in physics Martin Veltman, who designed a program for symbolic mathematics, especially High Energy Physics, called Schoonschip (Dutch for "clean ship") in 1963. Using LISP as the programming basis, Carl Engelman created MATHLAB in 1964 at MITRE within an artificial intelligence research environment. Later MATHLAB was made available to users on PDP-6 and PDP-10 Systems running TOPS-10 or TENEX in universities. Today it can still be used on SIMH-Emulations of the PDP-10. MATHLAB ("mathematical laboratory") should not be confused with MATLAB ("matrix laboratory") which is a system for numerical computation built 15 years later at the University of New Mexico, accidentally named rather similarly. The first popular computer algebra systems were muMATH, Reduce, Derive (based on muMATH), and Macsyma; a popular copyleft version of Macsyma called Maxima is actively being maintained.
    [Show full text]
  • SNC: a Cloud Service Platform for Symbolic-Numeric Computation Using Just-In-Time Compilation
    This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/TCC.2017.2656088, IEEE Transactions on Cloud Computing IEEE TRANSACTIONS ON CLOUD COMPUTING 1 SNC: A Cloud Service Platform for Symbolic-Numeric Computation using Just-In-Time Compilation Peng Zhang1, Member, IEEE, Yueming Liu1, and Meikang Qiu, Senior Member, IEEE and SQL. Other types of Cloud services include: Software as a Abstract— Cloud services have been widely employed in IT Service (SaaS) in which the software is licensed and hosted in industry and scientific research. By using Cloud services users can Clouds; and Database as a Service (DBaaS) in which managed move computing tasks and data away from local computers to database services are hosted in Clouds. While enjoying these remote datacenters. By accessing Internet-based services over lightweight and mobile devices, users deploy diversified Cloud great services, we must face the challenges raised up by these applications on powerful machines. The key drivers towards this unexploited opportunities within a Cloud environment. paradigm for the scientific computing field include the substantial Complex scientific computing applications are being widely computing capacity, on-demand provisioning and cross-platform interoperability. To fully harness the Cloud services for scientific studied within the emerging Cloud-based services environment computing, however, we need to design an application-specific [4-12]. Traditionally, the focus is given to the parallel scientific platform to help the users efficiently migrate their applications. In HPC (high performance computing) applications [6, 12, 13], this, we propose a Cloud service platform for symbolic-numeric where substantial effort has been given to the integration of computation– SNC.
    [Show full text]
  • Axiom / Fricas
    Axiom / FriCAS Christoph Koutschan Research Institute for Symbolic Computation Johannes Kepler Universit¨atLinz, Austria Computer Algebra Systems 15.11.2010 Master's Thesis: The ISAC project • initiative at Graz University of Technology • Institute for Software Technology • Institute for Information Systems and Computer Media • experimental software assembling open source components with as little glue code as possible • feasibility study for a novel kind of transparent single-stepping software for applied mathematics • experimenting with concepts and technologies from • computer mathematics (theorem proving, symbolic computation, model based reasoning, etc.) • e-learning (knowledge space theory, usability engineering, computer-supported collaboration, etc.) • The development employs academic expertise from several disciplines. The challenge for research is interdisciplinary cooperation. Rewriting, a basic CAS technique This technique is used in simplification, equation solving, and many other CAS functions, and it is intuitively comprehensible. This would make rewriting useful for educational systems|if one copes with the problem, that even elementary simplifications involve hundreds of rewrites. As an example see: http://www.ist.tugraz.at/projects/isac/www/content/ publications.html#DA-M02-main \Reverse rewriting" for comprehensible justification Many CAS functions can not be done by rewriting, for instance cancelling multivariate polynomials, factoring or integration. However, respective inverse problems can be done by rewriting and produce human readable derivations. As an example see: http://www.ist.tugraz.at/projects/isac/www/content/ publications.html#GGTs-von-Polynomen Equation solving made transparent Re-engineering equation solvers in \transparent single-stepping systems" leads to types of equations, arranged in a tree. ISAC's tree of equations are to be compared with what is produced by tracing facilities of Mathematica and/or Maple.
    [Show full text]
  • Arxiv:2102.02679V1 [Cs.LO] 4 Feb 2021 HOL-ODE [10], Which Supports Reasoning for Systems of Ordinary Differential Equations (Sodes)
    Certifying Differential Equation Solutions from Computer Algebra Systems in Isabelle/HOL Thomas Hickman, Christian Pardillo Laursen, and Simon Foster University of York Abstract. The Isabelle/HOL proof assistant has a powerful library for continuous analysis, which provides the foundation for verification of hybrid systems. However, Isabelle lacks automated proof support for continuous artifacts, which means that verification is often manual. In contrast, Computer Algebra Systems (CAS), such as Mathematica and SageMath, contain a wealth of efficient algorithms for matrices, differen- tial equations, and other related artifacts. Nevertheless, these algorithms are not verified, and thus their outputs cannot, of themselves, be trusted for use in a safety critical system. In this paper we integrate two CAS systems into Isabelle, with the aim of certifying symbolic solutions to or- dinary differential equations. This supports a verification technique that is both automated and trustworthy. 1 Introduction Verification of Cyber-Physical and Autonomous Systems requires that we can verify both discrete control, and continuous evolution, as envisaged by the hy- brid systems domain [1]. Whilst powerful bespoke verification tools exist, such as the KeYmaera X [2] proof assistant, software engineering requires a gen- eral framework, which can support a variety of notations and paradigms [3]. Isabelle/HOL [4] is a such a framework. Its combination of an extensible fron- tend for syntax processing, and a plug-in oriented backend, based in ML, which supports a wealth of heterogeneous semantic models and proof tools, supports a flexible platform for software development, verification, and assurance [5,6,7]. Verification of hybrid systems in Isabelle is supported by several detailed li- braries of Analysis, including Multivariate Analysis [8], Affine Arithmetic [9], and arXiv:2102.02679v1 [cs.LO] 4 Feb 2021 HOL-ODE [10], which supports reasoning for Systems of Ordinary Differential Equations (SODEs).
    [Show full text]
  • New Directions in Symbolic Computer Algebra 3.5 Year Doctoral Research Student Position Leading to a Phd in Maths Supervisor: Dr
    Cadabra: new directions in symbolic computer algebra 3:5 year doctoral research student position leading to a PhD in Maths supervisor: Dr. Kasper Peeters, [email protected] Project description The Cadabra software is a new approach to symbolic computer algebra. Originally developed to solve problems in high-energy particle and gravitational physics, it is now attracting increas- ing attention from other disciplines which deal with aspects of tensor field theory. The system was written from the ground up with the intention of exploring new ideas in computer alge- bra, in order to help areas of applied mathematics for which suitable tools have so far been inadequate. The system is open source, built on a C++ graph-manipulating core accessible through a Python layer in a notebook interface, and in addition makes use of other open maths libraries such as SymPy, xPerm, LiE and Maxima. More information and links to papers using the software can be found at http://cadabra.science. With increasing attention and interest from disciplines such as earth sciences, machine learning and condensed matter physics, we are now looking for an enthusiastic student who is interested in working on this highly multi-disciplinary computer algebra project. The aim is to enlarge the capabilities of the system and bring it to an ever widening user base. Your task will be to do research on new algorithms and take responsibility for concrete implemen- tations, based on the user feedback which we have collected over the last few years. There are several possibilities to collaborate with people in some of the fields listed above, either in the Department of Mathematical Sciences or outside of it.
    [Show full text]
  • Sage? History Community Some Useful Features
    What is Sage? History Community Some useful features Sage : mathematics software based on Python Sébastien Labbé [email protected] Franco Saliola [email protected] Département de Mathématiques, UQÀM 29 novembre 2010 What is Sage? History Community Some useful features Outline 1 What is Sage? 2 History 3 Community 4 Some useful features What is Sage? History Community Some useful features What is Sage? What is Sage? History Community Some useful features Sage is . a distribution of software What is Sage? History Community Some useful features Sage is a distribution of software When you install Sage, you get: ATLAS Automatically Tuned Linear Algebra Software BLAS Basic Fortan 77 linear algebra routines Bzip2 High-quality data compressor Cddlib Double Description Method of Motzkin Common Lisp Multi-paradigm and general-purpose programming lang. CVXOPT Convex optimization, linear programming, least squares Cython C-Extensions for Python F2c Converts Fortran 77 to C code Flint Fast Library for Number Theory FpLLL Euclidian lattice reduction FreeType A Free, High-Quality, and Portable Font Engine What is Sage? History Community Some useful features Sage is a distribution of software When you install Sage, you get: G95 Open source Fortran 95 compiler GAP Groups, Algorithms, Programming GD Dynamic graphics generation tool Genus2reduction Curve data computation Gfan Gröbner fans and tropical varieties Givaro C++ library for arithmetic and algebra GMP GNU Multiple Precision Arithmetic Library GMP-ECM Elliptic Curve Method for Integer Factorization
    [Show full text]
  • Arxiv:Cs/0608005V2 [Cs.SC] 12 Jun 2007
    AEI-2006-037 cs.SC/0608005 A field-theory motivated approach to symbolic computer algebra Kasper Peeters Max-Planck-Institut f¨ur Gravitationsphysik, Albert-Einstein-Institut Am M¨uhlenberg 1, 14476 Golm, GERMANY Abstract Field theory is an area in physics with a deceptively compact notation. Although general pur- pose computer algebra systems, built around generic list-based data structures, can be used to represent and manipulate field-theory expressions, this often leads to cumbersome input formats, unexpected side-effects, or the need for a lot of special-purpose code. This makes a direct trans- lation of problems from paper to computer and back needlessly time-consuming and error-prone. A prototype computer algebra system is presented which features TEX-like input, graph data structures, lists with Young-tableaux symmetries and a multiple-inheritance property system. The usefulness of this approach is illustrated with a number of explicit field-theory problems. 1. Field theory versus general-purpose computer algebra For good reasons, the area of general-purpose computer algebra programs has histor- ically been dominated by what one could call “list-based” systems. These are systems which are centred on the idea that, at the lowest level, mathematical expressions are nothing else but nested lists (or equivalently: nested functions, trees, directed acyclic graphs, . ). There is no doubt that a lot of mathematics indeed maps elegantly to problems concerning the manipulation of nested lists, as the success of a large class of LISP-based computer algebra systems illustrates (either implemented in LISP itself or arXiv:cs/0608005v2 [cs.SC] 12 Jun 2007 in another language with appropriate list data structures).
    [Show full text]
  • 2.10. Sympy : Symbolic Mathematics in Python
    2.10. Sympy : Symbolic Mathematics in Python author: Fabian Pedregosa Objectives 1. Evaluate expressions with arbitrary precision. 2. Perform algebraic manipulations on symbolic expressions. 3. Perform basic calculus tasks (limits, differentiation and integration) with symbolic expressions. 4. Solve polynomial and transcendental equations. 5. Solve some differential equations. What is SymPy? SymPy is a Python library for symbolic mathematics. It aims become a full featured computer algebra system that can compete directly with commercial alternatives (Mathematica, Maple) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and does not require any external libraries. Sympy documentation and packages for installation can be found on http://sympy.org/ Chapters contents First Steps with SymPy Using SymPy as a calculator Exercises Symbols Algebraic manipulations Expand Simplify Exercises Calculus Limits Differentiation Series expansion Exercises Integration Exercises Equation solving Exercises Linear Algebra Matrices Differential Equations Exercises 2.10.1. First Steps with SymPy 2.10.1.1. Using SymPy as a calculator SymPy defines three numerical types: Real, Rational and Integer. The Rational class represents a rational number as a pair of two Integers: the numerator and the denomi‐ nator, so Rational(1,2) represents 1/2, Rational(5,2) 5/2 and so on: >>> from sympy import * >>> >>> a = Rational(1,2) >>> a 1/2 >>> a*2 1 SymPy uses mpmath in the background, which makes it possible to perform computations using arbitrary- precision arithmetic. That way, some special constants, like e, pi, oo (Infinity), are treated as symbols and can be evaluated with arbitrary precision: >>> pi**2 >>> pi**2 >>> pi.evalf() 3.14159265358979 >>> (pi+exp(1)).evalf() 5.85987448204884 as you see, evalf evaluates the expression to a floating-point number.
    [Show full text]