similarity_surface_generators

Initialize self. See help(type(self)) for accurate signature.

class flatsurf.geometry.similarity_surface_generators.DilationSurfaceGenerators[source]
static basic_dilation_torus(a)[source]

Return a dilation torus built from a \(1 \times 1\) square and a \(a \times 1\) rectangle. Each edge of the square is glued to the opposite edge of the rectangle. This results in horizontal edges glued by a dilation with a scaling factor of a, and vertical edges being glued by translation:

    b       a
  +----+---------+
  | 0  | 1       |
c |    |         | c
  +----+---------+
    a       b

EXAMPLES:

sage: from flatsurf import dilation_surfaces
sage: ds = dilation_surfaces.basic_dilation_torus(AA(sqrt(2)))
sage: ds
Genus 1 Positive Dilation Surface built from a square and a rectangle
sage: from flatsurf.geometry.categories import DilationSurfaces
sage: ds in DilationSurfaces().Positive()
True
sage: TestSuite(ds).run()
static genus_two_square(a, b, c, d)[source]

A genus two dilation surface is returned.

The unit square is made into an octagon by marking a point on each of its edges. Then opposite sides of this octagon are glued together by translation. (Since we currently require strictly convex polygons, we subdivide the square into a hexagon and two triangles as depicted below.) The parameters a, b, c, and d should be real numbers strictly between zero and one. These represent the lengths of an edge of the resulting octagon, as below:

        c
  +--+-------+
d |2/        |
  |/         |
  +    0     +
  |         /|
  |        /1| b
  +-------+--+
     a

The other edges will have length \(1-a\), \(1-b\), \(1-c\), and \(1-d\). Dilations used to glue edges will be by factors \(c/a\), \(d/b\), \((1-c)/(1-a)\) and \((1-d)/(1-b)\).

EXAMPLES:

sage: from flatsurf import dilation_surfaces
sage: ds = dilation_surfaces.genus_two_square(1/2, 1/3, 1/4, 1/5)
sage: ds
Genus 2 Positive Dilation Surface built from 2 right triangles and a hexagon
sage: from flatsurf.geometry.categories import DilationSurfaces
sage: ds in DilationSurfaces().Positive()
True
sage: TestSuite(ds).run()
class flatsurf.geometry.similarity_surface_generators.EInfinitySurface(lambda_squared=None, field=None)[source]

The surface based on the \(E_\infinity\) graph.

The biparite graph is shown below, with edges numbered:

  0   1   2  -2   3  -3   4  -4
*---o---*---o---*---o---*---o---*...
        |
        |-1
        o

Here, black vertices are colored *, and white o. Black nodes represent vertical cylinders and white nodes represent horizontal cylinders.

get_black(n)[source]

Get the weight of the black endpoint of edge n.

get_white(n)[source]

Get the weight of the white endpoint of edge n.

is_compact()[source]

Return whether this surface is compact as a topological space, i.e., return False.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_compact().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.e_infinity_surface()
sage: S.is_compact()
False
is_mutable()[source]

Return whether this surface is mutable, i.e., return False.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_mutable().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.e_infinity_surface()
sage: S.is_mutable()
False
labels()[source]

Return the labels of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.labels().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.e_infinity_surface()
sage: S.labels()
(0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7, 8, …)
opposite_edge(p, e)[source]

Return the pair (pp,ee) to which the edge (p,e) is glued to.

polygon(lab)[source]

Return the polygon labeled by lab.

roots()[source]

Return root labels for the polygons forming the connected components of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.roots().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.e_infinity_surface()
sage: S.roots()
(0,)
class flatsurf.geometry.similarity_surface_generators.HalfTranslationSurfaceGenerators[source]
static step_billiard(w, h)[source]

Return a (finite) step billiard associated to the given widths w and heights h.

EXAMPLES:

