> To frame the problem, let us try  to solve the equation x ** 2 == 1/2 
> using sympy:
> 
>     >>> from sympy import Eq, solve, symbols, S
>     >>> x = symbols("x")
>     >>> solve(Eq(x**2, S(1)/2))
>     [-sqrt(2)/2, sqrt(2)/2]
> 
> that worked well, but actually we would like to write the last line simply as
> 
>     >>> solve(x**2 == 1/2)

This is essentially how this would be written in sagemath (a CAS 
exposing various FOSS math software behind a unified python-based 
interface). More about sagemath can be found at https://www.sagemath.org/

In sage, this would be written

    solve([x**2 == 1/2], x)

The additional "x" is because sage also accepts things like

    y = var('y')
    solve([x**2 == y], x) # solve for x in terms of other variables

Large amounts of sage are written in python, including essentially the 
whole symbolic mathematics stack. I'm personally content with using a 
CAS like sage when I want to manipulate mathematics and keeping symbolic 
math separate from my default python interpreter.

- DLD
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/PMUPJJJ7NSYORYVB27D67YUDT2HWA4OX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to