Open dkrenn opened 9 years ago
Description changed:
---
+++
@@ -18,3 +18,4 @@
One motivation for creating this, is to include here many sequences, which can be calculated term-by-term (from the previously calculated ones, i.e., recursively) or where the first N terms can be calculated at once efficiently.
Nevertheless, it can also provide an interface to sequences, where each term can be calculated explicitly (without dealing with the previous ones).
+See the discussion on [sage-devel](https://groups.google.com/forum/#!topic/sage-devel/L-wSCu4fXe8)
Hello Daniel,
Could you define what you mean by sequence. Is it sequence of numbers? Rational numbers? Real numbers? An element of an infinite cartesian power? Because there also are
sage: words.FibonacciWord('ab')
word: abaababaabaababaababaabaababaabaababaaba...
which is an infinite sequence of elements in {a,b}
.
Vincent
Dear Vincent,
Replying to @videlec:
Could you define what you mean by sequence. Is it sequence of numbers? Rational numbers? Real numbers? An element of an infinite cartesian power? Because there also are
sage: words.FibonacciWord('ab') word: abaababaabaababaababaabaababaabaababaaba...
which is an infinite sequence of elements in
{a,b}
.
What I head in mind is a sequence of numbers (usually intergers, rationals, maybe reals). But of course words are very much related to it. So any ideas/suggestions are very welcome.
Replying to @dkrenn:
Replying to @videlec:
Could you define what you mean by sequence. Is it sequence of numbers? Rational numbers? Real numbers? An element of an infinite cartesian power? Because there also are
sage: words.FibonacciWord('ab') word: abaababaabaababaababaabaababaabaababaaba...
which is an infinite sequence of elements in
{a,b}
.What I head in mind is a sequence of numbers (usually intergers, rationals, maybe reals). But of course words are very much related to it. So any ideas/suggestions are very welcome.
Then you are more restrictive than wikipedia in which a sequence is even allowed to be finite. I do not have suggestion beyond having precise specifications. You can perhaps even be explicit in the names by using number_sequences.*
or sequences.numbers.*
? But those two looks a bit too much.
Vincent
And you also have orthogonal polynomials, orbit of a dynamical system, permutations (i.e. image of the letters), ... Depending on who you are talking to a sequence can be many things!
What about 'integer sequences', like for Sloane? Words are already stored in word.<tab>
Replying to @videlec:
Replying to @dkrenn:
Replying to @videlec:
Could you define what you mean by sequence. Is it sequence of numbers? Rational numbers? Real numbers? An element of an infinite cartesian power?
What I head in mind is a sequence of numbers (usually intergers, rationals, maybe reals). [...]
Then you are more restrictive than wikipedia in which a sequence is even allowed to be finite.
I am happy to make it as general as needed.
I do not have suggestion beyond having precise specifications.
Like: Finite and infinite sequences where the elements can be any sage objects (but all of the same type/parent)?
Best,
Daniel
Replying to @nathanncohen:
What about 'integer sequences', like for Sloane? Words are already stored in
word.<tab>
Ok. Do you think here of a parametrisation (parameter ZZ
for integer sequences; like the base for some parent)? I ask, because maybe someone wants to have a sequence of rationals (e.g. Bernoulli numbers) or polynomials (again e.g. Bernoulli). This would then be similar to words with an infinite alphabet...
Ok. Do you think here of a parametrisation (parameter
ZZ
for integer sequences; like the base for some parent)?
No idea. But I do not think that it is related to what this ticket is about. It seems that you want to create a catalog of some sorts, and we just have to figure out a sensible name for it. I do not think that there is any reason to define any kind of interface for the object that it contains.
I also expect that you will find in the (many) combinat class something which can already handle sequences. In this case, it would be better to use it rather than build a new one.
Nathann
Let me try to summarize the two apparently orthogonal issues here:
provide an interface for playing with sequences. My favorite ticket attempting this is #16137, together with #16107. This is for sequences indexed by natural numbers, although possibly finite. If I recall correctly, a generalization might be provided by Family
.
provide a catalogue of named ("famous") sequences. I believe that #16137 should be general enough to be able to deal with just about any sequence. Is there any need to restrict to a certain type of sequence?
If the scope of this ticket is the second item, there is no conflict. However, a backend would need to be chosen...
Description changed:
---
+++
@@ -15,7 +15,9 @@
which should provide a unified access point to all possible sequences in SageMath. For example, there is fibonacci_sequence
in sage.combinat.combinat
, binary_recurring_sequence
(somewhere in combinat) and various other code.
-One motivation for creating this, is to include here many sequences, which can be calculated term-by-term (from the previously calculated ones, i.e., recursively) or where the first N terms can be calculated at once efficiently. -Nevertheless, it can also provide an interface to sequences, where each term can be calculated explicitly (without dealing with the previous ones). +This will use homogenous sequences (#19896), which them-self use lazy lists.
-See the discussion on sage-devel +See also the meta-ticket #16107. + +--- +Old: See the discussion on sage-devel
Dependencies: #19896
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
cc6d05c | move old sequences file to new place |
1136a64 | fit start on iteration |
8e4a562 | add a doctest in dropwhile |
a544d6d | correct nasty bug in takewhile (complete rewrite of method) |
3b63c47 | simplify `__repr__` code |
8354beb | Merge branch 'extend_lazy_lists' into t/19896/sequences/homogenous-seq |
0330c78 | Merge branch 'u/dkrenn/sequences/homogenous-seq' of trac.sagemath.org:sage into u/dakrenn/sequences-catalog |
d8f6707 | rewrite sequence generators to new code |
74f4c4a | sequences in global name space (lazy import) |
d29cbcd | use new code for fibonacci and catalan and deprecate fibonacci_sequence and fibonacci_xrange |
similar to
or to
(and similar), I propose to introduce
which should provide a unified access point to all possible sequences in SageMath. For example, there is
fibonacci_sequence
insage.combinat.combinat
,binary_recurring_sequence
(somewhere in combinat) and various other code.This will use homogenous sequences (#19896), which them-self use lazy lists.
See also the meta-ticket #16107.
Old: See the discussion on sage-devel
Depends on #19896
CC: @mantepse
Component: combinatorics
Author: Daniel Krenn
Branch/Commit: u/dkrenn/sequences/base @
b0bb4fa
Issue created by migration from https://trac.sagemath.org/ticket/18565