sage: from flatsurf import half_translation_surfaces
sage: S = half_translation_surfaces.step_billiard([1,1,1,1], [1,1/2,1/3,1/5])
sage: S
StepBilliard(w=[1, 1, 1, 1], h=[1, 1/2, 1/3, 1/5])
sage: from flatsurf.geometry.categories import DilationSurfaces
sage: S in DilationSurfaces()
True
sage: TestSuite(S).run()
class flatsurf.geometry.similarity_surface_generators.SimilaritySurfaceGenerators[source]

Examples of similarity surfaces.

static billiard(P, rational=None)[source]

Return the ConeSurface associated to the billiard in the polygon P.

INPUT:

  • P – a polygon

  • rational – a boolean or None (default: None) – whether to assume that all the angles of P are a rational multiple of π.

EXAMPLES:

sage: from flatsurf import Polygon, similarity_surfaces

sage: P = Polygon(vertices=[(0,0), (1,0), (0,1)])
sage: Q = similarity_surfaces.billiard(P, rational=True)
doctest:warning
...
UserWarning: the rational keyword argument of billiard() has been deprecated and will be removed in a future version of sage-flatsurf; rationality checking is now faster so this is not needed anymore
sage: Q
Genus 0 Rational Cone Surface built from 2 isosceles triangles
sage: from flatsurf.geometry.categories import ConeSurfaces
sage: Q in ConeSurfaces().Rational()
True
sage: M = Q.minimal_cover(cover_type="translation")
sage: M
Minimal Translation Cover of Genus 0 Rational Cone Surface built from 2 isosceles triangles
sage: TestSuite(M).run()
sage: from flatsurf.geometry.categories import TranslationSurfaces
sage: M in TranslationSurfaces()
True

A non-convex examples (L-shape polygon):

sage: P = Polygon(vertices=[(0,0), (2,0), (2,1), (1,1), (1,2), (0,2)])
sage: Q = similarity_surfaces.billiard(P)
sage: TestSuite(Q).run()
sage: M = Q.minimal_cover(cover_type="translation")
sage: TestSuite(M).run()
sage: M.stratum()
H_2(2, 0^5)

A quadrilateral from Eskin-McMullen-Mukamel-Wright:

sage: from flatsurf import Polygon
sage: P = Polygon(angles=(1, 1, 1, 7))
sage: S = similarity_surfaces.billiard(P)
sage: TestSuite(S).run()
sage: S = S.minimal_cover(cover_type="translation")
sage: TestSuite(S).run()
sage: S = S.erase_marked_points() # optional: pyflatsurf
sage: TestSuite(S).run()
sage: S, _ = S.normalized_coordinates()
sage: TestSuite(S).run()

Unfolding a triangle with non-algebraic lengths:

sage: from flatsurf import EuclideanPolygonsWithAngles
sage: E = EuclideanPolygonsWithAngles((3, 3, 5))
sage: from pyexactreal import ExactReals # optional: pyexactreal
sage: R = ExactReals(E.base_ring()) # optional: pyexactreal
sage: angles = (3, 3, 5)
sage: slopes = EuclideanPolygonsWithAngles(*angles).slopes()
sage: P = Polygon(angles=angles, edges=[R.random_element() * slopes[0]])  # optional: pyexactreal
sage: S = similarity_surfaces.billiard(P); S # optional: pyexactreal
Genus 0 Rational Cone Surface built from 2 isosceles triangles
sage: TestSuite(S).run() # long time (6s), optional: pyexactreal
sage: from flatsurf.geometry.categories import ConeSurfaces
sage: S in ConeSurfaces()
True
static example()[source]

Construct a SimilaritySurface from a pair of triangles.

EXAMPLES:

sage: from flatsurf import similarity_surfaces
sage: ex = similarity_surfaces.example()
sage: ex
Genus 1 Surface built from 2 isosceles triangles
static polygon_double(P)[source]

Return the ConeSurface associated to the billiard in the polygon P. Differs from billiard(P) only in the graphical display. Here, we display the polygons separately.

static right_angle_triangle(w, h)[source]
static self_glued_polygon(P)[source]

Return the HalfTranslationSurface formed by gluing all edges of P to themselves.

