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 _conjugacy_classes_representatives_underlying_group(self): r""" Returns a complete list of representatives of conjugacy classes of the underlying symmetric group EXAMPLES:: sage: SG=SymmetricGroupAlgebra(ZZ,3) sage: SG._conjugacy_classes_representatives_underlying_group() [[2, 3, 1], [2, 1, 3], [1, 2, 3]] """ return [ permutation.Permutations(self.n).element_in_conjugacy_classes(nu) for nu in partition.Partitions(self.n) ]
def RibbonTableaux(shape, weight, length): """ Returns the combinatorial class of ribbon tableaux of skew shape shape and weight weight tiled by ribbons of length length. EXAMPLES:: sage: RibbonTableaux([[2,1],[]],[1,1,1],1) Ribbon tableaux of shape [[2, 1], []] and weight [1, 1, 1] with 1-ribbons """ if shape in partition.Partitions(): shape = partition.Partition(shape) shape = skew_partition.SkewPartition([shape, shape.core(length)]) else: shape = skew_partition.SkewPartition(shape) if shape.size() != length * sum(weight): raise ValueError weight = [i for i in weight if i != 0] return RibbonTableaux_shapeweightlength(shape, weight, length)