Module garoupa.algebra.cyclic.zm
Classes
class Zm (n, seed=None)-
Expand source code
class Zm(Group): def __init__(self, n, seed=None): """ Usage: >>> G = Zm(1414343245, seed=0) >>> G.comm_degree 1 >>> G, ~G (Zm1414343245, 906691059) """ sorted = lambda: (Natm(i, n) for i in range(n)) super().__init__(Natm(1, n), sorted, seed) self.n = n @property def comm_degree(self): """Exact commutativity degree""" return 1 def __iter__(self): while True: yield Natm(self.samplei(), self.n) def __repr__(self): return f"Zm{self.n}" def replace(self, *args, **kwargs): """ Usage: >>> G = Zm(1414343245, seed=0) >>> ~G.replace(seed=1) 144272509 """ dic = {"n": self.n, "seed": self.seed} dic.update(kwargs) return self.__class__(**dic)Usage:
>>> G = Zm(1414343245, seed=0) >>> G.comm_degree 1 >>> G, ~G (Zm1414343245, 906691059)Ancestors
Instance variables
prop comm_degree-
Expand source code
@property def comm_degree(self): """Exact commutativity degree""" return 1Exact commutativity degree
Methods
def replace(self, *args, **kwargs)-
Expand source code
def replace(self, *args, **kwargs): """ Usage: >>> G = Zm(1414343245, seed=0) >>> ~G.replace(seed=1) 144272509 """ dic = {"n": self.n, "seed": self.seed} dic.update(kwargs) return self.__class__(**dic)Usage:
>>> G = Zm(1414343245, seed=0) >>> ~G.replace(seed=1) 144272509
Inherited members