@@ -385,7 +385,7 @@ def immutable(m):
385
385
return m
386
386
387
387
if isinstance (mu , dict ):
388
- mu = dict ((a , immutable (M )) for a , M in iteritems ( mu ))
388
+ mu = dict ((a , immutable (M )) for a , M in mu . items ( ))
389
389
mu = Family (mu )
390
390
391
391
if not mu .is_finite ():
@@ -875,7 +875,7 @@ def __eq__(self, other):
875
875
sage: Z1 = Rec((Matrix([[1, 0], [0, 1]]), Matrix([[1, 0], [0, 1]])),
876
876
....: left=vector([0, 1]), right=vector([1, 0]))
877
877
sage: Z1
878
- 0
878
+ 0 + ...
879
879
sage: Z2 = Rec((Matrix([[0, 0], [0, 0]]), Matrix([[0, 0], [0, 0]])),
880
880
....: left=vector([0, 1]), right=vector([1, 0]))
881
881
sage: Z2
@@ -1411,7 +1411,7 @@ def _pickle_RecognizableSeriesSpace(coefficients, indices, category):
1411
1411
sage: Rec = RecognizableSeriesSpace(ZZ, [0, 1])
1412
1412
sage: from sage.combinat.recognizable_series import _pickle_RecognizableSeriesSpace
1413
1413
sage: _pickle_RecognizableSeriesSpace(
1414
- ....: Rec.coefficients (), Rec.indices(), Rec.category())
1414
+ ....: Rec.coefficient_ring (), Rec.indices(), Rec.category())
1415
1415
Space of recognizable series on {0, 1} with coefficients in Integer Ring
1416
1416
"""
1417
1417
return RecognizableSeriesSpace (coefficients , indices = indices , category = category )
@@ -1588,6 +1588,7 @@ def __init__(self, coefficient_ring, indices, category):
1588
1588
running ._test_an_element() . . . pass
1589
1589
running ._test_cardinality() . . . pass
1590
1590
running ._test_category() . . . pass
1591
+ running ._test_construction() . . . pass
1591
1592
running ._test_elements() . . .
1592
1593
Running the test suite of self.an_element()
1593
1594
running ._test_category() . . . pass
@@ -1623,7 +1624,7 @@ def __reduce__(self):
1623
1624
Space of recognizable series on {0, 1} with coefficients in Integer Ring
1624
1625
"""
1625
1626
return _pickle_RecognizableSeriesSpace , \
1626
- (self .coefficients (), self .indices (), self .category ())
1627
+ (self .coefficient_ring (), self .indices (), self .category ())
1627
1628
1628
1629
1629
1630
def alphabet (self ):
@@ -1710,9 +1711,9 @@ def _an_element_(self):
1710
1711
"""
1711
1712
from sage .matrix .constructor import Matrix
1712
1713
from sage .modules .free_module_element import vector
1713
- z = self .coefficients ().zero ()
1714
- o = self .coefficients ().one ()
1715
- e = self .coefficients ().an_element ()
1714
+ z = self .coefficient_ring ().zero ()
1715
+ o = self .coefficient_ring ().one ()
1716
+ e = self .coefficient_ring ().an_element ()
1716
1717
return self (list (Matrix ([[o , z ], [i * o , o ]])
1717
1718
for i , _ in enumerate (self .alphabet ())),
1718
1719
vector ([z , e ]), right = vector ([e , z ]))
@@ -1733,25 +1734,24 @@ def some_elements(self):
1733
1734
sage: tuple(RecognizableSeriesSpace(ZZ, [0, 1]).some_elements())
1734
1735
([1] + [01] + [10] + 2*[11] + [001] + [010]
1735
1736
+ 2*[011] + [100] + 2*[101] + 2*[110] + ...,
1736
- [] + [0] + [1] + [00] + [01] + [10]
1737
- + [11] + [000] + [001] + [010] + ...,
1738
- 0,
1739
- -2*[] + 2*[0] - 4*[1] - 2*[00] + 4*[01] + 4*[10]
1740
- - 8*[11] + 2*[000] - 4*[001] - 4*[010] + ...,
1741
- [] + [0] + 2*[1] + [00] + 2*[01] + [10]
1742
- + 4*[11] + [000] + 2*[001] + [010] + ...,
1743
- 2*[] + 5*[0] + 11*[1] + 8*[00] + 14*[01] + 14*[10]
1744
- + 20*[11] + 11*[000] + 17*[001] + 17*[010] + ...,
1737
+ [] + [1] + [11] + [111] + [1111] + [11111] + [111111] + ...,
1738
+ [] + [0] + [1] + [00] + [10] + [11]
1739
+ + [000] - 1*[001] + [100] + [110] + ...,
1740
+ 2*[] - 1*[1] + 2*[10] - 1*[101]
1741
+ + 2*[1010] - 1*[10101] + 2*[101010] + ...,
1742
+ [] + [1] + 6*[00] + [11] - 39*[000] + 5*[001] + 6*[100] + [111]
1743
+ + 288*[0000] - 33*[0001] + ...,
1744
+ -5*[] + ...,
1745
1745
...
1746
- [] + [0] + 10*[1 ] + [00] + 10*[01] + [10]
1747
- + 100*[11] + [000 ] + 10*[001] + [010 ] + ...)
1746
+ 210*[ ] + ...,
1747
+ 2210*[] - 170*[0 ] + 170*[1 ] + ...)
1748
1748
"""
1749
1749
from itertools import count , islice
1750
1750
from sage .matrix .matrix_space import MatrixSpace
1751
1751
from sage .modules .free_module import FreeModule
1752
1752
yield self .an_element ()
1753
1753
1754
- C = self .coefficients ()
1754
+ C = self .coefficient_ring ()
1755
1755
some_elements_base = iter (C .some_elements ())
1756
1756
k = len (self .alphabet ())
1757
1757
for dim in range (1 , 11 ):
0 commit comments