#15714: implement CFiniteSequence
-------------------------------------+-------------------------------------
Reporter: rws | Owner: rws
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.2
Component: combinatorics | Resolution:
Keywords: recurrence, | Merged in:
sequence, ogf | Reviewers:
Authors: rws | Work issues:
Report Upstream: N/A | Commit:
Branch: | f73e11e1396b68c1668c4808b25edcf38c23163f
u/rws/ticket/15714 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by mmezzarobba):
* status: needs_review => needs_work
Comment:
Some more comments:
* Your code is apparently limited to sequences with real or rational
coefficients. IMHO it would be best to handle C-finite sequences over
arbitrary rings (or perhaps integral domains?). If you don't want to do
that, the scope of the code should be clearly documented and there should
be a few checks in suitable places^[1]^.
* How about making CFiniteSequences Elements of a proper Parent? Sure, it
is not absolutely essential at this point, but that's something we will
certainly want in the long run—C-finite sequences [over a given ring] form
a ring!—, and designing a suitable interface from the start would save the
trouble of deprecating the current one later on!
* If you do implement a "ring of C-Finite sequences over ...", I'd suggest
moving it outside of combinat (perhaps to a new package
`sage.rings.sequences`?).
[1] Currently, the following examples all behave differently:
{{{
sage: R.<x> = RR[]; fibo = CFiniteSequence(x/(1-x-x^2)); fibo[10]
55
sage: R.<x> = GF(3)[]; fibo = CFiniteSequence(x/(1-x-x^2)); fibo[10]
...
ValueError: Cannot convert to CFiniteSequence.
sage: R.<x> = CC[]; fibo = CFiniteSequence(x/(1-x-x^2)); fibo[10]
...
TypeError: Unable to coerce 0.000000000000000 (<type
'sage.rings.complex_number.ComplexNumber'>) to Rational
}}}
Their behaviour is not entirely unreasonable, but it only makes sense if
you know that `CFiniteSequence` is going to try converting the input to a
rational fraction over `QQ`.
--
Ticket URL: <http://trac.sagemath.org/ticket/15714#comment:13>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.