sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 481 forks source link

Implement ribbon graphs #21587

Closed 5286a521-11fe-4c4e-9f98-8ed6b0603b1f closed 7 years ago

5286a521-11fe-4c4e-9f98-8ed6b0603b1f commented 8 years ago

This ticket is meant to implement a new class of objects: ribbon graphs. These are graphs together with a cyclic ordering of the half edges adjacent to each vertex. This data allows us to unambiguosly "thicken" the ribbon graph to an orientable surface with boundary.

This will be done by encoding the ribbon graphs in two permutations. As done for example in [Gir] (and many other places). This is also meant to include basic methods of the class to compute:

This is implementation is useful in itself but is also meant to serve as a base for a later implementation of something called "tete-a-tete" graphs which is an original idea by the mathematician Norbert A'Campo [Nor] and has been developed in my thesis. These other graphs model periodic automorphisms of the thickening of the graph.

[Gir] Girondo, Ernesto; González-Diez, Gabino (2012), Introduction to compact Riemann surfaces and dessins d'enfants, London Mathematical Society Student Texts, 79, Cambridge: Cambridge University Press,

[Nor] Tete-a-tete graphs and geometric monodromy

CC: @tscrim @sagetrac-tmonteil

Component: geometry

Keywords: ribbon, surfaces, orientable, days79

Author: Pablo Portilla

Branch/Commit: 809412e

Reviewer: David Coudert, Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/21587

5286a521-11fe-4c4e-9f98-8ed6b0603b1f commented 8 years ago

Branch: ribbon_graphs

5286a521-11fe-4c4e-9f98-8ed6b0603b1f commented 8 years ago

Changed branch from ribbon_graphs to none

5286a521-11fe-4c4e-9f98-8ed6b0603b1f commented 8 years ago

Branch: u/pportilla/ribbon_graphs

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Commit: a39ea2e

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

a39ea2eStarted formatting according developers guide
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from a39ea2e to 5afd130

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

5afd130added INPUT of main class
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

bb5cb78fixed some typos
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 5afd130 to bb5cb78

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from bb5cb78 to d82e31f

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

d82e31fMore functions correctly formatted
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from d82e31f to 2dbcdc2

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

2dbcdc2Deleted directory, put file in combinat, modified all.py
tscrim commented 8 years ago
comment:12

This will be a nice addition. A few quick comments to help:

Looking forward to this being ready for review.

5286a521-11fe-4c4e-9f98-8ed6b0603b1f commented 8 years ago
comment:13

Replying to @tscrim:

This will be a nice addition. A few quick comments to help:

  • You have a .directory file that has gotten mixed in with your commit.
  • You should only import things you need, not sage.all. From within Sage, you can use import_statements(foo) to see the import.
  • I've found it helpful to write docstrings (with doctests) as soon as I create a new function/method.

Looking forward to this being ready for review.

Thank you for the comments!

Basically I was working on this on my own for doing some computations and somebody told me that this might be useful for other people, so I decided to collaborate on Sage development. It happens that I had two ".sage" files that were written "for me". So now I am doing all the translation to python + adjusting to developers guide lines. That's why there is no docstrings yet and the format is not yet adapted.

The import sage.all was just to check that the .py file actually compiled :)

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 2dbcdc2 to 3c80c83

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

3c80c83Continued formatting according to developers guide.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

627f775Several changes
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 3c80c83 to 627f775

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 627f775 to e311e5e

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

e311e5eModified __init__.py and all.py. Added examples, documentation.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from e311e5e to 32cc071

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

32cc071Removing .gitignore which should be only personal.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 32cc071 to 21bed2c

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

21bed2cNew folder
tscrim commented 8 years ago
comment:20

Since this is the only file for ribbon graphs, I think it is overkill to have it be in a separate folder.

5286a521-11fe-4c4e-9f98-8ed6b0603b1f commented 8 years ago
comment:21

Replying to @tscrim:

Since this is the only file for ribbon graphs, I think it is overkill to have it be in a separate folder.

I understand it is overkill for now, but I will open a new ticket shortly depending on this and add a second file. This file will be about the so called tete-a-tete graphs that model automorphisms of surfaces.

I thought it was appropriated but I will revert the changes if it is not. Also I don't know if this fits more in "geometry". ?¿

tscrim commented 8 years ago
comment:22

I would say 4 or so files would deserve a new folder, so I still recommend reverting. However, considering where you want this to go and how I think about ribbon graphs, geometry would be a much better fit than combinat.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 21bed2c to 9ea064e

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

9ea064eNew folder
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 9ea064e to 4788854

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

4788854Modified __init__.py and all.py. Added examples, documentation.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 4788854 to c5dadf9

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from c5dadf9 to a84c211

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

a84c211Reverted to develop + changed to geometry. Also modified documentation.
5286a521-11fe-4c4e-9f98-8ed6b0603b1f commented 8 years ago

New commits:

a84c211Reverted to develop + changed to geometry. Also modified documentation.

New commits:

a84c211Reverted to develop + changed to geometry. Also modified documentation.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

b69f90bAdded more examples. Introduction with explanation of notation and examples.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from a84c211 to b69f90b

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from b69f90b to 5509661

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

5509661Added docstrings and documentation in general.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 5509661 to 05aa3a0

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

05aa3a0Added a whole introduction introducing ribbon graphs. More and more docstrings. This is coming to an end...
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 05aa3a0 to 103ebf9

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

103ebf9Added method extrude_edge(). Also added function make_ribbon(g,r)
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

7e4979dAdded method make_generic() that perturbes a ribbon graph to produce
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 103ebf9 to 7e4979d

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 7e4979d to 4ef44be

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

4ef44beCompleted documentation and it compiles. The document passes all doctests. So I submit it to review.
5286a521-11fe-4c4e-9f98-8ed6b0603b1f commented 8 years ago
comment:34

I submit the ticket to review. Comments, bugs, anything is welcomed.

There are some methods such as homology_basis() that might not have a clear purpose. Nevertheless they work as expected and are there because a future ticket will use them. In general, this ticket just lets you play with ribbon graphs and I think it could be useful for people trying to make computations on dessins d'enfant for example. Also it will be useful (and necessary) for the implementation of tete-a-tete graph as I said in the beginning. i will start with this project as soon as this ticket is positively reviewed to be included in the next sage version.

Also, is there a way to include images on the documentation?. And I mean images created for example with IPE (not by plotting with sphinx_plot).

EDIT: at some point I did a force-push (I know I know) so if conflict appear for anyway, I recommend deleting your local branch and re-pulling it.