We need to tell SAGE about FlatSurf. Change the following to the directory of the FlatSurf source code.

{{{id=1| sys.path.append('/home/pat/active/talks/2016/Oaxaca-SAGE_Days/sage-flatsurf-master') /// }}}

Constructing the square:

{{{id=9| from flatsurf.geometry.polygon import Polygons /// }}}

The following is the parent for polygons with coordinates in the field K.

Remarks:

To construct a polygon, use the parent to build the parent. Passing a list of edge vectors will produce the polygon. The edge vectors must sum to zero.

{{{id=5| square = Polygons(QQ)([(1,0), (0, 1), (-1,0), (0, -1) ]) print(square) /// Polygon: (0, 0), (1, 0), (1, 1), (0, 1) }}}

Picture of the square with edge labels.

Defining the staircase

{{{id=47| from flatsurf.geometry.similarity_surface import TranslationSurface_generic /// }}} {{{id=19| class StaircaseSurface(TranslationSurface_generic): r"""The Staircase surface.""" def __init__(self): self._p=square self._field=QQ def base_ring(self): return QQ def polygon_labels(self): return ZZ def polygon(self, lab): return self._p def opposite_edge(self, p, e): if e==0 or e==2: if p%2==0: return p-1, (e+2)%4 else: return p+1, (e+2)%4 else: if p%2==0: return p+1, (e+2)%4 else: return p-1, (e+2)%4 def base_label(self): return ZZ(0) /// }}} {{{id=48| s = StaircaseSurface() /// }}} {{{id=24| gs = s.graphical_surface() /// }}} {{{id=49| gs.plot() /// }}} {{{id=52| gs.make_adjacent_and_visible(0,1) gs.make_adjacent_and_visible(1,2) /// }}} {{{id=58| gs.plot() /// }}} {{{id=50| gs = s.graphical_surface() for i in range(3): gs.make_adjacent_and_visible(2*i,1) gs.make_adjacent_and_visible(2*i+1,2) /// }}} {{{id=51| gs.plot() /// }}}

Straight-Line Flow

{{{id=63| from flatsurf.geometry.tangent_bundle import SimilaritySurfaceTangentBundle /// }}}

We will flow in a direction of slope given by the golden mean, phi. This builds a number field and defines phi.

{{{id=75| K. = NumberField(x**2-x-1, embedding=1.6) /// }}} {{{id=65| v=s.tangent_vector(4,(0,0),(1,phi),ring=K) /// }}} {{{id=67| traj=v.straight_line_trajectory() traj.flow(1000) /// }}} {{{id=68| from flatsurf.graphical.straight_line_trajectory import GraphicalStraightLineTrajectory /// }}} {{{id=69| gtraj = GraphicalStraightLineTrajectory(gs,traj) /// }}} {{{id=71| gs.plot()+gtraj.plot() /// }}} {{{id=74| K. = NumberField(x**2 - 2, embedding=1.4) v=s.tangent_vector(4,(0,0),(1,rt2),ring=K) /// }}} {{{id=76| traj = v.straight_line_trajectory() traj.flow(1000) /// }}} {{{id=77| gtraj = GraphicalStraightLineTrajectory(gs,traj) /// }}} {{{id=78| gs.plot()+gtraj.plot() /// }}}