A computer algebra system written in pure Python http://sympy.org/ . To get started to with contributing https://github.com/sympy/sympy/wiki/Introduction-to-contributing
>>> import sympy
>>> n = sympy.symbols("n")
>>> x = sympy.Subs(1.0, n, 1)
>>> y = sympy.Subs(1.0, n, 2)
>>> x + y
Traceback (most recent call last):
# Shortened for clarity
File "/mnt/c/Users/migue/Source/Equator/.venv_linux/lib/python3.8/site-packages/sympy/logic/boolalg.py", line 211, in _noop
raise TypeError('BooleanAtom not allowed in this context.')
TypeError: BooleanAtom not allowed in this context.
During handling of the above exception, another exception occurred:
# Shortened for clarity
Traceback (most recent call last):
File "/mnt/c/Users/migue/Source/Equator/.venv_linux/lib/python3.8/site-packages/sympy/logic/boolalg.py", line 211, in _noop
raise TypeError('BooleanAtom not allowed in this context.')
TypeError: BooleanAtom not allowed in this context.
n
in the substitution then it works completely fine>>> x = sympy.Subs(n, n, 1)
>>> y = sympy.Subs(n, n, 2)
>>> x + y
Subs(n, n, 1) + Subs(n, n, 2)
'Build finished; the LaTeX files are in _build/latex.
Set the environment variable LATEXMKOPTS='-xelatex -silent'
And run `make all' in that directory to run these through xelatex.
latexmk -pdf -dvi- -ps- 'sympy-1.10.dev.tex'
Latexmk: This is Latexmk, John Collins, 26 Dec. 2019, version: 4.67.
Latexmk: applying rule 'pdflatex'...
! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec) LuaTeX.
(fontspec)
(fontspec) You must change your typesetting engine to,
(fontspec) e.g., "xelatex" or "lualatex"instead of
(fontspec) "latex" or "pdflatex".
Type <return> to continue.
...
l.45 \msg_fatal:nn {fontspec} {cannot-use-pdftex}'
class CustomLatexPrinter(LatexPrinter):
def _print_Idx(self,expr):
return self._print(expr.label)
@sym.printing.printer.print_function(CustomLatexPrinter)
def custom_latex(expr,**settings):
return CustomLatexPrinter(settings).doprint(expr)