EXAMPLES:

sage: from flatsurf import Polygon, similarity_surfaces
sage: p = Polygon(edges=[(2,0),(-1,3),(-1,-3)])
sage: s = similarity_surfaces.self_glued_polygon(p)
sage: s
Half-Translation Surface in Q_0(-1^4) built from an isosceles triangle
sage: TestSuite(s).run()
class flatsurf.geometry.similarity_surface_generators.TFractalSurface(w=1, r=2, h1=1, h2=1)[source]

The TFractal surface.

The TFractal surface is a translation surface of finite area built from infinitely many polygons. The basic building block is the following polygon:

 w/r    w     w/r
+---+------+---+
| 1 |   2  | 3 | h2
+---+------+---+
    |   0  | h1
    +------+
        w

where w, h1, h2, r are some positive numbers. Default values are w=h1=h2=1 and r=2.

is_mutable()[source]

Return whether this surface is mutable, i.e., return False.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_mutable().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.t_fractal()
sage: S.is_mutable()
False
labels()[source]

Return the labels of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.labels().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.t_fractal()
sage: S.labels()
((word: , 0), (word: , 2), (word: , 3), (word: , 1), (word: R, 2), (word: R, 0), (word: L, 2), (word: L, 0), (word: R, 3), (word: R, 1), (word: L, 3), (word: L, 1), (word: RR, 2), (word: RR, 0), (word: RL, 2), (word: RL, 0), …)
opposite_edge(p, e)[source]

Labeling of polygons:

 wl,0             wr,0
+-----+---------+------+
|     |         |      |
| w,1 |   w,2   |  w,3 |
|     |         |      |
+-----+---------+------+
      |         |
      |   w,0   |
      |         |
      +---------+
           w

and we always have: bot->0, right->1, top->2, left->3

EXAMPLES:

sage: import flatsurf.geometry.similarity_surface_generators as sfg
sage: T = sfg.tfractal_surface()
sage: W = T._words
sage: w = W('LLRLRL')
sage: T.opposite_edge((w,0),0)
((word: LLRLR, 1), 2)
sage: T.opposite_edge((w,0),1)
((word: LLRLRL, 0), 3)
sage: T.opposite_edge((w,0),2)
((word: LLRLRL, 2), 0)
sage: T.opposite_edge((w,0),3)
((word: LLRLRL, 0), 1)
polygon(lab)[source]

Return the polygon with label lab:

 w/r         w/r
+---+------+---+
| 1 |  2   | 3 |
|   |      |   |  h2
+---+------+---+
    |  0   | h1
    +------+
    w

EXAMPLES:

sage: import flatsurf.geometry.similarity_surface_generators as sfg
sage: T = sfg.tfractal_surface()
sage: T.polygon(('L',0))
Polygon(vertices=[(0, 0), (1/2, 0), (1/2, 1/2), (0, 1/2)])
sage: T.polygon(('LRL',0))
Polygon(vertices=[(0, 0), (1/8, 0), (1/8, 1/8), (0, 1/8)])
roots()[source]

Return root labels for the polygons forming the connected components of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.roots().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.t_fractal()
sage: S.roots()
((word: , 0),)
class flatsurf.geometry.similarity_surface_generators.TranslationSurfaceGenerators[source]

Common and less common translation surfaces.

static arnoux_yoccoz(genus)[source]

Construct the Arnoux-Yoccoz surface of genus 3 or greater.

This presentation of the surface follows Section 2.3 of Joshua P. Bowman’s paper “The Complete Family of Arnoux-Yoccoz Surfaces.”

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: s = translation_surfaces.arnoux_yoccoz(4)
sage: s
Translation Surface in H_4(3^2) built from 16 triangles
sage: TestSuite(s).run()
sage: s.is_delaunay_decomposed()
True
sage: s = s.canonicalize()
sage: s
Translation Surface in H_4(3^2) built from 16 triangles
sage: field=s.base_ring()
sage: a = field.gen()
sage: from sage.matrix.constructor import Matrix
sage: m = Matrix([[a,0],[0,~a]])
sage: ss = m*s
sage: ss = ss.canonicalize()
sage: s.cmp(ss) == 0
True

