Skip to content

Commit

Permalink
Refactor automaton construction
Browse files Browse the repository at this point in the history
We implement a generic Automaton.run() that performs (a
possibly bounded) number of steps of a DFS. Currently,
there are two concrete implementations : CoreAutomaton
and ReducedCoreAutomaton.
  • Loading branch information
videlec committed Jul 18, 2023
1 parent 8fa944a commit 49a5ac8
Show file tree
Hide file tree
Showing 5 changed files with 373 additions and 219 deletions.
8 changes: 4 additions & 4 deletions doc/source/veerer_demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ from `T_i` by a flip.

sage: # T0 was the torus example
sage: from veerer import CoreAutomaton
sage: A0 = CoreAutomaton.from_triangulation(T0)
sage: A0 = CoreAutomaton(T0)
sage: A0
Core veering automaton with 2 vertices

Expand All @@ -275,7 +275,7 @@ from `T_i` by a flip.
::

sage: # T1 was the genus 2 example in H(2)
sage: A1 = CoreAutomaton.from_triangulation(T1)
sage: A1 = CoreAutomaton(T1)

::

Expand All @@ -289,7 +289,7 @@ from `T_i` by a flip.
::

sage: # T2 was the genus 1 example in Q(1^2, -1^2)
sage: A2 = CoreAutomaton.from_triangulation(T2)
sage: A2 = CoreAutomaton(T2)
sage: print(A2.num_states(), A2.num_transitions())
1074 3620
sage: print(A2.num_geometric_triangulations())
Expand Down Expand Up @@ -332,7 +332,7 @@ filtering cylindrical (single test is cheap) ~2 sec for H(4)^hyp

sage: H = AbelianStratum(4).hyperelliptic_component() # optional - surface_dynamics
sage: V = VeeringTriangulation.from_stratum(H) # optional - surface_dynamics
sage: AV = CoreAutomaton.from_triangulation(V) # long time - ~21 secs # optional - surface_dynamics
sage: AV = CoreAutomaton(V) # long time - ~21 secs # optional - surface_dynamics
sage: print(AV.num_states()) # long time - ~150 µs # optional - surface_dynamics
9116
sage: print(AV.num_geometric_triangulations()) # long time - ~21 secs # optional - surface_dynamics
Expand Down
2 changes: 1 addition & 1 deletion veerer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .triangulation import Triangulation
from .cover import TriangulationCover
from .veering_triangulation import VeeringTriangulation, VeeringTriangulations
from .automaton import CoreAutomaton
from .automaton import CoreAutomaton, ReducedCoreAutomaton
from .flip_sequence import VeeringFlipSequence

from .env import sage
Expand Down
Loading

0 comments on commit 49a5ac8

Please sign in to comment.