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
A.<X,Z> = FreeAlgebra(QQ, 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(QQ, 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) )