Skip to content

Automata

Automata on groups shared by the computer science packages.

The package holds the Cayley graph of a finitely generated group, the memory sets that cells on it read, the neighbourhood that moves with the value of a cell, and the visual that draws the graph.

CayleySpace(group, *, ball=None, fill=0.0, max_sites=MAX_SITES, label='space')

Bases: BaseSpace

A space whose sites are the elements of a group, joined by its generators.

A Cayley graph has one node per element of a group and an edge from g to g s for every generator s. The sites are the elements in a ball of words of length up to ball, numbered by word length and then by order of discovery, so a ball is a prefix of every larger ball. Without a ball the group must be finite, and the sites are all its elements. The group is a Sage PermutationGroup or MatrixGroup, or a GAP group from libgap, such as a free group, a finitely presented group, which KBMAG solves by Knuth-Bendix completion, or an automaton group.

A cell at the site g reads the site g s for every element s of a memory set, and a neighbour outside the ball reads the value fill. A StateTranslationNeighborhood reads the site g x(g) s, where x(g) is the group element that the cell holds as the number of its site.

Unlike LatticeSpace, which is the Cayley graph of the integers Z^d, it takes any finitely generated group, such as a free group whose graph is a tree. Choose it when cells live on the elements of a group.

It appears in mathematics and computer science, in cellular automata on groups and in symbolic dynamics, as in the book of Ceccherini-Silberstein and Coornaert.

Parameters:

Name Type Description Default
group object

The group.

required
ball int | None

The radius of the ball, or None for a finite group.

None
fill float

The value read outside a ball.

0.0
max_sites int

The largest number of sites.

MAX_SITES
label str

The name of the space in its system, such as 'grid'.

'space'

Attributes:

Name Type Description
generators_

The names of the generators, their GAP names when these are identifiers, or a, b, and so on.

words_

The shortest word of every site, in site order.

lengths_

The word length of every site, its distance from the identity in the Cayley graph.

ball_sizes_

The number of sites within every radius, from 0 to the radius of the ball or of the finite group.

generator_table_

The site of g s for every site g and letter s, in the order a, a^-1, b, b^-1, ..., and -1 outside.

edges_

The edge from every site g to g s for every generator s inside the space, with the generator's number.

level_

The level of the tree whose action keys the elements of an automaton group, or 0 for other groups.

Examples:

>>> from sage.all__sagemath_gap import PermutationGroup
>>> from skcomplex.systems.computer_science.common.automata import CayleySpace
>>> space = CayleySpace(PermutationGroup([[(1, 2)], [(1, 2, 3)]]), ball=3).prepare()
>>> space.size_, space.words_[:4], space.ball_sizes_
(6, ['1', 'a', 'b', 'b^-1'], [1, 4, 6, 6])
Source code in src/skcomplex/systems/computer_science/common/automata/_cayley.py
360
361
362
363
364
365
366
367
368
369
370
371
372
373
def __init__(
    self,
    group: object,
    *,
    ball: int | None = None,
    fill: float = 0.0,
    max_sites: int = MAX_SITES,
    label: str = 'space',
) -> None:
    super().__init__(label)
    self.group = group
    self.ball = ball
    self.fill = fill
    self.max_sites = max_sites

CayleyVisual(states=None, low=None, high=None, *, path=None, recording=None)

Bases: BaseVisual

A visual that logs every state of a lattice group on a group space as a graph.

The states are logged as the nodes of its Cayley graph. Sites sit on rings by word length, with one ring per radius and the identity at the centre, colored by state. Every chosen state is logged under <path>/<state> as GraphNodes at every frame, with the edges from every site g to g s for every generator s logged once as static GraphEdges.

Unlike SiteVisual, which draws the sites of a lattice or a network, it draws the words of a group on rings. Choose it for cells on a CayleySpace, which draws them with it by default.

It appears in mathematics and computer science, in pictures of cellular automata on free groups and on groups of automata.

Parameters:

Name Type Description Default
states Sequence[str] | None

The states to log, or None for every state.

None
low float | None