The Arnoux-Yoccoz pseudo-Anosov are known to have (minimal) invariant foliations with SAF=0:

sage: S3 = translation_surfaces.arnoux_yoccoz(3)
sage: Jxx, Jyy, Jxy = S3.j_invariant()
sage: Jxx.is_zero() and Jyy.is_zero()
True
sage: Jxy
[ 0  2  0]
[ 2 -2  0]
[ 0  0  2]

sage: S4 = translation_surfaces.arnoux_yoccoz(4)
sage: Jxx, Jyy, Jxy = S4.j_invariant()
sage: Jxx.is_zero() and Jyy.is_zero()
True
sage: Jxy
[ 0  2  0  0]
[ 2 -2  0  0]
[ 0  0  2  2]
[ 0  0  2  0]
static cathedral(a, b)[source]

Return the cathedral surface with parameters a and b.

For any parameter a and b, the cathedral surface belongs to the so-called Gothic locus described in McMullen, Mukamel, Wright “Cubic curves and totally geodesic subvarieties of moduli space” (2017):

         1
       <--->

        /\           2a
       /  \      +------+
   a  b|   | a  /        \
 +----+    +---+          +
 |    |    |   |          |
1| P0 |P1  |P2 |  P3      |
 |    |    |   |          |
 +----+    +---+          +
     b|    |    \        /
       \  /      +------+
        \/

If a and b satisfies

\[a = x + y \sqrt(d) \qquad b = -3x -3/2 + 3y \sqrt(d)\]

for some rational x,y and d >= 0 then it is a Teichmüller curve.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: C = translation_surfaces.cathedral(1,2)
sage: C
Translation Surface in H_4(2^3) built from 2 squares, a hexagon with 4 marked vertices and an octagon
sage: TestSuite(C).run()

sage: from pyexactreal import ExactReals # optional: pyexactreal
sage: K = QuadraticField(5, embedding=AA(5).sqrt())
sage: R = ExactReals(K) # optional: pyexactreal
sage: C = translation_surfaces.cathedral(K.gen(), R.random_element([0.1, 0.2])) # optional: pyexactreal
sage: C  # optional: pyexactreal
Translation Surface in H_4(2^3) built from 2 rectangles, a hexagon with 4 marked vertices and an octagon
sage: C.stratum() # optional: pyexactreal
H_4(2^3)
sage: TestSuite(C).run() # long time (6s), optional: pyexactreal
static chamanara(alpha)[source]

Return the Chamanara surface with parameter alpha.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: C = translation_surfaces.chamanara(1/2)
sage: C
Minimal Translation Cover of Chamanara surface with parameter 1/2
static e_infinity_surface(lambda_squared=None, field=None)[source]

The translation surface based on the \(E_\infinity\) graph.

The biparite graph is shown below, with edges numbered:

  0   1   2  -2   3  -3   4  -4
*---o---*---o---*---o---*---o---*...
        |
        |-1
        o

Here, black vertices are colored *, and white o. Black nodes represent vertical cylinders and white nodes represent horizontal cylinders.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: s = translation_surfaces.e_infinity_surface()
sage: TestSuite(s).run()  # long time (1s)
static from_flipper(h)[source]

Build a (half-)translation surface from a flipper pseudo-Anosov.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: import flipper                             # optional - flipper

A torus example:

