Tensor product of elements of non-free algebras
In SageMath 9.1 I am unable to execute the code
a = SteenrodAlgebra(2).an_element()
M = CombinatorialFreeModule(GF(2), 's,t,u')
s = M.basis()['s']
T = tensor([a,s])
which is copied verbatim from this answer posted back in 2012. Instead, I get AttributeError on the tensor command. Is there some ingredient I'm missing?
More to the point, I am unable to run
N = 2
k.<w> = CyclotomicField(N)
A.<X,Z> = FreeAlgebra(k, 2)
F = A.monoid()
X, Z = F.gens()
monomials = [X^i*Z^j for j in range(0,N) for i in range(0,N)]
MS = MatrixSpace(k, len(monomials))
matrices = [
# matrix showing the action of the first generator, X, on the monomials
MS([0, 1, 0, 0, # 1*X = X
1, 0, 0, 0, # X*X = 1
0, 0, 0, -1, # Z*X = -XZ
0, 0, -1, 0 # XZ*X = -Z
]),
# matrix showing the action of the second generator, Z, on the monomials
MS([0, 0, 1, 0, # 1*Z = Z
0, 0, 0, 1, # X*Z = XZ
1, 0, 0, 0, # Z*Z = 1
0, 1, 0, 0 # XZ*Z = X
]),
]
B.<X,Z> = A.quotient(monomials, matrices)
tensor( (X*Z,X) )
which is the code I'm actually interested in. In this instance I get AssertionError on the tensor command. Is there some restriction on using tensor on non-free algebras? The code below executes fine:
N = 3
k.<w> = CyclotomicField(N)
A.<X,Z> = FreeAlgebra(k, 2)
tensor( (X*Z,X) )
The code
works fine in Sage 8.8 but fails in Sage 8.9.
This might have to do with the changes in Sage Trac ticket 25603.
Thanks for reporting. This appears to reveal a bug. Fixing it is now tracked at
Thanks. I've been trying (with difficulty) to follow the discussion there, and there seems to be some question about whether tensor() is even supposed to be defined on elements. I did find examples in the documentation here and here. But maybe it's not defined for every type of algebra? If not, is this something that is feasible for a user to define themselves?