Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
rename to kRegularSequenceSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Aug 10, 2016
1 parent 1818628 commit 1e5efc8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/sage/combinat/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
['automata', 'transducers'])
# Sequences
from binary_recurrence_sequences import BinaryRecurrenceSequence
lazy_import('sage.combinat.k_regular_sequence', 'kRegularSequences')
lazy_import('sage.combinat.k_regular_sequence', 'kRegularSequenceSpace')

# Six Vertex Model
lazy_import('sage.combinat.six_vertex_model', 'SixVertexModel')
Expand Down
29 changes: 16 additions & 13 deletions src/sage/combinat/k_regular_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
::
sage: Seq2 = kRegularSequences(2, ZZ)
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
sage: S = Seq2((Matrix([[1, 0], [0, 1]]), Matrix([[0, -1], [1, 2]])),
....: initial=vector([0, 1]), selection=vector([1, 0]))
sage: S
Expand Down Expand Up @@ -91,7 +91,7 @@ def __init__(self, parent, matrices, initial=None, selection=None,
INPUT:
- ``parent`` -- an instance of :class:`kRegularSequences`.
- ``parent`` -- an instance of :class:`kRegularSequenceSpace`.
- ``matrices`` -- a tuple or other iterable of square matrices,
all of which have the same dimension.
Expand All @@ -117,7 +117,7 @@ def __init__(self, parent, matrices, initial=None, selection=None,
EXAMPLES::
sage: Seq2 = kRegularSequences(2, ZZ)
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
sage: Seq2((Matrix([[3, 6], [0, 1]]), Matrix([[0, -6], [1, 5]])),
....: vector([0, 1]), vector([1, 0]),
....: transpose=True)
Expand Down Expand Up @@ -167,7 +167,7 @@ def _repr_(self):
TESTS::
sage: Seq2 = kRegularSequences(2, ZZ)
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
sage: s = Seq2((Matrix([[3, 6], [0, 1]]), Matrix([[0, -6], [1, 5]])),
....: vector([0, 1]), vector([1, 0]), transpose=True)
sage: repr(s) # indirect doctest
Expand All @@ -192,7 +192,7 @@ def info(self):
EXAMPLES::
sage: Seq2 = kRegularSequences(2, ZZ)
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
sage: Seq2((Matrix([[1, 0], [0, 1]]), Matrix([[0, -1], [1, 2]])),
....: initial=vector([0, 1]), selection=vector([1, 0])).info()
matrices:
Expand Down Expand Up @@ -229,7 +229,7 @@ def __getitem__(self, n):
EXAMPLES::
sage: Seq2 = kRegularSequences(2, ZZ)
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
sage: S = Seq2((Matrix([[1, 0], [0, 1]]), Matrix([[0, -1], [1, 2]])),
....: initial=vector([0, 1]), selection=vector([1, 0]))
sage: S[7]
Expand Down Expand Up @@ -259,7 +259,7 @@ def _product_of_matrices_(self, m):
TESTS::
sage: Seq2 = kRegularSequences(2, ZZ)
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
sage: M0 = Matrix([[1, 0], [0, 1]])
sage: M1 = Matrix([[0, -1], [1, 2]])
sage: S = Seq2((M0, M1))
Expand Down Expand Up @@ -290,23 +290,26 @@ def _product_of_matrices_(self, m):
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent

class kRegularSequences(UniqueRepresentation, Parent):
class kRegularSequenceSpace(UniqueRepresentation, Parent):

Element = kRegularSequence

def __init__(self, k, base, category=None):
r"""
TESTS::
sage: kRegularSequences(2, ZZ)
Set of 2-regular sequences over Integer Ring
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
sage: Seq2
Space of 2-regular sequences over Integer Ring
sage: Seq2.category()
Category of sets
"""
from sage.categories.sets_cat import Sets
self.k = k
super(kRegularSequences, self).__init__(category=category or Sets(),
base=base)
super(kRegularSequenceSpace, self).__init__(
category=category or Sets(), base=base)


def _repr_(self):
return 'Set of {}-regular sequences over {}'.format(self.k, self.base())
return 'Space of {}-regular sequences over {}'.format(self.k, self.base())

0 comments on commit 1e5efc8

Please sign in to comment.