sage: t1 = (0r,1r,2r)                            # optional - flipper
sage: t2 = (~0r,~1r,~2r)                         # optional - flipper
sage: T = flipper.create_triangulation([t1,t2])  # optional - flipper
sage: L1 = T.lamination([1r,0r,1r])              # optional - flipper
sage: L2 = T.lamination([0r,1r,1r])              # optional - flipper
sage: h1 = L1.encode_twist()                     # optional - flipper
sage: h2 = L2.encode_twist()                     # optional - flipper
sage: h = h1*h2^(-1r)                            # optional - flipper
sage: f = h.flat_structure()                     # optional - flipper
sage: ts = translation_surfaces.from_flipper(h)  # optional - flipper
sage: ts                                         # optional - flipper; computation of the stratum fails here, see #227
Half-Translation Surface built from 2 triangles
sage: TestSuite(ts).run()                        # optional - flipper
sage: from flatsurf.geometry.categories import HalfTranslationSurfaces  # optional: flipper
sage: ts in HalfTranslationSurfaces()  # optional: flipper
True

A non-orientable example:

sage: T = flipper.load('SB_4')                   # optional - flipper
sage: h = T.mapping_class('s_0S_1s_2S_3s_1S_2')  # optional - flipper
sage: h.is_pseudo_anosov()                       # optional - flipper
True
sage: S = translation_surfaces.from_flipper(h)   # optional - flipper
sage: TestSuite(S).run()                         # optional - flipper
sage: len(S.polygons())                          # optional - flipper
4
sage: from flatsurf.geometry.similarity_surface_generators import flipper_nf_element_to_sage
sage: a = flipper_nf_element_to_sage(h.dilatation())  # optional - flipper
static infinite_staircase()[source]

Return the infinite staircase built as an origami.

EXAMPLES:

sage: from flatsurf import translation_surfaces

sage: S = translation_surfaces.infinite_staircase()
sage: S
The infinite staircase
sage: TestSuite(S).run()
static lanneau_nguyen_genus3_prototype(w, h, t, e)[source]

Return the Lanneau–Ngyuen prototype in the stratum H(4) with parameters w, h, t, and e.

The associated discriminant is \(e^2 + 8 wh\).

INPUT:

  • w – a positive integer

  • h – a positive integer

  • t – a non-negative integer strictly less than the gcd of w and h

  • e – an integer strictly less than w - 2h

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: T = translation_surfaces.lanneau_nguyen_genus3_prototype(2,1,0,-1)
sage: T.stratum()
H_3(4)

REFERENCES:

  • Erwan Lanneau, and Duc-Manh Nguyen, “Teichmüller curves generated by Weierstrass Prym eigenforms in genus 3 and genus 4”, Journal of Topology 7.2, 2014, pp.475-522

static lanneau_nguyen_genus4_prototype(w, h, t, e)[source]

Return the Lanneau–Ngyuen prototype in the stratum H(6) with parameters w, h, t, and e.

The associated discriminant is \(D = e^2 + 4 wh\).

INPUT:

  • w – a positive integer

  • h – a positive integer

  • t – a non-negative integer strictly smaller than the gcd of w and h

  • e – a positive integer strictly smaller than \(2w - \sqrt{D}\)

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: T = translation_surfaces.lanneau_nguyen_genus4_prototype(1,1,0,-2)
sage: T.stratum()
H_4(6)

REFERENCES:

  • Erwan Lanneau, and Duc-Manh Nguyen, “Weierstrass Prym eigenforms in genus four”, Journal of the Institute of Mathematics of Jussieu, 19.6, 2020, pp.2045-2085

static mcmullen_L(l1, l2, l3, l4)[source]

Return McMullen’s L shaped surface with parameters l1, l2, l3, l4.

Polygon labels and lengths are marked below:

+-----+
|     |
|  1  |l1
|     |
|     |    l4
+-----+---------+
|     |         |
|  0  |    2    |l2
|     |         |
+-----+---------+
  l3

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: s = translation_surfaces.mcmullen_L(1,1,1,1)
sage: s
Translation Surface in H_2(2) built from 3 squares
sage: TestSuite(s).run()
static mcmullen_genus2_prototype(w, h, t, e, rel=0, base_ring=None)[source]

McMullen prototypes in the stratum H(2).

These prototype appear at least in McMullen “Teichmüller curves in genus two: Discriminant and spin” (2004). The notation from that paper are quadruple (a, b, c, e) which translates in our notation as w = b, h = c, t = a (and e = e).

