My first guess for #9046 is that the problem is located within the
last line of collect : return x + (*this-x).expand();
In that case (*this-x).expand() should be zero but looks like:
-x^2 - 2*y^3 - y^2*z + x^2 + 2*y^3 + y^2*z
I think that whithin the call to expand(),
expairseq::combine_same_terms_sorted_seq() is called after
canonicalize(); but with the new order x^2 and -x^2, etc. are not
adjacent and do not get simplified... whence the above expression for
(*this-x).expand() and finally for p.collect(x).
I'll look at the ordering problem causing that tomorrow.

On 29 sep, 18:48, Jean-Pierre Flori <[email protected]> wrote:
> Hi,
>
> Maybe it is a good thing to keep the same order as ginac internally
> and your more usual ordering for printing.
> However if you'd better not duplicate code, I can look at the "-
> x^2+x^2" part of bug #9046.
> Now I may understand a big enough part of pynac code to do that.
> But if you'd better use the above patch, that won't be necessary.
>
> Cheers,
>
> On 29 sep, 17:33, Burcin Erocal <[email protected]> wrote:
>
> > Hi,
>
> > On Wed, 29 Sep 2010 07:00:39 -0700 (PDT)
>
> > Jean-Pierre Flori <[email protected]> wrote:
> > > Ok, I have finally looked at the comparison functions and exchanging :
> > > cmpval = seq[0].coeff.compare(other.exponent);
> > > by
> > > cmpval = -seq[0].coeff.compare(other.exponent);
> > > in mul::compare_pow (mul.cpp:1265) seems to prevent the above bug from
> > > happening.
> > > It seems to fit better with the change made by William Stein in
> > > power::compare_same_type (power.cpp:951).
> > > However it doesn't mean the problem is completely solved...
> > > I'll try to take a deeper look at the comparison functions at some
> > > point.
>
> > Thank you for following up on this and taking the time to go through
> > the comparisons.
>
> > I was planning to build on the patch I posted before [1] to fix this
> > problem once and for all (perhaps rather optimistically).
>
> > [1]http://sage.math.washington.edu/home/burcin/pynac/pynac_order.patch
>
> > Note that your suggestions fixes your bug (#9880), but doesn't effect
> > #9046.
>
> > Cheers,
> > Burcin
>
>

-- 
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/sage-support
URL: http://www.sagemath.org

Reply via email to