Skip to content

Commit

Permalink
move generators of stabilizer call inside the coset rep fn
Browse files Browse the repository at this point in the history
  • Loading branch information
bollu committed Oct 3, 2021
1 parent 4dcdccd commit 1238cb0
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions schrier-sims.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,15 @@ def stabilizer_coset_representatives_slow(gs: Set[Permutation], k: int, n:int) -
# However, the weird part is that THAT's NOT ENOUGH.
# Rather, we need the generators to be: < (gs * os).map(remove_defect) >
# For whatever reason, we must take all pairs of gs, os!
def generators_of_stabilizer(gs: List[Permutation], orb2rep: Dict[int, Permutation], k: int, n: int):
def generators_of_stabilizer(gs: List[Permutation], k: int, n: int):
purified = set()

# Create coset representatives
orb2rep = stabilizer_coset_representatives_slow(gs, k, n)

candidates = [g * rep for g in gs for rep in orb2rep.values()]


for h in candidates:
o = h(k) # find where h sends k | o ∈ Orb(k)
orep = orb2rep[o] # find coset representative corresponding to o
Expand Down Expand Up @@ -385,10 +390,8 @@ def test_generators_of_stabilizer(ps: List[Permutation], k:int):
H = generate_from_generators(ps) # exhaustive generate group
Stab = set([h for h in H if h(k) == k]) # exhaustively create stabilizer

# Create coset representatives
orb2rep = stabilizer_coset_representatives_slow(ps, k, N)

stab_gens = generators_of_stabilizer(ps, orb2rep, k, N)
stab_gens = generators_of_stabilizer(ps, k, N)
stab_generated = generate_from_generators(stab_gens)

assert Stab == stab_generated
Expand All @@ -412,13 +415,13 @@ def test_generators_for_sn(n: int):
assert len(G) == factorial(n+1) # [0..n]

# compute the schrier decomposition of <as_> = A inside Sn
# def schrier_decomposition(gs: List[Permutation], n: int) -> (List[Permutation], List[Permutation]):
# Ggens = [gs] # Gss[i]: List[int] = generators of G[i]. so G[0] = < gs > = < Ggens[0] > and so on.
#
# for k in range(n+1): # [0, n]
# gs_prev = Ggens[k]
# generators_of_stabilizer(gs_prev,
#
def schrier_decomposition(gs: List[Permutation], n: int) -> (List[Permutation], List[Permutation]):
Ggens = [gs] # Gss[i]: List[int] = generators of G[i]. so G[0] = < gs > = < Ggens[0] > and so on.

for k in range(n+1): # [0, n]
gs_prev = Ggens[k]
# generators_of_stabilizer(gs_prev,



def main():
Expand Down

0 comments on commit 1238cb0

Please sign in to comment.