The associated discriminant is \(D = e^2 + 4 wh\).

If rel is a positive parameter (less than w-lambda) the surface belongs to the eigenform locus in H(1,1).

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: from surface_dynamics import Stratum

sage: prototypes = {
....:      5: [(1,1,0,-1)],
....:      8: [(1,1,0,-2), (2,1,0,0)],
....:      9: [(2,1,0,-1)],
....:     12: [(1,2,0,-2), (2,1,0,-2), (3,1,0,0)],
....:     13: [(1,1,0,-3), (3,1,0,-1), (3,1,0,1)],
....:     16: [(3,1,0,-2), (4,1,0,0)],
....:     17: [(1,2,0,-3), (2,1,0,-3), (2,2,0,-1), (2,2,1,-1), (4,1,0,-1), (4,1,0,1)],
....:     20: [(1,1,0,-4), (2,2,1,-2), (4,1,0,-2), (4,1,0,2)],
....:     21: [(1,3,0,-3), (3,1,0,-3)],
....:     24: [(1,2,0,-4), (2,1,0,-4), (3,2,0,0)],
....:     25: [(2,2,0,-3), (2,2,1,-3), (3,2,0,-1), (4,1,0,-3)]}

sage: for D in sorted(prototypes):  # long time (.5s)
....:     for w,h,t,e in prototypes[D]:
....:          T = translation_surfaces.mcmullen_genus2_prototype(w,h,t,e)
....:          assert T.stratum() == Stratum([2], 1)
....:          assert (D.is_square() and T.base_ring() is QQ) or (T.base_ring().polynomial().discriminant() == D)

An example with some relative homology:

sage: U8 = translation_surfaces.mcmullen_genus2_prototype(2,1,0,0,1/4)    # discriminant 8
sage: U8
Translation Surface in H_2(1^2) built from a rectangle and a quadrilateral
sage: U12 = translation_surfaces.mcmullen_genus2_prototype(3,1,0,0,3/10)   # discriminant 12
sage: U12
Translation Surface in H_2(1^2) built from a rectangle and a quadrilateral

sage: U8.stratum()
H_2(1^2)
sage: U8.base_ring().polynomial().discriminant()
8
sage: U8.j_invariant()
(
          [4 0]
(0), (0), [0 2]
)

sage: U12.stratum()
H_2(1^2)
sage: U12.base_ring().polynomial().discriminant()
12
sage: U12.j_invariant()
(
          [6 0]
(0), (0), [0 2]
)
static octagon_and_squares()[source]

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: os = translation_surfaces.octagon_and_squares()
sage: os
Translation Surface in H_3(4) built from 2 squares and a regular octagon
sage: TestSuite(os).run()
sage: from flatsurf.geometry.categories import TranslationSurfaces
sage: os in TranslationSurfaces()
True
static origami(r, u, rr=None, uu=None, domain=None)[source]

Return the origami defined by the permutations r and u.

EXAMPLES:

sage: from flatsurf import translation_surfaces

sage: S = SymmetricGroup(3)
sage: r = S('(1,2)')
sage: u = S('(1,3)')
sage: o = translation_surfaces.origami(r,u)
sage: o
Origami defined by r=(1,2) and u=(1,3)
sage: o.stratum()
H_2(2)
sage: TestSuite(o).run()
static regular_octagon()[source]

Return the translation surface built from the regular octagon by identifying opposite sides.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: T = translation_surfaces.regular_octagon()
sage: T
Translation Surface in H_2(2) built from a regular octagon
sage: TestSuite(T).run()
sage: from flatsurf.geometry.categories import TranslationSurfaces
sage: T in TranslationSurfaces()
True
static square_torus(a=1)[source]

Return flat torus obtained by identification of the opposite sides of a square.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: T = translation_surfaces.square_torus()
sage: T
Translation Surface in H_1(0) built from a square
sage: from flatsurf.geometry.categories import TranslationSurfaces
sage: T in TranslationSurfaces()
True
sage: TestSuite(T).run()

