# defining a translation surface

I would like to define a translation surface of only single rectangle but haven't found how online. Can anyone show how to do so?

defining a translation surface

add a comment

2

Install `surface_dynamics`

and `sage-flatsurf`

following instructions on the

Then launch Sage and follow the

Start by importing flatsurf:

```
sage: import flatsurf
```

Say we wish to define a flat surface from a two by one rectangle with opposite sides glued together.

Start by constructing the rectangle with one of these commands:

```
sage: p = flatsurf.polygons((2, 0), (0, 1), (-2, 0), (0, -1))
sage: p = flatsurf.polygons(vertices=[(0, 0), (2, 0), (2, 1), (0, 1)])
```

Observe the result:

```
sage: p
Polygon: (0, 0), (2, 0), (2, 1), (0, 1)
```

Construct a surface dictionary:

```
sage: from flatsurf import Surface_dict
sage: s = Surface_dict(base_ring=p.base_ring())
sage: s.add_polygon(p, label="A")
'A'
sage: s.change_polygon_gluings("A", [("A", (e + 2) % 4) for e in range(4)])
sage: s.change_base_label("A")
sage: s.set_immutable()
sage: s
```

Construct a translation surface:

```
sage: from flatsurf import TranslationSurface
sage: t = TranslationSurface(s)
sage: t
TranslationSurface built from 1 polygon
sage: t.plot()
Launched png viewer for Graphics object consisting of 10 graphics primitives
```

Check that we got a genus one surface:

```
sage: t.genus()
1
```

If we constructed a similarity surface by using a different side pairing for the gluings, we might get a genus zero surface.

For reference here are the versions that were used in this answer:

```
sage: print(version())
SageMath version 9.2.beta12, Release Date: 2020-09-06
sage: import surface_dynamics
sage: print(surface_dynamics.version.version)
0.4.4
sage: import flatsurf
sage: print(flatsurf.version.version)
0.3
```

You're welcome!

Consider accepting the answer to mark the question as solved.

This is done by clicking the "accept" button, the button consisting of a tick mark "✓" icon, located to the left of the top of the answer, below the "upvote" and "downvote" buttons and the answer's score.

Please start posting anonymously - your entry will be published after you log in or create a new account.

Asked: ** 2020-09-22 00:38:33 +0200 **

Seen: **97 times**

Last updated: **Sep 24 '20**

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.