示例#1
0
 def _cis(self, series_ring, base_ring):
     r"""
     The cycle index series for the species of partitions is given by
     
     .. math::
     
          exp \sum_{n \ge 1} \frac{1}{n} \left( exp \left( \sum_{k \ge 1} \frac{x_{kn}}{k} \right) -1 \right).
     
     
     
     EXAMPLES::
     
         sage: P = species.PartitionSpecies()
         sage: g = P.cycle_index_series()
         sage: g.coefficients(5)
         [p[],
          p[1],
          p[1, 1] + p[2],
          5/6*p[1, 1, 1] + 3/2*p[2, 1] + 2/3*p[3],
          5/8*p[1, 1, 1, 1] + 7/4*p[2, 1, 1] + 7/8*p[2, 2] + p[3, 1] + 3/4*p[4]]
     """
     ciset = SetSpecies().cycle_index_series(base_ring)
     CIS = ciset.parent()
     res = CIS.sum_generator(((1/n)*ciset).stretch(n) for n in _integers_from(ZZ(1))).exponential()
     if self.is_weighted():
         res *= self._weight
     return res
    def _cis(self, series_ring, base_ring):
        r"""
        The cycle index series for the species of partitions is given by

        .. math::

             exp \sum_{n \ge 1} \frac{1}{n} \left( exp \left( \sum_{k \ge 1} \frac{x_{kn}}{k} \right) -1 \right).



        EXAMPLES::

            sage: P = species.PartitionSpecies()
            sage: g = P.cycle_index_series()
            sage: g.coefficients(5)
            [p[],
             p[1],
             p[1, 1] + p[2],
             5/6*p[1, 1, 1] + 3/2*p[2, 1] + 2/3*p[3],
             5/8*p[1, 1, 1, 1] + 7/4*p[2, 1, 1] + 7/8*p[2, 2] + p[3, 1] + 3/4*p[4]]
        """
        ciset = SetSpecies().cycle_index_series(base_ring)
        CIS = ciset.parent()
        res = CIS.sum_generator(((1 / n) * ciset).stretch(n)
                                for n in _integers_from(ZZ(1))).exponential()
        if self.is_weighted():
            res *= self._weight
        return res