Skip to content

Commit ef07140

Browse files
committed
blas_dict: add doctest for noncommutative coefficients using SymmetricGroupAlgebra; closes #40127
1 parent 33f0f8f commit ef07140

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/sage/data_structures/blas_dict.pyx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,20 @@ cpdef dict linear_combination(dict_factor_iter, bint factor_on_left=True):
340340
{0: 10, 1: 10}
341341
sage: blas.linear_combination( [(D,1), (D,-1)] )
342342
{}
343+
344+
Check right multiplication with coefficients in a noncommutative ring::
345+
346+
sage: SGA = SymmetricGroupAlgebra(QQ, 3)
347+
sage: s1 = SGA([2, 1, 3]) # (1 2)
348+
sage: s2 = SGA([3, 1, 2]) # (1 3)
349+
sage: D1 = {0: s1}
350+
sage: blas.linear_combination([(D1, s2)], factor_on_left=False)
351+
{0: s1 * s2}
352+
353+
Check left multiplication with coefficients in a noncommutative ring::
354+
355+
sage: blas.linear_combination([(D1, s2)], factor_on_left=True)
356+
{0: s2 * s1}
343357
"""
344358
cdef dict result = {}
345359
cdef dict D

0 commit comments

Comments
 (0)