Nicolas, > In your case, to implement the smash product, you probably want to > implement a subclass of CombinatorialFreeModuleTensor, set its > category to the join of ModulesWithBasis(QQ).TensorProducts() and > AlgebrasWithBasis(QQ), and implement the product similarly to what's > done for tensor products of algebras with basis.
I would dearly love to be able to construct elements in my class in an automatically multilinear way, using the _tensor_of_elements method for tensor products of modules. However sage won't let me. Basically it has an overly restrictive type check which fails. Here is a toy version of my class: class MyTensorProductOfAlgebras(CombinatorialFreeModule_Tensor): def __init__(self, A, B): R = A.base_ring() CombinatorialFreeModule_Tensor.__init__(self, [A,B], \ category=Category.join((AlgebrasWithBasis(R),ModulesWithBasis(R).TensorProducts()))) The code calling the _element_tensor method for the vanilla instance T: sage: L = CartanType(['A',2]).root_system().weight_lattice() sage: A = L.algebra(ZZ) sage: a = A.an_element() sage: T = tensor([A,A]) sage: T._tensor_of_elements([a,a]) B[2*Lambda[1] + 2*Lambda[2]] # B[2*Lambda[1] + 2*Lambda[2]] and the custom class TT: sage: TT = MyTensorProductOfAlgebras(A,A) TT._tensor_of_elements([a,a]) AssertionError and the offending line is: assert(sage.categories.tensor.tensor(modules) == self) where "modules" is the list of modules to be tensored and "self" is the instance that is invoking _tensor_of_elements. Note that sage: T and sage: TT give the same exact description string. Any solutions/workarounds? Surely there is no need to reimplement the multilinearity! --Mark -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/groups/opt_out.