Sympy

8 flashcards · Mathematics · by lakesare

  1. What's the determinant of the 0x0 matrix and 1x1 matrix?

    det([]) = 1 det([[x]]) = x

  2. Unlike many symbolic manipulation systems, variables in SymPy must be defined before they are used (the reason for this will be discussed in the next section).

  3. Sympy VS sage?

    Sage is huge, and even uses sympy (among other libraries!) under the hood. Another computer algebra system, Sage also uses Python as its language. But Sage is large, with a download of over a gigabyte. An advantage of SymPy is that it is lightweight. In addition to being relatively small, it has no dependencies other than Python, so it can be used almost anywhere easily. Furthermore, the goals of Sage and the goals of SymPy are different. Sage aims to be a full featured system for mathematics,…

  4. Unlike in Maxima, in Sympy symbols are not defined automatically. How to define symbols in Sympy?

    Interestingly, symbols can have names different from the variable. Usually, the best practice is to assign Symbols to Python variables of the same name, although there are exceptions: Symbol names can contain characters that are not allowed in Python variable names, or may just want to avoid typing long names by assigning Symbols with long names to single letter Python variables.

  5. How to write a mathematical expression x + 1 = 4 in Maxima?

  6. How can we determine whether (x + 1)2 = x2 + 2x + 1?

    To test if two things are equal, it is best to recall the basic fact that if a=b, then a−b=0. Thus, the best way to check if a=b is to take a−b and simplify it, and see if it goes to 0. We will learn later that the function to do this is called simplify. This method is not infallible—in fact, it can be theoretically proven that it is impossible to determine if two symbolic expressions are identically equal in general—but for most common expressions, it works quite well.

  7. Name 2 ways to divide two integers (to get a rational!).

  8. What's a ragged array? Also known as a jagged array.

    An array of arrays of which the member arrays can be of different lengths, producing rows of jagged edges when visualized as output.