In[]:=
TSCF=FunctionCompile[Function[{Typed[init,TypeSpecifier["PackedArray"]["MachineInteger",1]],Typed[t,"Integer64"]},Module[{q=CreateDataStructure["Queue"],output},Scan[q["Push",#]&,init];Do[If[q["Length"]≥3,Scan[q["Push",#]&,If[q["Pop"]0,{0,0},{1,1,0,1}]];Do[q["Pop"],2]],t];Normal[q]]]];
In[]:=
TSPatternEvolve[init_,t_]:=With[{ru=Dispatch[{{0,_,_,s___}{s,0,0},{1,_,_,s___}{s,1,1,0,1}}]},Nest[Replace[#,ru]&,init,t]]
In[]:=
TSDirectEvolve[init_,t_]:=NestWhile[Join[Drop[#,3],{{0,0},{1,1,0,1}}[[1+First[#]]]]&,init,Length[#]≥3&,1,t]
In[]:=
TSDirectEvolveSequence[init_,t_]:=First[NestWhile[{Join[First[#],{{0,0},{1,1,0,1}}[[1+#[[1]][[#[[2]]]]]]],#[[2]]+3}&,{init,1},Length[First[#]]≥#[[2]]&,1,t]]
In[]:=
TSStep[init_]:=If[Length[init]≥3,Join[Drop[init,3],{{0,0},{1,1,0,1}}[[1+First[init]]]],init]
In[]:=
TSDirectEvolveList[init_,t_]:=NestWhileList[Join[Drop[#,3],{{0,0},{1,1,0,1}}[[1+First[#]]]]&,init,Length[#]≥3&,1,t]
In[]:=
TSCF[{0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0},10000];//Timing
Out[]=
{0.002278,Null}
In[]:=
TSPatternEvolve[{0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0},10000];//Timing
Out[]=
{0.034704,Null}
In[]:=
TSDirectEvolve[{0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0},10000];//Timing
Out[]=
{0.022859,Null}
In[]:=
TSQueueEvolve[{0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0},10000];//Timing
Out[]=
{0.043814,Null}
In[]:=
TSCF[{0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0},10^6];//Timing
Out[]=
{0.19836,Null}
In[]:=
TSPatternEvolve[{0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0},10^6];//Timing
Out[]=
{18.6186,Null}
In[]:=
TSDirectEvolve[{0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0},10^6];//Timing
Out[]=
{2.94695,Null}
In[]:=
TSQueueEvolve[{0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0},10^6];//Timing
Out[]=
{4.48201,Null}
In[]:=
TSInit[n_,p_]/;0<=p<3:=Join[Riffle[Rest[IntegerDigits[n,2]],Splice[{0,0}]],Table[0,p]]
In[]:=
TSInit[1,1]
Out[]=
{0}
In[]:=
TSAllInits[len_]:=Catenate[Table[Join[Riffle[#,Splice[{0,0}]],Table[0,p]],{p,0,2}]&/@Tuples[{1,0},len]]
In[]:=
TSAllInits[3]
Out[]=
{{1,0,0,1,0,0,1},{1,0,0,1,0,0,1,0},{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,0},{1,0,0,1,0,0,0,0},{1,0,0,1,0,0,0,0,0},{1,0,0,0,0,0,1},{1,0,0,0,0,0,1,0},{1,0,0,0,0,0,1,0,0},{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,1,1,1,0,1,0,0}};
Number of black cells etc.
Number of black cells etc.
STG
STG
Highlight the attractor nodes.......
Including absolutely all initial conditions......
Cycles
Cycles
What is the relation between the states in the different 6 cycles?
What is the relation between the states in the different 6 cycles?
Distribution of Halting Times
Distribution of Halting Times
Continuous-Tape Sequences
Continuous-Tape Sequences
Optimal Searches
Optimal Searches
Investigate just storing the “freeway on ramps”.....
Causal Graphs
Causal Graphs
At each step, the head of the ribbon is connected to the current tail.