isympy(1)

πŸ“¦ version 1.13.3, in ubuntu questing

πŸ’– isympy(1) πŸ’–

✨ NAME ✨

isympy - interactive shell for SymPy 🧚

πŸŽ€ SYNOPSIS πŸŽ€

isympy [-c | --console] [-p ENCODING | --pretty ENCODING] [-t TYPE |
       --types TYPE] [-o ORDER | --order ORDER] [-q | --quiet] [-d |
       --doctest] [-C | --no-cache] [-a | --auto] [-D | --debug] [ -- |
       PYTHONOPTIONS]
isympy [ {-h | --help} | {-v | --version} ]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so isympy is a Python shell for SymPy πŸ’… It's literally just a normal python shell (an ipython shell if you have the ipython package installed) that runs the following commands for you, so you don't have to type them yourself 🫢

>>> from __future__ import division
>>> from sympy import *
>>> x, y, z = symbols("x,y,z")
>>> k, m, n = symbols("k,m,n", integer=True)

So starting isympy is basically the same as starting python (or ipython) and typing all of that by hand. It's made for quick and easy experimenting with SymPy ✨ For anything more complicated, bestie, write a script and import things explicitly (using the from sympy import sin, log, Symbol, ... idiom). That's the iconic move πŸ‘‘

πŸ’œ OPTIONS πŸ’œ

  • -c SHELL, --console=SHELL β€” use the shell you pick (python or ipython) as the console backend instead of the default one (ipython if it's around, python otherwise) 🌸
    • Example: isympy -c python
    • SHELL has to be either ipython or python
  • -p ENCODING, --pretty=ENCODING β€” sets up pretty printing in SymPy. By default you get the prettiest unicode printing (if your terminal can handle it) πŸ¦‹ You can switch to the less fancy ASCII printing, or turn pretty printing off completely πŸ™ˆ
    • Example: isympy -p no
    • ENCODING must be one of unicode, ascii or no
  • -t TYPE, --types=TYPE β€” sets up the ground types for the polys ✨ By default, gmpy ground types are used if gmpy2 or gmpy is installed. Otherwise it falls back to python ground types, which are a tiny bit slower 🐒 You can still manually pick python ground types even when gmpy is installed (for testing, for example) πŸ§ͺ
    • Note that sympy ground types aren't supported and should only be used for experimental purposes πŸ’€
    • Note that the gmpy1 ground type is mainly meant for testing. It's the use of gmpy even when gmpy2 is available πŸ™ƒ
    • This is the same as setting the environment variable SYMPY_GROUND_TYPES to the ground type you give (e.g., SYMPY_GROUND_TYPES='gmpy')
    • You can check the ground types interactively from the variable sympy.polys.domains.GROUND_TYPES inside the isympy shell itself πŸ‘€
    • Example: isympy -t python
    • TYPE must be one of gmpy, gmpy1 or python
  • -o ORDER, --order=ORDER β€” sets the ordering of terms for printing πŸ’… The default is lex, which orders terms lexicographically (e.g., x**2 + x + 1). You can pick other orderings, like rev-lex, which uses reverse lexicographic ordering (e.g., 1 + x + x**2) πŸ”₯
    • Note that for really huge expressions, ORDER='none' can speed up printing a lot, but the tradeoff is that the terms in the printed expression won't have any canonical order
    • Example: isympy -o rev-lax
    • ORDER must be one of lex, rev-lex, grlex, rev-grlex, grevlex, rev-grevlex, old, or none
  • -q, --quiet β€” at startup, print only the Python and SymPy versions to stdout, and nothing else 🀫
  • -d, --doctest β€” uses the format that doctests should use πŸ“ This is the same as isympy -c python -p no
  • -C, --no-cache β€” turns off the caching mechanism 🧊 Disabling the cache may slow certain operations down a lot. It's useful for testing the cache or for benchmarking, since the cache can give you deceptive benchmark timings 😭
    • This is the same as setting the environment variable SYMPY_USE_CACHE to 'no'
  • -a, --auto β€” automatically creates missing symbols πŸͺ„ Normally, typing the name of a Symbol that hasn't been instantiated first raises NameError. With this option on, any undefined name gets automatically created as a Symbol. This only works in IPython 0.11 ⚠️
    • This is only meant for interactive, calculator-style usage. In a script that uses SymPy, Symbols should be instantiated at the top, so it's clear what they are 🫢
    • It won't override any names that are already defined, which includes the single character letters represented by the mnemonic QCOSINE (see the "Gotchas and Pitfalls" document in the documentation). You can delete existing names by running del name in the shell itself. To check if a name is defined, type 'name' in globals()
    • The Symbols made this way have default assumptions. If you want assumptions on your symbols, create them with symbols() or var() instead πŸ’œ
    • Finally, this only works in the top level namespace. So if you define a function in isympy that uses an undefined Symbol, it won't work πŸ’€
  • -D, --debug β€” turns on debugging output πŸ› This is the same as setting the environment variable SYMPY_DEBUG to 'True'. The debug status gets set in the variable SYMPY_DEBUG within isympy
  • -- PYTHONOPTIONS β€” these options get passed on to the ipython (1) shell 🌈 Only supported when ipython is being used (the standard python shell doesn't support them)
    • You need two dashes (--) to separate PYTHONOPTIONS from the other isympy options, so don't skip them
    • For example, to run iSymPy without the startup banner and without colors:
isympy -q -c ipython -- --colors=NoColor
  • -h, --help β€” prints the help output and exits πŸ™‹β€β™€οΈ
  • -v, --version β€” prints the isympy version info and exits 🏷️

🧚 FILES 🧚

  • ${HOME}/.sympy-history β€” saves your command history when you use the python shell as the backend πŸ“œ

πŸ› BUGS πŸ›

The upstream BTS lives at https://github.com/sympy/sympy/issues. Please report every bug you find there, because it really helps make SymPy better for everyone 🫢

🌈 SEE ALSO 🌈

ipython (1), python (1)


ily, and that's the whole isympy(1) page (version date 2007-10-8) πŸ“πŸ’– Stay curious, stay sparkly βœ¨πŸ’…

πŸ“¦ where this page comes from