def sum(ii=10, d=10): for i in range(ii): a = randrange(0, d) b = randrange(0, d) gg = R().permgroup(a) hh = R().permgroup(b) print(gg.sum(hh))
def intersection(ii = 10, a = 5, b = 5): for i in range(ii): print("=====================") c1 = R().permcoset(a) c2 = R().permcoset(b) print(c1) print(c2) print(c1.intersection(c2))
def gridFromseqinv(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) h = R().perm(randrange(0, d)) m = g.seq().gridFromseq(h.seq()) n = m.gridFromseqinv() print(g) print(h) print(m) print(n)
def prodinv(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) h = R().perm(randrange(0, d)) print("---") print(g) print(h) print(g.prod(h)) print(g.prod(h).prodinv()) assert(g.prod(h).prodinv() == g)
def prod(ii=10, d=10): for i in range(ii): a = randrange(0, d) b = randrange(0, d) gg = R().permgroup(a) hh = R().permgroup(b) print("---") print(gg) print(hh) print(gg.prod(hh))
def gridFromseq(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) h = R().perm(randrange(0, d)) print("---") print(g) print(h) print(g.seq()) print(h.seq()) print(g.seq().gridFromseq(h.seq()))
def mul(ii = 10, d = 10): for i in range(ii): a = randrange(0, d) b = randrange(0, d) g = R().perm(a) print("g is {}".format(g)) h = R().perm(b) print("h is {}".format(h)) m = g * h print("g * h is {}".format(m))
def eq(ii = 10, d = 10): for i in range(ii): g1 = R().perm(randrange(0, d)) g2 = R().perm(randrange(0, d)) g3 = R().perm(randrange(0, d)) m1 = g1 * g2 m2 = g2 * g3 print("----") print(m1 * g3) print(g1 * m2) assert(m1 * g3 == g1 * m2), "Associativity"
def grid(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) h = R().perm(randrange(0, d)) m = g.grid(h) n = m.gridinv_0() print("----") print(g) print(h) print(m) print(n)
def gridFromseq(ii=10, d=10): for i in range(ii): a = randrange(0, d) b = randrange(0, d) gg = R().permgroup(a) hh = R().permgroup(b) print("---") print(gg) print(gg.seq()) print(hh) print(hh.seq()) print(gg.seq().gridFromseq(hh.seq()))
def prod(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) h = R().perm(randrange(0, d)) print("---") print(g) g2 = g * g h2 = h * h print(h) print(g.prod(h)) print(g.prod(h) * g.prod(h)) print(g2.prod(h2)) assert(g.prod(h) * g.prod(h) == g2.prod(h2))
def seq(ii=10, d=10): for i in range(ii): a = randrange(0, d) gg = R().permgroup(a) print("---") print(gg) print(gg.seq())
def movedpt(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) p = randrange(0, d) print("---") print(g) print(g.movedpt())
def inv(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) print("---") print(g) print(g.inv()) print(g * g.inv()) assert(g * g.inv() == g.id() and g.inv() * g == g.id()), "Inverses"
def id(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) print("---") print(g) print(g.id()) print(g * g.id()) assert(g * g.id() == g and g.id() * g == g), "Identity"
def orbitstab(ii=10, d=10): for i in range(ii): a = randrange(1, d) b = randrange(0, a) gg = R().permgroup(a) print("----") print(gg) print(b) print(gg.orbitstab(b))
def SchStr(ii=10, d=10): for i in range(ii): a = randrange(1, d) b = randrange(0, a) gg = R().permgroup(a) print("----") print(gg) print(b) print(gg.SchStr(b))
def seqinv(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) print("---") print(g) h = g.seq() print(h) print(h.seqinv()) assert(g.seq().seqinv() == g)
def seq(ii = 10, d = 10): for i in range(ii): g = R().perm(randrange(0, d)) print("---") print(g) print(g.seq())