Function Repository Resource:

TagSystemConvert

Source Notebook

Convert between compressed and uncompressed representations of tag system states

Contributed by: Wolfram Research

ResourceFunction["TagSystemConvert"][state]

switches the representation of state between uncompressed and compressed form, assuming that the first 3 elements are deleted at every step in the tag system's evolution.

ResourceFunction["TagSystemConvert"][state, len]

assumes that the first len elements are deleted at every step in the tag system's evolution.

Details and Options

The argument state should be given as a list.
The argument len should be given as a positive integer.
An uncompressed tag system state representation is a list of digits, such as {1,1,0,1,0,1,0}.
A compressed tag system state representation is a list of length two, where the first element is a digit and the second element is a list of digits, such as {2,{1,1,0}}. The compressed state specification depends on the len of the tag system. The first element is the phase of the state, or in other words, the remainder when the length of the uncompressed state is divided by len. The second element contains the elements at each position that is a multiple of len.
The default len is 3 because the Post tag system (000,11101) requires the first 3 elements to be dropped at every evolution step.
ResourceFunction["TagSystemConvert"] accepts one option:
"PaddingElement"_symbol used as a placeholder element in a decompressed tag system state

Examples

Basic Examples (2) 

Compress a state of a tag system in which the first 3 elements are dropped at every evolution step:

In[1]:=
ResourceFunction["TagSystemConvert"][{0, 0, 1, 1, 1, 0, 1, 1, 0}]
Out[1]=

Uncompress a state of a tag system in which the first 3 elements are dropped at every evolution step:

In[2]:=
ResourceFunction["TagSystemConvert"][{0, {0, 1, 1}}]
Out[2]=

Compress a state of a tag system in which the first 2 elements are dropped at every evolution step:

In[3]:=
ResourceFunction["TagSystemConvert"][{0, 0, 1, 1, 1, 0, 1, 1, 0}, 2]
Out[3]=

Uncompress a state of a tag system in which the first 2 elements are dropped at every evolution step:

In[4]:=
ResourceFunction["TagSystemConvert"][{1, {0, 1, 1, 1, 0}}, 2]
Out[4]=

Scope (2) 

Generate 5 possible uncompressed states from an uncompressed state of a tag system, assuming that the first 3 elements are dropped at every evolution step:

In[5]:=
Table[ResourceFunction["TagSystemConvert"][{0, {0, 1, 1}}] /. Verbatim[_] :> RandomChoice[{0, 1}], 5] // Column
Out[5]=

Uncompress the list of states generated by the compressed-state evolution of the Post tag system:

In[6]:=
ResourceFunction["TagSystemConvert"] /@ NestList[Replace[{{0, {0, s___}} -> {2, {s, 0}}, {0, {1, s___}} -> {1, {s, 1, 1}}, {1, {0, s___}} -> {0, {s}}, {1, {1, s___}} -> {2, {s, 0}}, {2, {0, s___}} -> {1, {s, 0}}, {2, {1, s___}} -> {0, {s, 1}}}], {2, {1, 0}}, 5]
Out[6]=

Options (3) 

PaddingElement (3) 

Specify the padding element for an uncompressed state of a tag system that drops 3 elements at each evolution step:

In[7]:=
ResourceFunction["TagSystemConvert"][{0, {0, 1, 1}}, "PaddingElement" -> 0]
Out[7]=

Note that the padding element can be any arbitrary symbol (though digits make the most sense for specifying the state of a tag system):

In[8]:=
ResourceFunction["TagSystemConvert"][{0, {0, 1, 1}}, "PaddingElement" -> a]
Out[8]=

Specify the padding element for an uncompressed state of a tag system that drops 2 elements at each evolution step:

In[9]:=
ResourceFunction["TagSystemConvert"][{1, {0, 1, 1, 1, 0}}, 2, "PaddingElement" -> 1]
Out[9]=

Version History

  • 1.0.2 – 18 March 2021
  • 1.0.1 – 15 March 2021
  • 1.0.0 – 09 March 2021

Related Resources

License Information