Dear Travis!

Thank you for the hint!  I got a bit further, but I'm still stuck.  Here is 
a minimal non-working example.

I suspect that the problem is my not understanding of the hint in 
IndexedFreeModuleElement.__init__:

-------------------------------
        """
        Create a combinatorial module element. This should never be
        called directly, but only through the parent combinatorial
        free module's :meth:`__call__` method.
-------------------------------


Many thanks for all help!

Martin

"""
sage: S = SymmetricFunctions(QQ)
sage: S.inject_shorthands()
sage: t = tensor([s[1,1], h[2]])
sage: x = TwoPositionsElement(t)
sage: 2*x
"""

class TwoPositionsElement(CombinatorialFreeModule.Element):
    def __init__(self, x):
        self._x = x
        CombinatorialFreeModule.Element.__init__(self,
                                                
 TwoPositions(*(self._x.parent()._sets)),
                                                 x._monomial_coefficients)
        

from sage.combinat.free_module import CombinatorialFreeModule_Tensor
class TwoPositions(CombinatorialFreeModule_Tensor):

    def __init__(self, *modules):
        CombinatorialFreeModule_Tensor.__init__(self, modules, category = 
HopfAlgebrasWithBasis(QQ).TensorProducts())

    def __repr__(self):
        return "TwoPositions in %s"%(self._sets,)

    Element = TwoPositionsElement

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to