Ticket #5790: 5790.2.patch

File 5790.2.patch, 23.0 KB (added by jbandlow, 9 months ago)
  • sage/combinat/partition.py

    # HG changeset patch
    # User Jason Bandlow <jbandlow@gmail.com>
    # Date 1245094287 14400
    # Node ID 8c7e07da06802ea104ec774369cec32cf96acf90
    # Parent  6c7354ace3b6e0bf4c33ddb730531bd23a9fb92c
    imported patch partition-update-AM.patch
    
    diff -r 6c7354ace3b6 -r 8c7e07da0680 sage/combinat/partition.py
    a b  
    187187    sage: Partition([4,3,1]).corners() 
    188188    [[0, 3], [1, 2], [2, 0]] 
    189189 
    190 We can compute the r-core and r-quotient of a partition and build 
     190We can compute the core and quotient of a partition and build 
    191191the partition back up from them. 
    192192 
    193193:: 
    194194 
    195     sage: Partition([6,3,2,2]).r_core(3) 
     195    sage: Partition([6,3,2,2]).core(3) 
    196196    [2, 1, 1] 
    197     sage: Partition([7,7,5,3,3,3,1]).r_quotient(3) 
     197    sage: Partition([7,7,5,3,3,3,1]).quotient(3) 
    198198    [[2], [1], [2, 2, 2]] 
    199199    sage: p = Partition([11,5,5,3,2,2,2]) 
    200     sage: p.r_core(3) 
     200    sage: p.core(3) 
    201201    [] 
    202     sage: p.r_quotient(3) 
     202    sage: p.quotient(3) 
    203203    [[2, 1], [4], [1, 1, 1]] 
    204     sage: Partition(core_and_quotient=([],[[2, 1], [4], [1, 1, 1]])) 
     204    sage: Partition(core=[],quotient=[[2, 1], [4], [1, 1, 1]]) 
    205205    [11, 5, 5, 3, 2, 2, 2] 
    206206""" 
    207207#***************************************************************************** 
     
    237237from integer_vector import IntegerVectors 
    238238from cartesian_product import CartesianProduct 
    239239from integer_list import IntegerListsLex 
    240  
    241 def Partition(l=None, exp=None, core_and_quotient=None): 
    242     """ 
    243     Returns a partition object. 
    244      
    245     Note that Sage uses the English convention for partitions and 
    246     tableaux. 
    247      
    248     EXAMPLES:: 
    249      
     240from sage.functions.other import ceil 
     241 
     242def Partition(mu=None, **key_word):                                               
     243    """                                                                           
     244    A partition is a weakly decreasing ordered sequence of non-negative           
     245    integers. This function returns a Sage partition object which can             
     246    be specified in one of the following ways::                                   
     247      * a list (the default)                                                      
     248      * using exponential notation                                                
     249      * by beta numbers (TODO)                                                    
     250      * specifying the core and the quotient                                      
     251      * specifying the core and the canonical quotient (TODO)                     
     252    See the examples below.                                                       
     253                                                                                  
     254    Sage follows the usual python conventions when dealing with partitions,       
     255    so that the first part of the partition ``mu=Partition([4,3,2,2])`` is        
     256    ``mu[0]``, the second part is ``mu[1]`` and so on. As is usual, Sage ignores  
     257    trailing zeros at the end of partitions.                                      
     258                                                                                  
     259    EXAMPLES::                                                                    
     260                                                                                  
     261        sage: Partition([3,2,1])                                                  
     262        [3, 2, 1]                                                                 
     263        sage: Partition([3,2,1,0])                                                
     264        [3, 2, 1]                                                                 
    250265        sage: Partition(exp=[2,1,1]) 
    251266        [3, 2, 1, 1] 
    252         sage: Partition(core_and_quotient=([2,1], [[2,1],[3],[1,1,1]])) 
     267        sage: Partition(core=[2,1], quotient=[[2,1],[3],[1,1,1]]) 
    253268        [11, 5, 5, 3, 2, 2, 2] 
    254         sage: Partition([3,2,1]) 
    255         [3, 2, 1] 
    256269        sage: [2,1] in Partitions() 
    257270        True 
    258271        sage: [2,1,0] in Partitions() 
    259272        False 
    260         sage: Partition([2,1,0]) 
    261         [2, 1] 
    262273        sage: Partition([1,2,3]) 
    263274        Traceback (most recent call last): 
    264275        ... 
    265276        ValueError: [1, 2, 3] is not a valid partition 
    266277    """ 
    267     number_of_arguments = 0 
    268     for arg in ['l', 'exp', 'core_and_quotient']: 
    269         if locals()[arg] is not None: 
    270             number_of_arguments += 1 
    271  
    272     if number_of_arguments != 1: 
    273         raise ValueError, "you must specify exactly one argument" 
    274  
    275     if l is not None: 
    276         l = [i for i in l if i != 0] 
    277         if l in Partitions_all(): 
    278             return Partition_class(l) 
    279         else: 
    280             raise ValueError, "%s is not a valid partition"%l 
    281     elif exp is not None: 
    282         return from_exp(exp) 
    283     else: 
    284         return from_core_and_quotient(*core_and_quotient) 
    285      
     278    if mu is not None and len(key_word)==0: 
     279        mu = [i for i in mu if i != 0] 
     280        if mu in Partitions_all(): 
     281            return Partition_class(mu) 
     282        else: 
     283            raise ValueError, "%s is not a valid partition"%mu 
     284    elif 'beta_numbers' in key_word and len(key_word)==1: 
     285        raise NotImplementedError 
     286    elif 'exp' in key_word and len(key_word)==1: 
     287        return Partition_class([]).from_exp(key_word['exp']) 
     288    elif 'core' in key_word and 'quotient' in key_word and len(key_word)==2: 
     289        return Partition_class([]).from_core_and_quotient(key_word['core'], key_word['quotient']) 
     290    elif 'core' in key_word and 'canonical_quotient' in key_word and len(key_word)==2: 
     291        raise NotImplementedError 
     292    elif 'core_and_quotient' in key_word and len(key_word)==1: 
     293        from sage.misc.misc import deprecation 
     294        deprecation('"core_and_quotient=(*)" is deprecated. Use "core=[*], quotient=[*]" instead.') 
     295        return Partition_class([]).from_core_and_quotient(*key_word['core_and_quotient']) 
     296    else: 
     297        raise ValueError, 'incorrect syntax for Partition()' 
    286298 
    287299def from_exp(a): 
    288300    """ 
     301    ** This function is being deprecated - use Partition(exp=*) instead ** 
    289302    Returns a partition from its list of multiplicities. 
    290303     
    291304    EXAMPLES:: 
    292305     
    293         sage: partition.from_exp([1,2,1]) 
     306        sage: Partition(exp=[1,2,1]) 
    294307        [3, 2, 2, 1] 
    295308    """ 
    296  
    297     p = [] 
    298     for i in reversed(range(len(a))): 
    299         p += [i+1]*a[i] 
    300  
    301     return Partition(p) 
    302  
     309    from sage.misc.misc import deprecation 
     310    deprecation('"from_exp" is deprecated. Use "Partition(exp=[*])" instead.') 
     311    return Partition(exp=a) 
    303312 
    304313def from_core_and_quotient(core, quotient): 
    305314    """ 
    306     Returns a partition from its r-core and r-quotient. 
     315    ** This function is being deprecated - use Partition(core=*, quotient=*) instead ** 
     316     
     317    Returns a partition from its core and quotient. 
    307318     
    308319    Algorithm from mupad-combinat. 
    309320     
    310321    EXAMPLES:: 
    311322     
    312         sage: partition.from_core_and_quotient([2,1], [[2,1],[3],[1,1,1]]) 
     323        sage: Partition(core=[2,1], quotient=[[2,1],[3],[1,1,1]]) 
    313324        [11, 5, 5, 3, 2, 2, 2] 
    314325    """ 
    315     from sage.functions.all import ceil 
    316     length = len(quotient) 
    317     k = length*max( [ceil(len(core)/length),len(core)] + [len(q) for q in quotient] ) + length 
    318     v = [ core[i]-(i+1)+1 for i in range(len(core))] + [ -i + 1 for i in range(len(core)+1,k+1) ] 
    319     w = [ filter(lambda x: (x-i) % length == 0, v) for i in range(1, length+1) ] 
    320     new_w = [] 
    321     for i in range(length): 
    322         new_w += [ w[i][j] + length*quotient[i][j] for j in range(len(quotient[i]))] 
    323         new_w += [ w[i][j] for j in range(len(quotient[i]), len(w[i])) ] 
    324     new_w.sort() 
    325     new_w.reverse() 
    326     return filter(lambda x: x != 0, [new_w[i-1]+i-1 for i in range(1, len(new_w)+1)]) 
    327  
     326    from sage.misc.misc import deprecation 
     327    deprecation('"from_core_and_quotient" is deprecated. Use "Partition(core=[*],quotient=[*])" instead.') 
     328    return Partition(core=core,quotient=quotient) 
    328329     
    329330class Partition_class(CombinatorialObject): 
     331    def from_exp(self,exp): 
     332        """ 
     333        Returns a partition from its list of multiplicities. 
     334         
     335        EXAMPLES:: 
     336         
     337            sage: Partition(exp=[1,2,1]) 
     338            [3, 2, 2, 1] 
     339        """ 
     340        p = [] 
     341        for i in reversed(range(len(exp))): 
     342            p += [i+1]*exp[i] 
     343        return Partition(p) 
     344 
     345    def from_core_and_quotient(self, core, quotient): 
     346        """ 
     347        Returns a partition from its core and quotient. 
     348         
     349        Algorithm from mupad-combinat. 
     350         
     351        EXAMPLES:: 
     352         
     353            sage: Partition(core=[2,1], quotient=[[2,1],[3],[1,1,1]]) 
     354            [11, 5, 5, 3, 2, 2, 2] 
     355        """ 
     356        length = len(quotient) 
     357        k = length*max( [ceil(len(core)/length),len(core)] + [len(q) for q in quotient] ) + length 
     358        v = [ core[i]-(i+1)+1 for i in range(len(core))] + [ -i + 1 for i in range(len(core)+1,k+1) ] 
     359        w = [ filter(lambda x: (x-i) % length == 0, v) for i in range(1, length+1) ] 
     360        new_w = [] 
     361        for i in range(length): 
     362            new_w += [ w[i][j] + length*quotient[i][j] for j in range(len(quotient[i]))] 
     363            new_w += [ w[i][j] for j in range(len(quotient[i]), len(w[i])) ] 
     364        new_w.sort() 
     365        new_w.reverse() 
     366        return Partition([new_w[i-1]+i-1 for i in range(1, len(new_w)+1)]) 
     367 
     368 
    330369    def ferrers_diagram(self): 
    331370        """ 
    332371        Return the Ferrers diagram of pi. 
     
    344383            ***** 
    345384            ** 
    346385            *         
    347             sage: pi = Partitions(10).list()[11] ## [6,1,1,1,1] 
    348             sage: print pi.ferrers_diagram() 
    349             ****** 
    350             * 
    351             * 
    352             * 
    353             * 
    354             sage: pi = Partitions(10).list()[8] ## [6, 3, 1] 
    355             sage: print pi.ferrers_diagram() 
    356             ****** 
    357             *** 
    358             * 
    359386        """ 
    360387        return '\n'.join(['*'*p for p in self]) 
    361388 
     
    507534 
    508535    def sign(self): 
    509536        r""" 
    510         partition_sign( pi ) returns the sign of a permutation with cycle 
    511         structure given by the partition pi. 
     537        Returns the sign of a permutation with cycle type of the partition. 
    512538         
    513539        This function corresponds to a homomorphism from the symmetric 
    514540        group `S_n` into the cyclic group of order 2, whose kernel 
     
    516542        `1` are called even partitions while partitions of sign 
    517543        `-1` are called odd. 
    518544         
    519         Wraps GAP's SignPartition. 
    520          
    521545        EXAMPLES:: 
    522546         
    523547            sage: Partition([5,3]).sign() 
     
    577601 
    578602        - http://en.wikipedia.org/wiki/Zolotarev's_lemma 
    579603        """ 
    580         ans=gap.eval("SignPartition(%s)"%(self)) 
    581         return sage_eval(ans) 
     604        return (-1)**(self.size()-self.length()) 
    582605 
    583606    def up(self): 
    584607        r""" 
     
    791814            sage: Partition([5,4,2,1,1,1]).associated().associated() 
    792815            [5, 4, 2, 1, 1, 1] 
    793816        """ 
    794  
    795817        return self.conjugate() 
    796818 
    797819    def arm(self, i, j): 
     
    14151437        return res 
    14161438 
    14171439    def r_core(self, length): 
    1418         """ 
    1419         Returns the r-core of the partition p. The construction of the 
    1420         r-core can be visualized by repeatedly removing border strips of 
    1421         size r from p until this is no longer possible. The remaining 
    1422         partition is the r-core. 
    1423          
    1424         EXAMPLES:: 
    1425          
    1426             sage: Partition([6,3,2,2]).r_core(3) 
     1440      """ *** deprecate *** """ 
     1441      from sage.misc.misc import deprecation 
     1442      deprecation('r_core is deprecated. Use core instead.') 
     1443      return self.core(self, length) 
     1444 
     1445    def core(self, length): 
     1446        """ 
     1447        Returns the core of the partition -- in the literature the core is 
     1448        commonly referred to as the k-core, p-core, r-core, ... . The 
     1449        construction of the core can be visualized by repeatedly removing 
     1450        border strips of size r from p until this is no longer possible. 
     1451        The remaining partition is the core. 
     1452         
     1453        EXAMPLES:: 
     1454         
     1455            sage: Partition([6,3,2,2]).core(3) 
    14271456            [2, 1, 1] 
    1428             sage: Partition([]).r_core(3) 
    1429             [] 
    1430             sage: Partition([8,7,7,4,1,1,1,1,1]).r_core(3) 
     1457            sage: Partition([]).core(3) 
     1458            [] 
     1459            sage: Partition([8,7,7,4,1,1,1,1,1]).core(3) 
    14311460            [2, 1, 1] 
    14321461         
    14331462        TESTS:: 
    14341463         
    1435             sage: Partition([3,3,3,2,1]).r_core(3) 
    1436             [] 
    1437             sage: Partition([10,8,7,7]).r_core(4) 
    1438             [] 
    1439             sage: Partition([21,15,15,9,6,6,6,3,3]).r_core(3) 
     1464            sage: Partition([3,3,3,2,1]).core(3) 
     1465            [] 
     1466            sage: Partition([10,8,7,7]).core(4) 
     1467            [] 
     1468            sage: Partition([21,15,15,9,6,6,6,3,3]).core(3) 
    14401469            [] 
    14411470        """ 
    14421471        p = self 
     
    14621491        return filter(lambda x: x != 0, part) 
    14631492 
    14641493    def r_quotient(self, length): 
    1465         """ 
    1466         Returns the r-quotient of the partition p. The r-quotient is a list 
    1467         of r partitions, constructed in the following way. Label each cell 
    1468         in p with its content, modulo r. Let R_i be the set of rows ending 
    1469         in a box labelled i, and C_i be the set of columns ending in a box 
    1470         labelled i. Then the jth component of the r-quotient of p is the 
    1471         partition defined by intersecting R_j with C_j+1. 
    1472          
    1473         EXAMPLES:: 
    1474          
    1475             sage: Partition([7,7,5,3,3,3,1]).r_quotient(3) 
     1494        """ *** deprecate *** """ 
     1495        from sage.misc.misc import deprecation 
     1496        deprecation('r_quotient is deprecated. Use quotient instead.') 
     1497        return self.quotient(self,length) 
     1498 
     1499 
     1500    def quotient(self, length): 
     1501        """ 
     1502        Returns the quotient of the partition  -- in the literature the 
     1503        core is commonly referred to as the k-core, p-core, r-core, ... . The 
     1504        quotient is a list of r partitions, constructed in the following 
     1505        way. Label each cell in p with its content, modulo r. Let R_i be 
     1506        the set of rows ending in a box labelled i, and C_i be the set of 
     1507        columns ending in a box labelled i. Then the jth component of the 
     1508        quotient of p is the partition defined by intersecting R_j with 
     1509        C_j+1. 
     1510         
     1511        EXAMPLES:: 
     1512 
     1513            sage: Partition([7,7,5,3,3,3,1]).quotient(3) 
    14761514            [[2], [1], [2, 2, 2]] 
    14771515         
    14781516        TESTS:: 
    14791517         
    1480             sage: Partition([8,7,7,4,1,1,1,1,1]).r_quotient(3) 
     1518            sage: Partition([8,7,7,4,1,1,1,1,1]).quotient(3) 
    14811519            [[2, 1], [2, 2], [2]] 
    1482             sage: Partition([10,8,7,7]).r_quotient(4) 
     1520            sage: Partition([10,8,7,7]).quotient(4) 
    14831521            [[2], [3], [2], [1]] 
    1484             sage: Partition([6,3,3]).r_quotient(3) 
     1522            sage: Partition([6,3,3]).quotient(3) 
    14851523            [[1], [1], [2]] 
    1486             sage: Partition([3,3,3,2,1]).r_quotient(3) 
     1524            sage: Partition([3,3,3,2,1]).quotient(3) 
    14871525            [[1], [1, 1], [1]] 
    1488             sage: Partition([6,6,6,3,3,3]).r_quotient(3) 
     1526            sage: Partition([6,6,6,3,3,3]).quotient(3) 
    14891527            [[2, 1], [2, 1], [2, 1]] 
    1490             sage: Partition([21,15,15,9,6,6,6,3,3]).r_quotient(3) 
     1528            sage: Partition([21,15,15,9,6,6,6,3,3]).quotient(3) 
    14911529            [[5, 2, 1], [5, 2, 1], [7, 3, 2]] 
    1492             sage: Partition([21,15,15,9,6,6,3,3]).r_quotient(3) 
     1530            sage: Partition([21,15,15,9,6,6,3,3]).quotient(3) 
    14931531            [[5, 2], [5, 2, 1], [7, 3, 1]] 
    1494             sage: Partition([14,12,11,10,10,10,10,9,6,4,3,3,2,1]).r_quotient(5) 
     1532            sage: Partition([14,12,11,10,10,10,10,9,6,4,3,3,2,1]).quotient(5) 
    14951533            [[3, 3], [2, 2, 1], [], [3, 3, 3], [1]] 
    14961534        """ 
    14971535        p = self 
     
    39844022     
    39854023    EXAMPLES:: 
    39864024     
    3987         sage: print ferrers_diagram([5,5,2,1]) 
     4025        sage: print Partition([5,5,2,1]).ferrers_diagram() 
    39884026        ***** 
    39894027        ***** 
    39904028        ** 
    39914029        *         
    3992         sage: pi = partitions_list(10)[30] ## [6,1,1,1,1] 
    3993         sage: print ferrers_diagram(pi) 
    3994         ****** 
    3995         * 
    3996         * 
    3997         * 
    3998         * 
    3999         sage: pi = partitions_list(10)[33] ## [6, 3, 1] 
    4000         sage: print ferrers_diagram(pi) 
    4001         ****** 
    4002         *** 
    4003         * 
    4004     """ 
    4005     return '\n'.join(['*'*p for p in pi]) 
     4030    """ 
     4031    from sage.misc.misc import deprecation 
     4032    deprecation('"ferrers_diagram deprecated. Use Partition(pi).ferrers_diagram() instead') 
     4033    return Partition(pi).ferrers_diagram() 
    40064034 
    40074035 
    40084036def ordered_partitions(n,k=None): 
     
    42774305 
    42784306def partition_sign(pi): 
    42794307    r""" 
    4280     partition_sign( pi ) returns the sign of a permutation with cycle 
     4308    ** This function is being deprecated -- use Partition(*).sign() instead.  ** 
     4309 
     4310    Partition( pi ).sign() returns the sign of a permutation with cycle 
    42814311    structure given by the partition pi. 
    42824312     
    42834313    This function corresponds to a homomorphism from the symmetric 
     
    42854315    is exactly the alternating group `A_n`. Partitions of sign 
    42864316    `1` are called even partitions while partitions of sign 
    42874317    `-1` are called odd. 
    4288      
    4289     Wraps GAP's SignPartition. 
    4290      
    4291     EXAMPLES:: 
    4292      
    4293         sage: partition_sign([5,3]) 
     4318    
     4319    This function is deprecated: use Partition( pi ).sign() instead. 
     4320 
     4321    EXAMPLES:: 
     4322     
     4323        sage: Partition([5,3]).sign() 
    42944324        1 
    4295         sage: partition_sign([5,2]) 
     4325        sage: Partition([5,2]).sign() 
    42964326        -1 
    42974327     
    42984328    Zolotarev's lemma states that the Legendre symbol 
     
    43224352        sage: p = PermutationGroupElement('(1, 2, 4, 8, 5, 10, 9, 7, 3, 6)') 
    43234353        sage: p.sign() 
    43244354        -1 
    4325         sage: partition_sign([10]) 
     4355        sage: Partition([10]).sign() 
    43264356        -1 
    43274357        sage: kronecker_symbol(11,2) 
    43284358        -1 
     
    43384368        1 
    43394369        sage: kronecker_symbol(3,11) 
    43404370        1 
    4341         sage: partition_sign([5,1,1,1,1,1]) 
     4371        sage: Partition([5,1,1,1,1,1]).sign() 
    43424372        1 
    43434373     
    43444374    In both cases, Zolotarev holds. 
     
    43474377 
    43484378    - http://en.wikipedia.org/wiki/Zolotarev's_lemma 
    43494379    """ 
    4350     ans=gap.eval("SignPartition(%s)"%(pi)) 
    4351     return sage_eval(ans) 
     4380    from sage.misc.misc import deprecation 
     4381    deprecation('"partition_sign deprecated. Use Partition(pi).sign() instead') 
     4382    return Partition(pi).sign() 
    43524383 
    43534384def partition_associated(pi): 
    43544385    """ 
     4386    ** This function is being deprecated -- use Partition(*).conjugate() instead.  ** 
     4387 
    43554388    partition_associated( pi ) returns the "associated" (also called 
    43564389    "conjugate" in the literature) partition of the partition pi which 
    43574390    is obtained by transposing the corresponding Ferrers diagram. 
    43584391     
    43594392    EXAMPLES:: 
    43604393     
    4361         sage: partition_associated([2,2]) 
     4394        sage: Partition([2,2]).conjugate() 
    43624395        [2, 2] 
    4363         sage: partition_associated([6,3,1]) 
     4396        sage: Partition([6,3,1]).conjugate() 
    43644397        [3, 2, 2, 1, 1, 1] 
    4365         sage: print ferrers_diagram([6,3,1]) 
     4398        sage: print Partition([6,3,1]).ferrers_diagram() 
    43664399        ****** 
    43674400        *** 
    43684401        * 
    4369         sage: print ferrers_diagram([3,2,2,1,1,1]) 
     4402        sage: print Partition([6,3,1]).conjugate().ferrers_diagram() 
    43704403        *** 
    43714404        ** 
    43724405        ** 
     
    43744407        * 
    43754408        * 
    43764409    """ 
    4377     return list(Partition(pi).conjugate()) 
    4378              
     4410    from sage.misc.misc import deprecation 
     4411    deprecation('"partition_associated deprecated. Use Partition(pi).conjugte() instead') 
     4412    return Partition(pi).conjugate() 
     4413             
  • sage/combinat/ribbon_tableau.py

    diff -r 6c7354ace3b6 -r 8c7e07da0680 sage/combinat/ribbon_tableau.py
    a b  
    142142    """ 
    143143    if shape in partition.Partitions(): 
    144144        shape = partition.Partition(shape) 
    145         shape = skew_partition.SkewPartition([shape, shape.r_core(length)]) 
     145        shape = skew_partition.SkewPartition([shape, shape.core(length)]) 
    146146    else: 
    147147        shape = skew_partition.SkewPartition(shape) 
    148148 
     
    880880            sage: a = SkewPartition([[8,7,6,5,1,1],[2,1,1]]) 
    881881            sage: weight = [3,3,2] 
    882882            sage: k = 3 
    883             sage: s = SemistandardMultiSkewTableaux(a.r_quotient(k),weight) 
     883            sage: s = SemistandardMultiSkewTableaux(a.quotient(k),weight) 
    884884            sage: len(s.list()) 
    885885            34 
    886886            sage: RibbonTableaux(a,weight,k).cardinality() 
  • sage/combinat/sf/llt.py

    diff -r 6c7354ace3b6 -r 8c7e07da0680 sage/combinat/sf/llt.py
    a b  
    146146             
    147147        elif isinstance(skp, list) and skp[0] in sage.combinat.skew_partition.SkewPartitions(): 
    148148            #skp is a list of skew partitions 
    149             skp =  [sage.combinat.partition.Partition(core_and_quotient=([], skp[i][0])) for i in range(len(skp))] 
    150             skp += [sage.combinat.partition.Partition(core_and_quotient=([], skp[i][1])) for i in range(len(skp))] 
     149            skp =  [sage.combinat.partition.Partition(core=[], quotient=skp[i][0]) for i in range(len(skp))] 
     150            skp += [sage.combinat.partition.Partition(core=[], quotient=skp[i][1]) for i in range(len(skp))] 
    151151            mu = sage.combinat.partition.Partitions(ZZ(sum( [ s.size() for s in skp] ) / self.level())) 
    152152 
    153153             
    154154        elif isinstance(skp, list) and skp[0] in sage.combinat.partition.Partitions(): 
    155155            #skp is a list of partitions 
    156             skp = sage.combinat.partition.Partition(core_and_quotient=([], skp)) 
     156            skp = sage.combinat.partition.Partition(core=[], quotient=skp) 
    157157            mu = sage.combinat.partition.Partitions( ZZ(sum(skp) / self.level() )) 
    158158        else: 
    159159            raise ValueError, "LLT polynomials not defined for %s"%skp 
  • sage/combinat/skew_partition.py

    diff -r 6c7354ace3b6 -r 8c7e07da0680 sage/combinat/skew_partition.py
    a b  
    452452        return G 
    453453 
    454454 
    455     def r_quotient(self, k): 
     455    def r_quotient(self, length): 
     456      """ *** deprecate *** """ 
     457      from sage.misc.misc import deprecation 
     458      deprecation('r_quotient is deprecated. Use quotient instead.') 
     459      return self.quotient(self,length) 
     460 
     461    def quotient(self, k): 
    456462        """ 
    457463        The quotient map extended to skew partitions. 
    458464         
    459465        EXAMPLES:: 
    460466         
    461             sage: SkewPartition([[3, 3, 2, 1], [2, 1]]).r_quotient(2) 
     467            sage: SkewPartition([[3, 3, 2, 1], [2, 1]]).quotient(2) 
    462468            [[[3], []], [[], []]] 
    463469        """ 
    464470        ## k-th element is the skew partition built using the k-th partition of the 
    465471        ## k-quotient of the outer and the inner partition. 
    466472        ## This bijection is only defined if the inner and the outer partition 
    467473        ## have the same core 
    468         if self.inner().r_core(k) == self.outer().r_core(k): 
    469             rqinner = self.inner().r_quotient(k) 
    470             rqouter = self.outer().r_quotient(k) 
     474        if self.inner().core(k) == self.outer().core(k): 
     475            rqinner = self.inner().quotient(k) 
     476            rqouter = self.outer().quotient(k) 
    471477            return [ SkewPartition_class([rqouter[i],rqinner[i]]) for i in range(k) ] 
    472478        else: 
    473479            raise ValueError, "quotient map is only defined for skew partitions with inner and outer partitions having the same core"