The value of the darkest color, or None for the smallest value of every frame.

None
high float | None

The value of the brightest color, or None for the largest value of every frame.

None
path str | None

The entity path of the element or agent group to draw, which also names it in the problem.

None
recording RecordingStream | None

The Rerun recording to log to, or None for the active recording of the thread.

None

Attributes:

Name Type Description
edges_

The entity paths whose static edges are logged.

Examples:

>>> from skcomplex.systems.computer_science.common.automata import CayleyVisual
>>> CayleyVisual(low=0, high=1)
CayleyVisual(high=1, low=0)
Source code in src/skcomplex/systems/computer_science/common/automata/_cayley.py
207
208
209
210
211
212
213
214
215
216
217
218
219
220
def __init__(
    self,
    states: Sequence[str] | None = None,
    low: float | None = None,
    high: float | None = None,
    *,
    path: str | None = None,
    recording: rr.RecordingStream | None = None,
) -> None:
    self.states = states
    self.low = low
    self.high = high
    self.path = path
    self.recording = recording

MemoryNeighborhood(elements, *, label='neighborhood')

Bases: BaseNeighborhood

A neighbourhood of the group elements whose values a cellular automaton reads.

The memory set is a list of elements of a group. A cell at the element g reads the cell at g s for every element s of the memory set, in its order, so the neighbourhood keeps its orientation. Elements are words in the generators, such as 'a', 'a^-1', or 'a*b', and '1' is the identity, the cell itself.

Unlike LatticeNeighborhood, whose offsets are integer vectors, it takes words of a group. Choose it when cells live on a CayleySpace.

It appears in mathematics and computer science, in cellular automata on free groups and on groups of automata.

Parameters:

Name Type Description Default
elements Sequence[str]

The words of the memory set.

required
label str

The name of the neighbourhood, such as 'moore'.

'neighborhood'

Attributes:

Name Type Description
elements_

The words of the memory set as strings.

Examples:

>>> from skcomplex.systems.computer_science.common.automata import MemoryNeighborhood
>>> MemoryNeighborhood(['1', 'a', 'a^-1']).prepare().elements_
('1', 'a', 'a^-1')
Source code in src/skcomplex/systems/computer_science/common/automata/_cayley.py
68
69
70
def __init__(self, elements: Sequence[str], *, label: str = 'neighborhood') -> None:
    super().__init__(label)
    self.elements = elements

StateTranslationNeighborhood(elements=(IDENTITY,), *, label='neighborhood')

Bases: BaseNeighborhood

A neighbourhood that moves with the value each cell of a group space holds.

The cell at g reads the cells at g x(g) s for every word s, where x(g) is the group element that the first read state holds at g, as the number of its site. The sites read move with the configuration, so on an infinite group the map has no finite memory set, as for x(g x(g)) of Ceccherini-Silberstein and Coornaert (2023, Example 1.8.2), which is continuous and equivariant but no cellular automaton. A run truncates it to a ball or a finite quotient, and a product outside the ball reads the fill value of the space.

Unlike MemoryNeighborhood, whose memory set is fixed, it shifts the memory set by the value of the cell. Choose it when studying maps on groups that are not cellular automata.

It appears in mathematics, in symbolic dynamics on groups, as the example of Ceccherini-Silberstein and Coornaert shows.

Parameters:

Name Type Description Default
elements Sequence[str]

The words s of the memory set after the translation, '1' for the translated site alone.

(IDENTITY,)
label str

The name of the neighbourhood, such as 'moore'.

'neighborhood'

Attributes:

Name Type Description
elements_

The words of the memory set as strings.

Examples:

>>> from skcomplex.systems.computer_science.common.automata import StateTranslationNeighborhood
>>> StateTranslationNeighborhood().prepare().elements_
('1',)
Source code in src/skcomplex/systems/computer_science/common/automata/_cayley.py
151
152
153
def __init__(self, elements: Sequence[str] = (IDENTITY,), *, label: str = 'neighborhood') -> None:
    super().__init__(label)
    self.elements = elements