Ticket #5538: family_adapt-fh-final.patch

File family_adapt-fh-final.patch, 3.2 KB (added by hivert, 13 years ago)

Adapted root system with the new interface

  • sage/combinat/root_system/root_lattice_realization.py

    # HG changeset patch
    # User Florent Hivert <Florent.Hivert@univ-rouen.fr>
    # Date 1239728147 -7200
    # Node ID 6bc44c408e1f5d4b1016d76276d280ddef21d048
    # Parent  6cba5f9cf81a69d9bb098e33f475999b139798fe
    Adapted root_system with the new interface of Family. 
    
    diff -r 6cba5f9cf81a -r 6bc44c408e1f sage/combinat/root_system/root_lattice_realization.py
    a b  
    183183            sage: alpha = RootSystem(["A",3]).root_lattice().simple_roots()
    184184            sage: [alpha[i] for i in [1,2,3]]
    185185            [alpha[1], alpha[2], alpha[3]]
    186 
    187186        """
    188187        if not hasattr(self,"_simple_roots"):
    189             self._simple_roots = Family(self.index_set(), self.simple_root, name = "alpha")
     188            self._simple_roots = Family(self.index_set(), self.simple_root)
     189            # self._simple_roots.rename("alpha")
     190            # break some doctests
    190191        return self._simple_roots
    191192
    192193    def alpha(self):
     
    257258            sage: [alphacheck[i] for i in [1, 2, 3]]
    258259            [alphacheck[1], alphacheck[2], alphacheck[3]]
    259260
     261        TEST:
     262            sage: alphacheck
     263            alphacheck
    260264        """
    261265        if not hasattr(self,"cache_simple_coroots"):
    262             self.cache_simple_coroots = Family(self.index_set(), self.simple_coroot, name = "alphacheck")
     266            self.cache_simple_coroots = Family(self.index_set(), self.simple_coroot)
     267            self.cache_simple_coroots.rename("alphacheck")
    263268        return self.cache_simple_coroots
    264269
    265270    def alphacheck(self):
     
    352357            sage: s = r.simple_reflections()
    353358            sage: s[1]( r.simple_root(1) )
    354359            -alpha[1]
    355            
     360
     361        TEST:
     362            sage: s
     363            simple reflections
    356364        """
    357         return self.alpha().zip(self.reflection, self.alphacheck(), name = "s")
     365        res =  self.alpha().zip(self.reflection, self.alphacheck())
     366        res.rename("simple reflections")
     367        return res
    358368
    359369    s = simple_reflections
    360370
     
    429439            sage: pi[1](x[2])
    430440            -Lambda[1] + 2*Lambda[2]
    431441
     442        TESTS:
     443            sage: pi
     444            pi
    432445        """
    433         return self.alpha().zip(self.projection, self.alphacheck(), name = "pi")
    434 
     446        res = self.alpha().zip(self.projection, self.alphacheck())
     447        res.rename("pi")
     448        return res
     449   
    435450    pi = simple_projections
    436451
    437452    ##########################################################################
  • sage/combinat/root_system/weight_lattice_realization.py

    diff -r 6cba5f9cf81a -r 6bc44c408e1f sage/combinat/root_system/weight_lattice_realization.py
    a b  
    3838        """
    3939        if not hasattr(self,"_fundamental_weights"):
    4040            self._fundamental_weights = Family(self.index_set(),
    41                                                self.fundamental_weight,
    42                                                name = "Lambda")
     41                                               self.fundamental_weight)
     42            # self._fundamental_weights.rename("Lambda")
     43            # break some doctests.
    4344        return self._fundamental_weights
    4445
    4546    def rho(self):