What is the analog of internal automorphism for strings?
What is the analog of internal automorphism for strings?
In[]:=
StringAutomorphism[s_]:=((First/@StringPosition[s,#])&/@Union[Characters[s]])
In[]:=
StringAutomorphism["AAABB"]
Out[]=
{{1,2,3},{4,5}}
stringAutomorphism[str_String]:=PermutationGroup[PermutationCycles/@Map[Last,Sort/@Catenate/@Map[Thread,Tuples[Function[permutations,permutations[[1]]#&/@permutations]/@Permutations/@(First/@StringPosition[#][str]&/@Union@Characters@str)],{2}],{2}]]
In[]:=
stringAutomorphism["AABB"]
Out[]=
PermutationGroup[{Cycles[{}],Cycles[{{3,4}}],Cycles[{{1,2}}],Cycles[{{1,2},{3,4}}]}]
In[]:=
stringAutomorphism["ABAABB"]
Out[]=
In[]:=
GroupGenerators[stringAutomorphism["ABAABB"]]
Out[]=
String rule whose LHS has an automorphism (and RHS is more symmetric than LHS)
In[]:=
EnumerateSubstitutionSystemRules[{22,22},2]
Out[]=
In[]:=
WeaklyConnectedGraphComponents[MultiwaySystem[#,StringTuples["AB",4],4,"StatesGraph"]]&/@{{"AA""BB","AB""BA"},{"AA""BB","BB""AA"},{"AB""AA","BB""BA"}}
Out[]=
In[]:=
WeaklyConnectedGraphComponents[MultiwaySystem[#,StringTuples["AB",5],5,"StatesGraph"]]&/@{{"AA""BB","AB""BA"},{"AA""BB","BB""AA"},{"AB""AA","BB""BA"}}
Out[]=
[[ Maybe the first one is #Bs even in case 1, odd in case 2 ]]
What is the internal automorphism for hypergraphs?
What is the internal automorphism for hypergraphs?
{{1,2,3},{1,2,3}}{{4,1,3},{1,5,2},{3,2,6}}