Multisets in Maxima

103 Views Asked by At

I've been trying to figure out how to create multisets in Maxima and a function that produces the cartesian product of two multisets. I've tried using lists and row matrices. For example, I can represent the multiset $\{1,2,4,4\}$ as the set $\{1,2,s[1],s[2]\}$, where $s[1]=s[2]=4$. However, this is not flexible and is very cumbersome. Any suggestions?