def StandardSkewTableaux(skp=None): """ Returns the combinatorial class of standard skew tableaux of shape skp (where skp is a skew partition). EXAMPLES:: sage: StandardSkewTableaux([[3, 2, 1], [1, 1]]).list() [[[None, 1, 2], [None, 3], [4]], [[None, 1, 2], [None, 4], [3]], [[None, 1, 3], [None, 2], [4]], [[None, 1, 4], [None, 2], [3]], [[None, 1, 3], [None, 4], [2]], [[None, 1, 4], [None, 3], [2]], [[None, 2, 3], [None, 4], [1]], [[None, 2, 4], [None, 3], [1]]] """ if skp is None: return StandardSkewTableaux_all() elif isinstance(skp, (int, Integer)): return StandardSkewTableaux_size(skp) elif skp in skew_partition.SkewPartitions(): return StandardSkewTableaux_skewpartition( skew_partition.SkewPartition(skp)) else: raise TypeError
def spin_polynomial_square(part, weight, length): """ Returns the spin polynomial associated with part, weight, and length, with the substitution t -> t^2 made. EXAMPLES:: sage: from sage.combinat.ribbon_tableau import spin_polynomial_square sage: spin_polynomial_square([6,6,6],[4,2],3) t^12 + t^10 + 2*t^8 + t^6 + t^4 sage: spin_polynomial_square([6,6,6],[4,1,1],3) t^12 + 2*t^10 + 3*t^8 + 2*t^6 + t^4 sage: spin_polynomial_square([3,3,3,2,1], [2,2], 3) t^7 + t^5 sage: spin_polynomial_square([3,3,3,2,1], [2,1,1], 3) 2*t^7 + 2*t^5 + t^3 sage: spin_polynomial_square([3,3,3,2,1], [1,1,1,1], 3) 3*t^7 + 5*t^5 + 3*t^3 + t sage: spin_polynomial_square([5,4,3,2,1,1,1], [2,2,1], 3) 2*t^9 + 6*t^7 + 2*t^5 sage: spin_polynomial_square([[6]*6, [3,3]], [4,4,2], 3) 3*t^18 + 5*t^16 + 9*t^14 + 6*t^12 + 3*t^10 """ R = ZZ['t'] t = R.gen() if part in partition.Partitions(): part = skew_partition.SkewPartition([part,partition.Partition_class([])]) elif part in skew_partition.SkewPartitions(): part = skew_partition.SkewPartition(part) if part == [[],[]] and weight == []: return t.parent()(1) return R(graph_implementation_rec(part, weight, length, functools.partial(spin_rec,t))[0])
def __iter__(self): """ EXAMPLES:: sage: SemistandardSkewTableaux(2,[1,1]).list() # indirect doctest [[[1, 2]], [[1], [2]], [[None, 2], [1]], [[None, 1], [2]]] """ for p in skew_partition.SkewPartitions(self.n): for ssst in SemistandardSkewTableaux_shape_weight(p, self.mu): yield ssst
def cardinality(self): """ EXAMPLES:: sage: SemistandardSkewTableaux(2).cardinality() 8 """ count = 0 for p in skew_partition.SkewPartitions(self.n): count += SemistandardSkewTableaux_shape(p).cardinality() return count
def cardinality(self): """ EXAMPLES:: sage: SemistandardSkewTableaux(2,[1,1]).cardinality() 4 """ count = 0 for p in skew_partition.SkewPartitions(self.n): count += SemistandardSkewTableaux_pmu(p, self.mu).cardinality() return count
def SemistandardSkewTableaux(p=None, mu=None): """ Returns a combinatorial class of semistandard skew tableaux. EXAMPLES:: sage: SemistandardSkewTableaux() Semistandard skew tableaux :: sage: SemistandardSkewTableaux(3) Semistandard skew tableaux of size 3 :: sage: SemistandardSkewTableaux([[2,1],[]]) Semistandard skew tableaux of shape [[2, 1], []] :: sage: SemistandardSkewTableaux([[2,1],[]],[2,1]) Semistandard skew tableaux of shape [[2, 1], []] and weight [2, 1] :: sage: SemistandardSkewTableaux(3, [2,1]) Semistandard skew tableaux of size 3 and weight [2, 1] """ if p is None and mu is None: return SemistandardSkewTableaux_all() if p is None: raise ValueError, "you must specify either a size or shape" if isinstance(p, (int, Integer)): if mu is None: return SemistandardSkewTableaux_size(p) else: return SemistandardSkewTableaux_size_weight(p, mu) if p in skew_partition.SkewPartitions(): p = skew_partition.SkewPartition(p) if mu is None: return SemistandardSkewTableaux_shape(p) else: return SemistandardSkewTableaux_shape_weight(p, mu)
def cardinality(self): """ EXAMPLES:: sage: StandardSkewTableaux(1).cardinality() 1 sage: StandardSkewTableaux(2).cardinality() 4 sage: StandardSkewTableaux(3).cardinality() 24 sage: StandardSkewTableaux(4).cardinality() 194 """ count = 0 for skp in skew_partition.SkewPartitions(self.n): count += StandardSkewTableaux_skewpartition(skp).cardinality() return count
def __iter__(self): """ EXAMPLES:: sage: StandardSkewTableaux(2).list() #indirect doctest [[[1, 2]], [[1], [2]], [[None, 1], [2]], [[None, 2], [1]]] sage: StandardSkewTableaux(3).list() #indirect doctest [[[1, 2, 3]], [[1, 2], [3]], [[1, 3], [2]], [[None, 1, 2], [3]], [[None, 1, 3], [2]], [[None, 2, 3], [1]], [[None, 1], [2, 3]], [[None, 2], [1, 3]], [[None, None, 1], [2, 3]], [[None, None, 2], [1, 3]], [[None, None, 3], [1, 2]], [[1], [2], [3]], [[None, 1], [None, 2], [3]], [[None, 1], [None, 3], [2]], [[None, 2], [None, 3], [1]], [[None, 1], [2], [3]], [[None, 2], [1], [3]], [[None, 3], [1], [2]], [[None, None, 1], [None, 2], [3]], [[None, None, 1], [None, 3], [2]], [[None, None, 2], [None, 1], [3]], [[None, None, 3], [None, 1], [2]], [[None, None, 2], [None, 3], [1]], [[None, None, 3], [None, 2], [1]]] """ for skp in skew_partition.SkewPartitions(self.n): for sst in StandardSkewTableaux_skewpartition(skp): yield sst