Ticket #10167: trac_10167-posets_Jposet_ARmatrix_fc.patch

File trac_10167-posets_Jposet_ARmatrix_fc.patch, 6.5 KB (added by chapoton, 10 years ago)

updated patch

  • sage/combinat/posets/hasse_diagram.py

    # HG changeset patch
    # User Frederic Chapoton <chapoton at math.univ-lyon1.fr>
    # Date 1296040690 -3600
    # Node ID e1f56592777b55f6afaab2a6a882202d02e38937
    # Parent  2d61de73b783b8959e8d16c14ea9cceb5565ad73
    trac ticket #10167
    
    Three new functions on posets :
    
    The lattice of order ideals for inclusion,
    
    the poset of join irreducibles of a lattice
    
    and the Coxeter transformation matrix.
    
    diff --git a/sage/combinat/posets/hasse_diagram.py b/sage/combinat/posets/hasse_diagram.py
    a b class HasseDiagram(DiGraph): 
    758758        self.mobius_function = mobius_function
    759759        return self._mobius_function_matrix
    760760
    761     def auslander_reiten_matrix(self):
     761    def coxeter_transformation(self):
    762762        r"""
    763763        Returns the matrix of the Auslander-Reiten translation acting on
    764764        the Grothendieck group of the derived category of modules on the
    765765        poset, in the basis of simple modules.
    766  
     766
    767767        EXAMPLES::
    768        
    769             sage: M=Posets.PentagonPoset().auslander_reiten_matrix();M
     768
     769            sage: M=Posets.PentagonPoset().coxeter_transformation();M
     770            [ 0  0  0  0 -1]
     771            [ 0  0  0  1 -1]
     772            [ 0  1  0  0 -1]
     773            [-1  1  1  0 -1]
     774            [-1  1  0  1 -1]
    770775
    771776        TESTS::
    772777
     778            sage: M=Posets.PentagonPoset().coxeter_transformation()
     779            sage: M**8==1
     780            True
    773781        """
    774         if not hasattr(self,'_auslander_reiten_matrix'):
    775             self._auslander_reiten_matrix = -self.lequal_matrix()*self.mobius_function_matrix().transpose()
    776         return self._auslander_reiten_matrix
     782        if not hasattr(self,'_coxeter_transformation'):
     783            self._coxeter_transformation = -self.lequal_matrix()*self.mobius_function_matrix().transpose()
     784        return self._coxeter_transformation
    777785
    778786    def order_filter(self,elements):
    779787        """
    class HasseDiagram(DiGraph): 
    12791287            <generator object antichains_iterator at ...>
    12801288
    12811289        """
    1282         yield []
    1283         for antichain in HasseDiagramAntichainGenerator(self):
    1284             yield antichain
     1290        if self.cardinality()==0:
     1291            yield []
     1292        else:
     1293            yield []
     1294            for antichain in HasseDiagramAntichainGenerator(self):
     1295                yield antichain
    12851296
    12861297    def antichains_v2(self):
    12871298        empty_antichain = []
  • sage/combinat/posets/lattices.py

    diff --git a/sage/combinat/posets/lattices.py b/sage/combinat/posets/lattices.py
    a b class FiniteLatticePoset(FiniteMeetSemil 
    373373        """
    374374        return self._hasse_diagram.complements()
    375375
     376    def join_irreducibles(self):
     377        r"""
     378        Returns the list of the join-irreducible elements of the
     379        finite lattice.
     380
     381        A *join-irreducible element* of ``self`` is an element ``x``
     382        that is not minimal and can not be written as the join of two
     383        elements different from ``x``.
     384
     385        EXAMPLES::
     386
     387            sage: L = LatticePoset({0:[1,2,3],1:[4],2:[4],3:[4]})
     388            sage: L.join_irreducibles()
     389            [1, 2, 3]
     390        """
     391        return [x for x in self if len(self.lower_covers(x)) == 1]
     392
     393    def join_irreducibles_poset(self):
     394        r"""
     395        Returns the poset of join-irreducible elements of the finite
     396        lattice.
     397
     398        A *join-irreducible element* of ``self`` is an element ``x``
     399        that is not minimal and can not be written as the join of two
     400        elements different from ``x``.
     401
     402        EXAMPLES::
     403
     404            sage: L = LatticePoset({0:[1,2,3],1:[4],2:[4],3:[4]})
     405            sage: L.join_irreducibles_poset()
     406            Finite poset containing 3 elements
     407        """
     408        return self.subposet(self.join_irreducibles())
     409
    376410####################################################################################
  • sage/combinat/posets/posets.py

    diff --git a/sage/combinat/posets/posets.py b/sage/combinat/posets/posets.py
    a b class FinitePoset(ParentWithBase): 
    494494            sage: P.cover_relations()
    495495            [[e, f], [c, d], [a, b], [b, d], [d, f]]
    496496            sage: H.edges()
    497             [(a, b, None), (c, d, None), (b, d, None), (e, f, None), (d, f, None)]
     497            [(0, 5, None), (1, 4, None), (2, 3, None), (3, 4, None), (4, 5, None)]
    498498        """
    499499        #hd = self._hasse_diagram.to_directed()
    500500        #hd.relabel(self.linear_extension())
    class FinitePoset(ParentWithBase): 
    12191219        """
    12201220        return self._hasse_diagram.lequal_matrix(**kwds)
    12211221
     1222    def coxeter_transformation(self,**kwds):
     1223        r"""
     1224        Returns the matrix of the Auslander-Reiten translation acting
     1225        on the Grothendieck group of the derived category of modules
     1226        on the poset ``self``, in the basis of simple modules. This matrix is
     1227        usually called the Coxeter transformation.
     1228
     1229        EXAMPLES::
     1230
     1231            sage: Posets.PentagonPoset().coxeter_transformation()
     1232            [ 0  0  0  0 -1]
     1233            [ 0  0  0  1 -1]
     1234            [ 0  1  0  0 -1]
     1235            [-1  1  1  0 -1]
     1236            [-1  1  0  1 -1]
     1237
     1238        TESTS::
     1239
     1240            sage: M=Posets.PentagonPoset().coxeter_transformation()
     1241            sage: M**8==1
     1242            True
     1243        """
     1244        return self._hasse_diagram.coxeter_transformation(**kwds)
     1245
     1246
    12221247    def meet_matrix(self):
    12231248        """
    12241249        Returns a matrix whose (i,j) entry is k, where
    class FinitePoset(ParentWithBase): 
    16041629        """
    16051630        return self.order_ideal([x])
    16061631
     1632    def order_ideals_lattice(self): # ugly implementation, any suggestions ?
     1633        r"""
     1634        Returns the lattice of order ideals of a poset ``P``, ordered by
     1635        inclusion. The common notation is ``J(P)``.
     1636
     1637        EXAMPLES::
     1638
     1639            sage: Posets.PentagonPoset().order_ideals_lattice()
     1640            Finite lattice containing 8 elements
     1641
     1642        TESTS::
     1643
     1644            sage: Posets.DiamondPoset(4).order_ideals_lattice()
     1645            Finite lattice containing 6 elements
     1646
     1647        """
     1648        from sage.sets.set import Set
     1649        from sage.combinat.posets.lattices import LatticePoset
     1650        ideals=[Set( self.order_ideal(antichain) ) for antichain in self.antichains()]
     1651        fcn = lambda I,J: all( z in J for z in I )
     1652        return LatticePoset((ideals,fcn))
     1653
    16071654    def interval(self, x, y):
    16081655        """
    16091656        Returns a list of the elements `z` such that `x \le z \le y`.