Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-Medium Integration
New issue 2631 by [email protected]: deltaintegrate does not preserve
ordering of non-commutative symbols
http://code.google.com/p/sympy/issues/detail?id=2631
The offending lines of code are actually some that I inserted in the
previous pull request 457 [0] as a fix for issue 2509 [1]. The problem
previously was that different machines gave different results for
integrating over multiple delta functions because the args of the Mul were
not sorted. I added sorting code to fix this, but did not realize that this
code will completely mess up the ordering of any non-commutative symbols by
doing the sorting. An example, in isympy (with f, x, and y defined as they
are by default).
In [1]: a, b = symbols('a, b', commutative=False)
In [2]: e = DiracDelta(x-z)*f(x-b)*f(x-a)
In [3]: integrate(e, (x, -oo, oo))
Out[3]: f(z - a)⋅f(z - b)
In [4]: f(x-b).is_commutative
Out[4]: False
In [5]: f(x-a).is_commutative
Out[5]: False
As you can see, the two functions switch places because of the sorting even
though each one of them is non-commutative. I will look into this and see
if there is a way to be more careful about the sorting of arguments so that
non-commutative orderings are preserved.
[0] https://github.com/sympy/sympy/pull/457
[1] http://code.google.com/p/sympy/issues/detail?id=2509
--
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.