"""Point symmetries of the dephased H_5, using integer exponents modulo 10.""" from collections import Counter from itertools import permutations, product from functools import lru_cache import numpy as np from catalogue import dephase, representative @lru_cache(None) def symmetries(): H=representative(); target=dephase(H) groups=[np.flatnonzero(target[1]==v) for v in np.unique(target[1])] found=[] for eps in (1,-1): A=eps*H for i,j in product(range(10),repeat=2): B=(A-A[i:i+1,:]-A[:,j:j+1]+A[i,j])%10 for second in B: sources=[np.flatnonzero(second==target[1,g[0]]) for g in groups] if [len(h) for h in sources]!=[len(g) for g in groups]:continue for choice in product(*(permutations(h) for h in sources)): col=np.empty(10,int) for g,h in zip(groups,choice):col[g]=h if col[0]!=j:continue rows={tuple(r):k for k,r in enumerate(B[:,col])} if all(tuple(r) in rows for r in target): row=tuple(rows[tuple(r)] for r in target) found.append((eps,row,tuple(col))) assert len(set(found))==len(found) return tuple(found) def indices(labels,transformation): return tuple(5*labels.index(h)+int(j%5) for z in labels for t in range(5) for h,j in [transformation(z,t)]) def generators(): r,c=(1,-1),(2,-2) def act(f): # Match projective labels modulo 5 to their chosen integer names. def to_permutation(L): return indices(L,lambda h,j: (next(a for a in L if (a-f(h,j)[0])%5==0),f(h,j)[1])) return to_permutation(r),to_permutation(c) return [act(f) for f in (lambda h,j:(h,j-2*h),lambda h,j:(h,j+1), lambda h,j:(-pow(h%5,-1,5),j*pow(h%5,-1,5)), lambda h,j:(-h,2*j))] def verify(): syms=symmetries() assert Counter(e for e,_,_ in syms)=={1:200,-1:200} G=generators();identity=(tuple(range(10)),)*2 def compose(a,b): return tuple(tuple(x[j] for j in y) for x,y in zip(a,b)) generated={identity}; todo=[identity] while todo: x=todo.pop() for y in G: z=compose(x,y) if z not in generated: generated.add(z);todo.append(z) assert generated=={(r,c) for e,r,c in syms if e==1} anti={(r,c) for e,r,c in syms if e==-1 and compose((r,c),(r,c))==identity} classes={} while anti: x=next(iter(anti)) orbit={compose(compose(g,x),tuple(tuple(np.argsort(t)) for t in g)) for g in generated} assert orbit<=anti anti-=orbit counts=tuple(sum(k==a for k,a in enumerate(v)) for v in x) classes[counts]=len(orbit) assert classes=={(0,0):10,(6,0):10,(0,6):10} print('Ordinary group 200; conjugating symmetries 200; involution classes:',classes) if __name__=='__main__':verify()