In sympy 0.7.2 the spherical harmonic function Ylm gave 'expanded' results:

In [3]: sympy.Ylm(sympy.S(3), sympy.S(1), sympy.Symbol('x'), 
sympy.Symbol('y'))
Out[3]: -sqrt(21)*(15*cos(x)**2/2 - 3/2)*exp(I*y)*sin(x)/(12*sqrt(pi))


but in sympy it was renamed to Ynm and no longer expands automatically:

In [3]: sympy.Ynm(sympy.S(3), sympy.S(1), sympy.Symbol('x'), 
sympy.Symbol('y'))
Out[3]: Ynm(3, 1, x, y)

In [4]: _.expand(func=True)
Out[4]: -5*sqrt(21)*sqrt(-cos(x)**2 + 1)*exp(I*y)*cos(x)**2/(8*sqrt(pi)) + 
sqrt(21)*sqrt(-cos(x)**2 + 1)*exp(I*y)/(8*sqrt(pi))


Many similar functions do however expand upon being called:

In [5]: sympy.gegenbauer(sympy.S(6), sympy.S(1), sympy.Symbol('x'))
Out[5]: 64*x**6 - 80*x**4 + 24*x**2 - 1

In [6]: sympy.laguerre(5, sympy.Symbol('x'))
Out[6]: -x**5/120 + 5*x**4/24 - 5*x**3/3 + 5*x**2 - 5*x + 1

etc


The spherical harmonics are the only class of functions I've come across 
which behave in this way.

Is there a criteria for deciding when these types of functions should 
expand?

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to