# # This code defines functions for association schemes and homogeneous # coherent configurations. # # We use two representations: # As a list of adjacency matrices (with the identity first, by convention) # Compact form: a single matrix whose (i,j) entry is the number of the class # containing (i,j) (numbers start at 0 for the diagonal). # The data given by Hanaki and Miuamoto is in compact form, but the # data used and produced by "asfns.g" is in list form. # # The functions are: # Conversions: CompactToList and ListToCompact # AutGpList(l) - return the automorphism group of the list l # IsSchurian(l) - returns true iff the list l is a Schurian coherent config. # IsSymmetric(l) - returns true iff all matrices in l are symmetric # # We need GRAPE for the IsSchurian test. RequirePackage("grape"); # turn the compact representation of a partition into a list of matrices CompactToList:=function(m) local n,s,l,i,j,k,x; l:=[]; n:=Length(m); s:=Maximum(Flat(m)); for k in [0..s] do x:=NullMat(n,n); for i in [1..n] do for j in [1..n] do if m[i][j]=k then x[i][j]:=1; fi; od; od; Add(l,x); od; return(l); end; # turn a list of matrices into compact representation ListToCompact:=function(l) local m,n,k; n:=Length(l[1]); m:=NullMat(n,n); for k in [1..Length(l)] do m:=m+(k-1)*l[k]; od; return(m); end; # Turn an adjacency matrix into a GRAPE graph MatToGraph:=function(a) local n; n:=Length(a); return Graph(Group(()), [1..n], OnPoints, function(x,y) return a[x][y]=1; end); end; # now find the automorphism group of a c.c. in list form AutGpList:=function(l) local n,a,g; n:=Length(l[1]); g:=SymmetricGroup(n); for a in l do g:=Intersection(g,AutomorphismGroup(MatToGraph(a))); od; return g; end; # test whether a c.c. is Schurian IsSchurian:=function(l) local g,n; g:=AutGpList(l); if not IsTransitive(g) then return false; fi; n:=LargestMovedPoint(g); return (Length(Orbits(Stabilizer(g,1),[1..n]))=Length(l)); end; # test whether a list of matrices is symmetric IsSymmetric:=function(l) local x; for x in l do if x<>TransposedMat(x) then return false; fi; od; return true; end;