Comment #3 on issue 2566 by [email protected]: Equating Sums shouldn't depend on dummy variables
http://code.google.com/p/sympy/issues/detail?id=2566

IMO, since neither has any free_symbols, a test should be done by replacing the symbols with equivalent symbols in both Sums and they should compare to be the same:

    def Integral_Sum_are_same(a, b):
        """Return True if Sum/Integral `a` is the same as Sum/Integral `b`.

        The result depends only on the free symbols of `a` and `b`; order of
        integration is also considered for simplicity reasons.
        """
        ab = [a, b]
        la, lb = [w.limits for w in ab]
if len(la) != len(lb) or any(lai[1:] != lbi[1:] for lai, lbi in zip(la, lb)):
            return False
        ea, eb = [w.function for w in ab]
        for i, vab in enumerate(zip(*[w.variables for w in ab])):
            vai, vbi = vab
            vi = Dummy(str(i))
            ea = ea.subs(vai, vi)
            eb = eb.subs(vbi, vi)
        return ea == eb

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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-issues?hl=en.

Reply via email to