Skip to content

Commit 565b493

Browse files
committed
Trac #21318: use (new) .linear_representation in doctests
1 parent d0318a0 commit 565b493

File tree

1 file changed

+46
-29
lines changed

1 file changed

+46
-29
lines changed

src/sage/combinat/recognizable_series.py

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,8 +1126,11 @@ def _add_(self, other):
11261126
sage: I = E + O # indirect doctest
11271127
sage: I
11281128
2-regular sequence 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1129-
sage: I.mu[0], I.mu[1], I.left, I.right
1130-
([1], [1], (1), (1))
1129+
sage: I.linear_representation()
1130+
((1),
1131+
Finite family {0: [1],
1132+
1: [1]},
1133+
(1))
11311134
"""
11321135
from sage.modules.free_module_element import vector
11331136
P = self.parent()
@@ -1183,11 +1186,13 @@ def _rmul_(self, other):
11831186
sage: M = E * 2 # indirect doctest
11841187
sage: M
11851188
2-regular sequence 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, ...
1186-
sage: M.mu[0], M.mu[1], M.left, M.right
1187-
(
1188-
[0 1] [0 0]
1189-
[0 1], [0 1], (1, 0), (2, 2)
1190-
)
1189+
sage: M.linear_representation()
1190+
((1, 0),
1191+
Finite family {0: [0 1]
1192+
[0 1],
1193+
1: [0 0]
1194+
[0 1]},
1195+
(2, 2))
11911196
"""
11921197
P = self.parent()
11931198
return P.element_class(P, self.mu, self.left, self.right*other)
@@ -1275,41 +1280,53 @@ def hadamard_product(self, other):
12751280
sage: CE = C.hadamard_product(E)
12761281
sage: CE
12771282
2-regular sequence 0, 0, 2, 0, 4, 0, 6, 0, 8, 0, ...
1278-
sage: CE.mu[0], CE.mu[1], CE.left, CE.right
1279-
(
1280-
[0 1 0] [ 0 0 0]
1281-
[0 2 0] [ 0 0 1]
1282-
[0 2 1], [ 0 -2 3], (1, 0, 0), (0, 0, 2)
1283-
)
1283+
sage: CE.linear_representation()
1284+
((1, 0, 0),
1285+
Finite family {0: [0 1 0]
1286+
[0 2 0]
1287+
[0 2 1],
1288+
1: [ 0 0 0]
1289+
[ 0 0 1]
1290+
[ 0 -2 3]},
1291+
(0, 0, 2))
12841292
12851293
sage: Z = E.hadamard_product(O)
12861294
sage: Z
12871295
2-regular sequence 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
1288-
sage: Z.mu[0], Z.mu[1], Z.left, Z.right
1289-
([], [], (), ())
1296+
sage: Z.linear_representation()
1297+
((),
1298+
Finite family {0: [],
1299+
1: []},
1300+
())
12901301
12911302
TESTS::
12921303
12931304
sage: EC = E.hadamard_product(C, minimize=False)
12941305
sage: EC
12951306
2-regular sequence 0, 0, 2, 0, 4, 0, 6, 0, 8, 0, ...
1296-
sage: EC.mu[0], EC.mu[1], EC.left, EC.right
1297-
(
1298-
[0 0 2 0] [ 0 0 0 0]
1299-
[0 0 2 1] [ 0 0 0 0]
1300-
[0 0 2 0] [ 0 0 0 1]
1301-
[0 0 2 1], [ 0 0 -2 3], (1, 0, 0, 0), (0, 1, 0, 1)
1302-
)
1307+
sage: EC.linear_representation()
1308+
((1, 0, 0, 0),
1309+
Finite family {0: [0 0 2 0]
1310+
[0 0 2 1]
1311+
[0 0 2 0]
1312+
[0 0 2 1],
1313+
1: [ 0 0 0 0]
1314+
[ 0 0 0 0]
1315+
[ 0 0 0 1]
1316+
[ 0 0 -2 3]},
1317+
(0, 1, 0, 1))
13031318
sage: MEC = EC.minimized()
13041319
sage: MEC
13051320
2-regular sequence 0, 0, 2, 0, 4, 0, 6, 0, 8, 0, ...
1306-
sage: MEC.mu[0], MEC.mu[1], MEC.left, MEC.right
1307-
(
1308-
[0 1 0] [ 0 0 0]
1309-
[0 2 0] [ 0 0 1]
1310-
[0 2 1], [ 0 -2 3], (1, 0, 0), (0, 0, 2)
1311-
)
1312-
1321+
sage: MEC.linear_representation()
1322+
((1, 0, 0),
1323+
Finite family {0: [0 1 0]
1324+
[0 2 0]
1325+
[0 2 1],
1326+
1: [ 0 0 0]
1327+
[ 0 0 1]
1328+
[ 0 -2 3]},
1329+
(0, 0, 2))
13131330
"""
13141331
from sage.matrix.constructor import Matrix
13151332
from sage.modules.free_module_element import vector

0 commit comments

Comments
 (0)