Rational directions are completely periodic:

sage: v = T.tangent_vector(0, (1/33, 1/257), (13,17))
sage: L = v.straight_line_trajectory()
sage: L.flow(13+17)
sage: L.is_closed()
True
static t_fractal(w=1, r=2, h1=1, h2=1)[source]

Return the T-fractal with parameters w, r, h1, h2.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: tf = translation_surfaces.t_fractal()  # long time (.4s)
sage: tf  # long time (see above)
The T-fractal surface with parameters w=1, r=2, h1=1, h2=1
sage: TestSuite(tf).run()  # long time (see above)
static torus(u, v)[source]

Return the flat torus obtained as the quotient of the plane by the pair of vectors u and v.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: T = translation_surfaces.torus((1, AA(2).sqrt()), (AA(3).sqrt(), 3))
sage: T
Translation Surface in H_1(0) built from a quadrilateral
sage: T.polygon(0)
Polygon(vertices=[(0, 0), (1, 1.414213562373095?), (2.732050807568878?, 4.414213562373095?), (1.732050807568878?, 3)])
sage: from flatsurf.geometry.categories import TranslationSurfaces
sage: T in TranslationSurfaces()
True
static veech_2n_gon(n)[source]

The regular 2n-gon with opposite sides identified.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: s = translation_surfaces.veech_2n_gon(5)
sage: s
Translation Surface in H_2(1^2) built from a regular decagon
sage: TestSuite(s).run()
static veech_double_n_gon(n)[source]

A pair of regular n-gons with each edge of one identified to an edge of the other to make a translation surface.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: s=translation_surfaces.veech_double_n_gon(5)
sage: s
Translation Surface in H_2(2) built from 2 regular pentagons
sage: TestSuite(s).run()
static ward(n)[source]

Return the surface formed by gluing a regular 2n-gon to two regular n-gons. These surfaces have Veech’s lattice property due to work of Ward.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: s = translation_surfaces.ward(3)
sage: s
Translation Surface in H_1(0^3) built from 2 equilateral triangles and a regular hexagon
sage: TestSuite(s).run()
sage: s = translation_surfaces.ward(7)
sage: s
Translation Surface in H_6(10) built from 2 regular heptagons and a regular tetradecagon
sage: TestSuite(s).run()
flatsurf.geometry.similarity_surface_generators.flipper_nf_element_to_sage(x, K=None)[source]

Convert a flipper number field element into Sage

EXAMPLES:

sage: from flatsurf.geometry.similarity_surface_generators import flipper_nf_element_to_sage
sage: import flipper                               # optional - flipper
sage: T = flipper.load('SB_6')                     # optional - flipper
sage: h = T.mapping_class('s_0S_1S_2s_3s_4s_3S_5') # optional - flipper
sage: flipper_nf_element_to_sage(h.dilatation())   # optional - flipper
a
sage: AA(_)                                        # optional - flipper
6.45052513748511?
flatsurf.geometry.similarity_surface_generators.flipper_nf_to_sage(K, name='a')[source]

Convert a flipper number field into a Sage number field

Note

Currently, the code is not careful at all with root isolation.

EXAMPLES:

sage: import flipper  # optional - flipper  # random output due to matplotlib warnings with some combinations of setuptools and matplotlib
sage: import realalg  # optional - flipper
sage: from flatsurf.geometry.similarity_surface_generators import flipper_nf_to_sage
sage: K = realalg.RealNumberField([-2r] + [0r]*5 + [1r])   # optional - flipper
sage: K_sage = flipper_nf_to_sage(K)                       # optional - flipper
sage: K_sage                                               # optional - flipper
Number Field in a with defining polynomial x^6 - 2 with a = 1.122462048309373?
sage: AA(K_sage.gen())                                     # optional - flipper
1.122462048309373?
flatsurf.geometry.similarity_surface_generators.tfractal_surface(w=1, r=2, h1=1, h2=1)[source]