#19999: infinite recursion creating certain asymptotic expansion
-----------------------------------------+------------------------
Reporter: dkrenn | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-7.1
Component: asymptotic expansions | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-----------------------------------------+------------------------
Comment (by behackl):
The problem is that, in general, `q^x` and `(-q)^x` can be compared in the
sense of
{{{
sage: q^x <= (-q)^x and (-q)^x <= q^x
True
}}}
For example, the same problem occurrs here:
{{{
sage: print (2^x + (-2)^x).summands.repr_full()
poset((-2)^x, 2^x)
+-- (-2)^x
| +-- predecessors: 2^x
| +-- successors: 2^x
+-- null
| +-- no predecessors
| +-- successors: 2^x
+-- 2^x
| +-- predecessors: (-2)^x, null
| +-- successors: (-2)^x, oo
+-- oo
| +-- predecessors: 2^x
| +-- no successors
}}}
I see three possibilities (well, two proper ones...) to fix this.
1. Making the (exponential growth) elements `(-q)^x` and `q^x`
incomparable. (very simple)
2. The other (equally simple) option would be to check for `l <= r and r
<= l` (in `le_lex` of `combinat/posets/cartesian_product.py`) after `l ==
r`, and then return `False` (this means that the poset sees the two
elements as incomparable, when actually, they very well are comparable).
This introduces inconsistencies (behavior in `QQ^x` vs. `QQ^x * x^QQ`...)
and should probably not be implemented.
3. Refactoring parts of the `MutablePoset` such that it properly handles
the case where some element can be the successor as well as the
predecessor of another element simultanously. I'm not an expert regarding
the code there, but I think that while this might be the "correct"
solution, it is also the most complicated and it might also have a
negative impact on the overall performance of the `AsymptoticRing` (which
is, needless to say, bad).
Opinions?
--
Ticket URL: <http://trac.sagemath.org/ticket/19999#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac.
For more options, visit https://groups.google.com/d/optout.