Skip to content

Commit e1f1a46

Browse files
committed
Addressing reviewer comments.
1 parent ff616a8 commit e1f1a46

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/sage/combinat/symmetric_group_algebra.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,7 +2076,7 @@ def murphy_basis(self):
20762076
"""
20772077
return MurphyBasis(self)
20782078

2079-
@cached_method
2079+
@cached_method(key=lambda s, X, Y: (StandardTableaux()(X), StandardTableaux()(Y)))
20802080
def murphy_basis_element(self, S, T):
20812081
r"""
20822082
Return the Murphy basis element indexed by ``S`` and ``T``.
@@ -2095,15 +2095,28 @@ def murphy_basis_element(self, S, T):
20952095
[[1, 3], [2]] [[1, 2], [3]] [1, 3, 2] + [3, 1, 2]
20962096
[[1, 2], [3]] [[1, 3], [2]] [1, 3, 2] + [2, 3, 1]
20972097
[[1, 2], [3]] [[1, 2], [3]] [1, 2, 3] + [3, 2, 1]
2098+
2099+
TESTS::
2100+
2101+
sage: SGA = SymmetricGroupAlgebra(QQ, 3)
2102+
sage: SGA.murphy_basis_element([[1,2,3,4]], [[1,2],[3,4]])
2103+
Traceback (most recent call last):
2104+
...
2105+
ValueError: [[1, 2, 3, 4]] is not an element of Standard tableaux of size 3
2106+
sage: SGA.murphy_basis_element([[1,2,3]], [[1,2],[3]])
2107+
Traceback (most recent call last):
2108+
...
2109+
ValueError: S and T must have the same shape
20982110
"""
2111+
std_tab = StandardTableaux(self.n)
2112+
S = std_tab(S)
2113+
T = std_tab(T)
20992114
S = S.conjugate()
21002115
T = T.conjugate()
21012116

21022117
la = S.shape()
21032118
if la != T.shape():
21042119
raise ValueError("S and T must have the same shape")
2105-
if sum(la) != self.n:
2106-
raise ValueError(f"the shape must be a partition of size {self.n}")
21072120

21082121
G = self.group()
21092122
ds = G(list(sum((row for row in S), ())))

0 commit comments

Comments
 (0)