Live data from Hacker News

SymPy makes math fun again

wordsandbuttons.online

91–96 of 96 posts

Re: SymPy makes math fun again

#92

Earlier quoted context omitted.

> Is it easier to import SageMath from a plain Python script now; with conda repackaging? Yes, it's easy. It was always possible, since fortunately none of the Sage library implementation uses the Sage preprocessor. You could always do "sage -python" and you get the Python interpreter that Sage uses, and can import Sage via "import sage.all". Somebody asked me exactly this question at a colloquium talk I gave on Sage…

> They have other things to smooth out the parts of python I should add that this is an interesting chunk of Python code, and we've always planned to separate it out from Sage as a separate library than could be used with Sympy, etc. https://github.com/sagemath/sage/blob/52a81cbd161ef4d5895325... It does a surprising number of little clever things we realized would be a good idea over years, and it has some neat idea…

Recently I've been working with the %%ipytest magic command for running pytest in notebooks.

Is there a %%sage IPython magic method that passes code through the preparse.py input transform?

Re: SymPy makes math fun again

#93

Earlier quoted context omitted.

Is that maybe because you are familiar with Mathematica?

No. In Mathematica important operations like mapping functions over sets (arrays/tensors) at various depths have simple operators such as (/@, @, @@, @@@). You can do functional composition using @*, etc. You don't need to define your variables and functions before being able to write them in expressions. Often you want to have intermediate terms that have some temporary name, and which get substituted later on. The…

My Mathematica solutions are a bit shorter than my Python solutions mainly because of convenient functions like PrimeQ, Binomial, ContinuedFraction.

Re: SymPy makes math fun again

#96

Earlier quoted context omitted.

> They have other things to smooth out the parts of python I should add that this is an interesting chunk of Python code, and we've always planned to separate it out from Sage as a separate library than could be used with Sympy, etc. https://github.com/sagemath/sage/blob/52a81cbd161ef4d5895325... It does a surprising number of little clever things we realized would be a good idea over years, and it has some neat idea…

Recently I've been working with the %%ipytest magic command for running pytest in notebooks. Is there a %%sage IPython magic method that passes code through the preparse.py input transform?

src/sage/repl/ipython_extension.py: https://github.com/sagemath/sage/blob/develop/src/sage/repl/... docs: https://doc.sagemath.org/html/en/reference/repl/sage/repl/ip...

https://github.com/sagemath/sage/blob/develop/src/sage/repl/...

Post reply on HN