Skip to content

Commit 81c0df4

Browse files
committed
Trac #21318: use tensor_product in method hadamard_product
1 parent cfc296d commit 81c0df4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/sage/combinat/recognizable_series.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,16 +1332,16 @@ def hadamard_product(self, other):
13321332
from sage.modules.free_module_element import vector
13331333
P = self.parent()
13341334

1335+
def tensor_product(left, right):
1336+
T = left.tensor_product(right)
1337+
T.subdivide()
1338+
return T
13351339
result = P.element_class(
13361340
P,
1337-
dict((a,
1338-
Matrix(tuple(
1339-
srow.outer_product(orow).list()
1340-
for srow in self.mu[a].rows()
1341-
for orow in other.mu[a].rows())))
1341+
dict((a, tensor_product(self.mu[a], other.mu[a]))
13421342
for a in P.alphabet()),
1343-
vector(self.left.outer_product(other.left).list()),
1344-
vector(self.right.outer_product(other.right).list()))
1343+
vector(tensor_product(Matrix(self.left), Matrix(other.left))),
1344+
vector(tensor_product(Matrix(self.right), Matrix(other.right))))
13451345

13461346
return result
13471347

0 commit comments

Comments
 (0)