Function Repository Resource:

ReversibleCellularAutomaton

Source Notebook

Generate the evolution of a reversible cellular automaton

Contributed by: Wolfram Staff

ResourceFunction["ReversibleCellularAutomaton"][rule,init,t]

generates a list representing the evolution of the reversible cellular automaton with the specified rule from initial condition init for t steps.

ResourceFunction["ReversibleCellularAutomaton"][rule,init]

gives the result of evolving init for one step.

ResourceFunction["ReversibleCellularAutomaton"][rule]

is an operator form of ResourceFunction["ReversibleCellularAutomaton"] that represents one step of evolution.

Details

rule is taken to be an integer between 0 and 255, representing a reversible cellular automaton with 2 colors and range 1.
init is taken to be a list of two vectors of the same length with entries equal to 0 or 1.
The two initial conditions are considered to be steps 0 and 1.
ResourceFunction["ReversibleCellularAutomaton"][rule][init] is equivalent to ResourceFunction["ReversibleCellularAutomaton"][rule,init].

Examples

Basic Examples (2) 

Run rule 30R for three steps:

In[1]:=
ResourceFunction[
 "ReversibleCellularAutomaton"][30, {{0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}}, 3]
Out[1]=

Visualize the evolution of rule 30R:

In[2]:=
ArrayPlot[
 ResourceFunction["ReversibleCellularAutomaton"][30, ConstantArray[CenterArray[{1}, 63], 2], 31]]
Out[2]=

Scope (2) 

Give the result of one step of rule 13R evolution:

In[3]:=
ResourceFunction[
 "ReversibleCellularAutomaton"][13, {UnitVector[15, 1], CenterArray[{1}, 15]}]
Out[3]=

An alternative form:

In[4]:=
ResourceFunction["ReversibleCellularAutomaton"][
  13][{UnitVector[15, 1], CenterArray[{1}, 15]}]
Out[4]=

Neat Examples (1) 

Visualize the evolution of rule 90R with random initial conditions:

In[5]:=
ArrayPlot[
 ResourceFunction["ReversibleCellularAutomaton"][
  90, {RandomInteger[1, 200], RandomInteger[1, 200]}, 110]]
Out[5]=

Version History

  • 1.0.0 – 31 August 2021

Related Resources

License Information