I have a custom monoid with a zero element, and I'd like to define an algebra over it such that the monoid's zero is coerced to the algebra's zero.
Let's use the code from https://ask.sagemath.org/question/32064?answer=32066#post-id-32066 as an illustration. The monoid defined by F = FiniteMonoidFromMultiplicationTable([[0, 0, 0], [0, 1, 1], [0, 1, 2]])
has zero F(0)
. Now, if I define an algebra A = F.algebra(QQ)
, it has no idea that A(F(0))
is simply zero. How to adjust the monoid definition to make its zero recognized by the algebra (i.e., A(F(0))
must be the same as A(0)
)?
For convenience, here is complete example code at sagecell.