Module garoupa.algebra.symmetric.s

Classes

class S (n, seed=None)
Expand source code
class S(Group):
    def __init__(self, n, seed=None):
        identity = Perm(0, n)
        sorted = lambda: (Perm(i, self.n) for i in range(identity.order))
        super().__init__(identity, sorted, seed)
        self.n = n

    @property
    def comm_degree(self):
        """Asymptotic commutativity degree (value is between Sn and An)"""
        num = exp(2 * pi * sqrt(self.n / 6))
        den = 4 * self.n * sqrt(3) * factorial(self.n)
        return num / den

    # def P442(self, p):
    #     """4-Property p-group"""
    #     num = p**(p-1) + p**2 - 1
    #     den = p**(p+1)
    #     return num / den

    def __iter__(self):
        while True:
            yield Perm(self.samplei(), self.n)

    def __repr__(self):
        return f"S{self.n}"

    def replace(self, *args, **kwargs):
        dic = {"n": self.n, "seed": self.seed}
        dic.update(kwargs)
        return self.__class__(**dic)

Ancestors

Instance variables

prop comm_degree
Expand source code
@property
def comm_degree(self):
    """Asymptotic commutativity degree (value is between Sn and An)"""
    num = exp(2 * pi * sqrt(self.n / 6))
    den = 4 * self.n * sqrt(3) * factorial(self.n)
    return num / den

Asymptotic commutativity degree (value is between Sn and An)

Methods

def replace(self, *args, **kwargs)
Expand source code
def replace(self, *args, **kwargs):
    dic = {"n": self.n, "seed": self.seed}
    dic.update(kwargs)
    return self.__class__(**dic)

Inherited members