1 | initial version |
Maybe like that
def matrice_morphism(morph):
"""
Return the matrix of a morphism ``morph``.
EXAMPLES::
sage: module = CombinatorialFreeModule(QQ,Partitions(4))
sage: f = lambda mu:module.monomial(mu.conjugate())
sage: morphisme = module.module_morphism(f, codomain=module)
sage: matrice_morphism(morphisme)
[0 0 0 0 1]
[0 0 0 1 0]
[0 0 1 0 0]
[0 1 0 0 0]
[1 0 0 0 0]
"""
return matrix([morph(u).to_vector() for u in morph.domain().basis()])