Is there a use-case for the Order expression? I think it's akin to taking the Order with respect to a function, like f(x). Does that make sense? We allow it for differentiation under specific circumstances because it's convenient to treat f(x) as an atomic variable. Maybe Order should also use _diff_wrt.
On Wed, Sep 27, 2017 at 5:12 PM, Francesco Bonazzi <[email protected]> wrote: > > > On Tuesday, 26 September 2017 18:08:07 UTC-4, Aaron Meurer wrote: >> >> For free_symbols, I'm not so sure. It seems to me that the correct >> free_symbols should be {A[i], i}. i is indeed free in the expression. > > > https://github.com/sympy/sympy/pull/13360 > >> >> This is perhaps a bit confusing for Order since it isn't a continuous >> variable, but consider something like a summation. > > > Now I get: > In [5]: Order(A[i]) > Out[5]: O(A[i], A, i, A[i]) > > I think we need a variation of free_symbols that stops at A[i] without going > further into {A, i}. This seems correct, actually. If you don't provide the variable for the Order to be with respect to, it guesses automatically, and pulls in as many possibly varying symbols as possible. The real problem here, I believe, is that the inclusion of i in the variables seems wrong because i is not continuous, but this is specific to Order, not to free_symbols in general. Won't the more explicit Order(A[i], A[i]) work? > > >> >> I don't know if it's worth having a separate free_symbols, since >> free_symbols is already a mathematically defined concept. > > > Well, the question is how to behave in case of composite objects, that is > when you reach an object that is itself a free symbol, but contains other > free symbols inside of it. > >> The fact >> that a summation or integration variable is not free is a mathematical >> property, not a property of the expression tree. Could we just make it >> so that A[i].free_symbols returns {A[i], i}? > > > We need to make it return {A[i], A, i} as A may be an array. Can A be a more complicated expression? Aaron Meurer > > -- > 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 https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/270865d9-77c5-47fd-b7bf-a0d41cb62a2f%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- 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 https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6Lv2oqqy-dNb-KpeAAL8YQmBhimD4W6hMHHNEGzj-_8eQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
