[sympy] Re: How to get a start for the upcoming gsoc 2018

2018-01-15 Thread Leonid Kovalev
If you are interested in contributing to series, study the logic of the ring series module which is documented here . It has a bunch of helper functions like

[sympy] How to get a start for the upcoming gsoc 2018

2018-01-15 Thread madhawadon
Hi, I’m a computer science student currently a freshmen studying in Michigan State University. I’m really interested in working with you for gsoc this year. I have some experience in HTML,PYTHON. I would like to work on Series expansions (to improve series expansions and to improve limits

Re: [sympy] How Python could improve to better support something like Sympy?

2018-01-15 Thread Aaron Meurer
On Mon, Jan 15, 2018 at 3:38 PM, Henri Tuhola wrote: > The idea about changing the precedence and meaning of ^ from > XOR to exponentiation is a bit provoking. I've been > programming so long that I often just forget that ^ > means exponentiation for most people. > > I did

Re: [sympy] How Python could improve to better support something like Sympy?

2018-01-15 Thread Henri Tuhola
The idea about changing the precedence and meaning of ^ from XOR to exponentiation is a bit provoking. I've been programming so long that I often just forget that ^ means exponentiation for most people. I did a quick search and it reveals that the current Python symbol for exponentiation (**)

[sympy] Re: Sympy codegen optimisation by temporary variables

2018-01-15 Thread Leonid Kovalev
The more aggressive (and slower) form is cs = sp.cse(dQ_dR, optimizations='basic') which results in x0 = X_A - X_B x1 = Y_A - Y_B x2 = Z_A - Z_B x3 = 1/sqrt(x0**2 + x1**2 + x2**2) x4 = x0*x3 x5 = x1*x3 x6 = x2*x3 J(1, 1) = x4 J(1, 2) = x5 J(1, 3) = x6 J(1, 4) = -x4 J(1, 5) = -x5 J(1, 6) =

[sympy] Re: Sympy codegen optimisation by temporary variables

2018-01-15 Thread The Pauli Principle
Thank you, this was almost exactly what I was looking for! It did not manage to catch J(1, 4) = x3*(-x0) Is there any more aggressive 'optimisation' possible? or would I have to manually try to see if you can substitute x0 = X_A - X_B in x3*(-X_A + X_B) by trying all possible substitutions

Re: [sympy] How Python could improve to better support something like Sympy?

2018-01-15 Thread Aaron Meurer
You might look at multiple dispatch as an improved method of operator overloading, such as what is implemented in Julia. There are also potentially more advanced things which can be useful, such as pattern matching (Mathematica, Haskell). You have to consider the tradeoffs, however, with

[sympy] Re: Sympy codegen optimisation by temporary variables

2018-01-15 Thread Leonid Kovalev
I would indeed expect the detection of common subexpressions to be compiler's job. SymPy should not do this by default. But it can do it if you explicitly ask: cs = sp.cse(dQ_dR) print "\n".join(sp.fcode(sub[1], sub[0]) for sub in cs[0]) + "\n" + sp.fcode (cs[1][0], J) prints x0 = X_A - X_B

[sympy] Re: How Python could improve to better support something like Sympy?

2018-01-15 Thread Richard Fateman
It might be useful to list the points of friction that you are aware of in the design of python with respect to use in sympy, to see if people have work-arounds that you might have missed, or to encourage people to point out solutions that exist in alternative languages that already exist.

[sympy] Introduction to SymPy community

2018-01-15 Thread Vishal Gupta
Hi. I'am Vishal Gupta, a fourth year undergraduate at Indian Institute of Technology Kharagpur. - I'am using python from last 1 year. I have done projects in python in my internships. - I have studied Mathematics 1, 2, Laplace-transform, Probability and Statistics in my courses.

[sympy] Sympy codegen optimisation by temporary variables

2018-01-15 Thread The Pauli Principle
Here I am computing the distance d between two points A and B and the derivatives of d towards the coordinates of A and B import sympy as sp sp.init_printing() X_A=sp.symbols('X_A') Y_A=sp.symbols('Y_A') Z_A=sp.symbols('Z_A') X_B=sp.symbols('X_B') Y_B=sp.symbols('Y_B') Z_B=sp.symbols('Z_B')