I personally would vote for option a as it would be consistent with functions like sin and cos.
Some things to consider though: - What if either argument is something like x - y or y - x? Would those both be canonicalized to the same thing (with either choice)? - If there ever could be a case where someone would not want it changed, go with option b, because, as with all automatic simplifications, option a makes it impossible to not have it applied. - Don't worry too much about algorithms being easier if you choose option a because the form will always be canonical. It's not hard to add a function call at the top to put it into canonical form if you choose b. Aaron Meurer On Jul 13, 2012, at 6:25 AM, rl <[email protected]> wrote: There is an old open PR: http://github.com/sympy/sympy/pull/1026 which tries to make orthogonal polynomials work for symbolic order 'n'. An open question is when to apply "simplifications" like: L_n(-x) ---> (-1)**n * L_n(x) L_{-n}(x) ---> L_{n-1}(x) Do we want to have this: a) at construction time b) only when calling expand_func Both approaches have their obvious advantages. Please see the commits: a) a958cb78c2bfd6d6e94dd05123f43195f2cdbe83 and b) 659afc3474b146814279d39840c61f4c6589071c to get an implementation of both approaches. -- You received this message because you are subscribed to the Google Groups "sympy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/eDJFpg7fz5cJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
