# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Obtain an annotated state transition graph for any CellularAutomaton rule

Contributed by:
Brad Klee

ResourceFunction["CATransducerGraph"][ returns a directed adjacency graph over |

The process of updating one row of a CellularAutomaton to the next requires the specification of a *rule* and a procedure for scanning through blocks of the input row. Once the transition function is named, this process is well described by a Moore Machine, which is a type of Finite State Transducer (FST).

ResourceFunction["CATransducerGraph"] accepts an option "Shift" whose default value Right can be changed to Left. Respectively, these option values determine if the FST transition function should read blocks of the input tape sequentially from Left to Right or vice versa. For asymmetric rules such as the Elementary Cellular Automaton (ECA) 30, a putatively better result can be obtained when reading from Right to Left by setting "Shift” → Left.

Each shift from one state to the next drops a value from either the left or right side and adds a new value on the opposite side. Added values are annotated on edges while removed values are annotated on vertices. These values can be accessed and extracted using AnnotationValue.

ResourceFunction["CATransducerGraph"] accepts an option "VertexFigures" which automates stylish embellishment. If set to Automatic, the vertices are colored by their annotation values. If set to True, vertices depict the input-output rule as in RulePlot.

ResourceFunction["CATransducerGraph"] accepts either ColorRules or ColorFunction for finer control of automated vertex styling.

ResourceFunction["CATransducerGraph"] also accepts any of the typical Graph options.

The expression *k*^{(k2r+1)} grows extremely rapidly with *k*. Be aware that higher *k* values may lead to unacceptably long calculation time.

The CATransducerGraph for Rule 86:

In[1]:= |

Out[1]= |

Obtain the definition of rule 86 from Annotation data:

In[2]:= |

Out[2]= |

Prove that rule 86 allows any bit vector in its range of outputs:

In[3]:= |

Out[3]= |

Map a two-state CA with CATransducerGraph over different radius values:

In[4]:= |

Out[4]= |

Color a CATransducerGraph according to its Annotation data:

In[5]:= |

Out[5]= |

Map a three-state with CATransducerGraph over different radius values:

In[6]:= |

Out[6]= |

Obtain the CATransducerGraph for a totalistic rule:

In[7]:= |

Out[7]= |

Color vertices according to the transduced output value:

In[8]:= |

Out[8]= |

Show fragments of input and output tapes:

In[9]:= |

Out[9]= |

Compare left-shift and right-shift graphs for rule 30:

In[10]:= |

Out[10]= |

One graph has uniform outputs, the other does not:

In[11]:= |

Out[11]= |

Highlight where the right-shift graph fails to provide alternatives for the next transduced value:

In[12]:= |

Out[12]= |

Add vertex figures to the CATransducerGraph of a random four-color CellularAutomaton:

In[13]:= |

Out[13]= |

Prove that a certain length-36 bit vector can not exist in a totalistic CA using rule 10:

In[14]:= |

Out[14]= |

Given a random bit vector, list possible pre-images under rule 165:

In[15]:= |

Out[15]= |

The structure of CATransducerGraph does not depend on choice of *rule*:

In[16]:= |

Out[16]= |

However, different rules have different Annotation values:

In[17]:= |

Out[17]= |

Obtain a list of "multiway-invertible" elementary cellular automata:

In[18]:= |

Out[18]= |

Depict the results evolving from random periodic initial conditions:

In[19]:= |

Out[19]= |

Wolfram Language 13.0 (December 2021) or above

- 1.0.0 – 07 June 2024

This work is licensed under a Creative Commons Attribution 4.0 International License