Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new class SnakeGraphs and SnakeGraph in combinat/cluster_algebra_quiver #19160

Open
egunawan mannequin opened this issue Sep 7, 2015 · 35 comments
Open

Add a new class SnakeGraphs and SnakeGraph in combinat/cluster_algebra_quiver #19160

egunawan mannequin opened this issue Sep 7, 2015 · 35 comments

Comments

@egunawan
Copy link
Mannequin

egunawan mannequin commented Sep 7, 2015

Note: This branch is currently added on top of Sage version 8.2 Master

Add a new class SnakeGraphs and SnakeGraph.

A snake graph is a connected sequence of square tiles which goes north and east. For example of where snake graphs come up in mathematics, see the following articles:

  • :arxiv:0906.0748
  • :arxiv:abs/1209.4617

Note:

  • A SnakeGraph class only has the attribute of shape (list of sizes of each row of the snake graph). For example, the edges do not have weights attached to them. For the purpose of doing computation with cluster algebra objects, we will create another class ClusterWeightedSnakeGraph(SnakeGraph) later.
  • Our motivation for creating this snake graph class is to compute cluster variables for cluster algebras from surfaces (see Snake graph perfect matching formula for cluster variables from surfaces #16310). However, an abstract snake graph exists outside the context of cluster algebras from surfaces.

CC: @tscrim @sagetrac-mlapointe @sagetrac-gmoose05

Component: combinatorics

Keywords: snake graph, cluster algebra, days69

Author: Emily Gunawan

Branch/Commit: u/egunawan/snake_graphs-19160 @ 3728b1a

Reviewer: Travis Scrimshaw, Mélodie Lapointe

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

@egunawan egunawan mannequin added this to the sage-6.9 milestone Sep 7, 2015
@egunawan egunawan mannequin added c: combinatorics labels Sep 7, 2015
@egunawan

This comment has been minimized.

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Sep 7, 2015

Branch: u/egunawan/19160

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Sep 7, 2015

New commits:

1731bcconly plain SnakeGraph class works. But we add matchings and weightedsnakegraph class also.
d536815Remove files not related to plain snake graph class.
dd7241badd a blank line

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Sep 7, 2015

Commit: dd7241b

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Sep 7, 2015

Reviewer: tscrim, mlapointe

@egunawan egunawan mannequin added the s: needs review label Sep 7, 2015
@tscrim
Copy link
Collaborator

tscrim commented Sep 7, 2015

comment:4

Thank you for your work on this.

Some things that need to be addressed from a quick glance:

  • Full doctest coverage (shape).
  • print 'print an error message here TODO' in _element_constructor_ needs to raise an actual error.
  • The snake graphs -> Snake graphs.
  • You should include more information in the SnakeGraphs's class level docstring.
  • Remove the module variables RIGHT and UP; just use the python strings (I've never noticed a speed decrease; in fact, python probably keeps string instances in a pool and/or has special compiler behavior for hardcoded strings).
  • You might consider using ClonableArray instead of Element since the former gives you list-like behavior for free (and by handling the internal storage in python, will be faster) and is a subclass of Element.
  • You should explain the association between your internal data structure and the behavior of the snake graph (i.e., what integer makes the graph go in which direction?). This can be in python comments, not necessarily in the docstrings.

Looks pretty, and I like the ascii art.

For the ticket on trac, you should use real names for author and reviewer.

@tscrim
Copy link
Collaborator

tscrim commented Sep 7, 2015

Changed reviewer from tscrim, mlapointe to Travis Scrimshaw, mlapointe

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Sep 7, 2015

Changed reviewer from Travis Scrimshaw, mlapointe to Travis Scrimshaw, Mélodie Lapointe

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Sep 7, 2015

comment:6

Thank you Travis.
I am trying to figure out why cluster_snakegraph.html does not get created. Do you know what I did wrong?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 7, 2015

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

ca0681e19160:add doc test for def shape()
e66434e19160: add cluster_snakegraph to __init__.py

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 7, 2015

Changed commit from dd7241b to e66434e

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 8, 2015

Changed commit from e66434e to af06bd5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 8, 2015

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

c4497e119160:Remove the module variables RIGHT and UP. Raise error in `_element_constructor_` if SnakeGraph of different size is input, or if sum(x) is not equal the number of tiles, or if x is not a SnakeGraph nor a list/tuple/set. Replace The snake graphs with Snake graphs
02c1e3219160: Use ClonableArray (a subclass of Element) because it gives list-like behavior for free. Add `__ne__` because otherwise != is wrong
af06bd519160: Add info in docstring for SnakeGraphs. Improve doc for SnakeGraph. Explain the association between your internal data structure and the behavior of the snake graph.

@egunawan egunawan mannequin added s: needs review and removed s: needs work labels Sep 8, 2015
@tscrim
Copy link
Collaborator

tscrim commented Sep 8, 2015

comment:10

You need to add the reference to $SAGE_ROOT/src/doc/en/reference/combinat/module_list.rst.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 8, 2015

Changed commit from af06bd5 to a456b4e

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 8, 2015

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

a456b4e19160:cluster_snakegraph.html now builds. Fix typos in doc.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 9, 2015

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

5fb2ce419160: Fix a hyperlink reference. Add ascii art for a square tile in doc.
a873a6019160:clean up doc.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 9, 2015

Changed commit from a456b4e to a873a60

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 10, 2015

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

3c7353c19160:fix bug in plot. Add LabeledSnakeGraph class.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 10, 2015

Changed commit from a873a60 to 3c7353c

@fchapoton
Copy link
Contributor

comment:14

doc does not build

OSError: [combinat ] /home/dima/sage/sage/local/lib/python2.7/site-packages/sage/combinat/cluster_algebra_quiver/cluster_snakegraph.py:docstring of sage.combinat.cluster_algebra_quiver.cluster_snakegraph.LabeledSnakeGraph:28: WARNING: Bullet list ends without a blank line; unexpected unindent

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 11, 2015

Changed commit from 3c7353c to 52cb82f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 11, 2015

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

52cb82f19160: Doc builds with no error. Remove references that are not cited in the cluster_snakegraph.py file.

@tscrim
Copy link
Collaborator

tscrim commented Sep 11, 2015

Changed commit from 52cb82f to a44c44c

@tscrim
Copy link
Collaborator

tscrim commented Sep 11, 2015

Changed branch from u/egunawan/19160 to u/tscrim/snake_graphs-19160

@tscrim
Copy link
Collaborator

tscrim commented Sep 11, 2015

comment:16

WIP for Emily.


New commits:

7afd4a7Merge branch 'u/egunawan/19160' of git://trac.sagemath.org/sage into u/tscrim/snake_graphs-19160
84ec0a0Making a new non-recursive iterator for composition for speed.
825ecdfMerge branch 'u/egunawan/19160' of git://trac.sagemath.org/sage into u/tscrim/snake_graphs-19160
69f3547Some more changes; not quite ready.
a44c44cLittle parent classes all in a row.

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Sep 13, 2015

Changed author from egunawan to Emily Gunawan

@fchapoton
Copy link
Contributor

comment:18

Could you please add the missing documentation, so that the bot can turn green ?

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Nov 10, 2015

Changed commit from a44c44c to none

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Nov 10, 2015

Changed branch from u/tscrim/snake_graphs-19160 to none

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Jan 14, 2017

comment:20

See u/egunawan/snake_graphs-19160 (on top of Sage 7.5) for the most current work. I have questions about using Words on Sage.

Currently the parent SnakeGraphs takes one parameter (the number of boxes), but for what I'd like to do mathematically, it would make sense to let SnakeGraphs be the set of all snake graphs (of any number of boxes).

Instead of enumerating them with compositions, we can also enumerate them by binary numbers, i.e. words on two alphabets 0 and 1 where the first alphabet must be 1 (except the the number 0). For example, the binary number 1 corresponds to the one-box; the word 10 corresponds to the shape (1,1) snake graph; the word 11 corresponds to the shape (2) snake graph; the word 100 corresponds to the shape (1,2) shape snake graph; the word 101 corresponds to the shape (1,1,1) snake graph; etc.

Words are already implemented in Sage, so maybe I can use that and append the alphabet 1 to the beginning of every word (in order to get the correct words for my need). What do you think? I am cc-ing Franco in case he may be interested in giving his input on my question. Thank you for reading!

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Jul 23, 2018

Last 10 new commits:

84ec0a0Making a new non-recursive iterator for composition for speed.
5fb2ce419160: Fix a hyperlink reference. Add ascii art for a square tile in doc.
a873a6019160:clean up doc.
3c7353c19160:fix bug in plot. Add LabeledSnakeGraph class.
52cb82f19160: Doc builds with no error. Remove references that are not cited in the cluster_snakegraph.py file.
825ecdfMerge branch 'u/egunawan/19160' of git://trac.sagemath.org/sage into u/tscrim/snake_graphs-19160
69f3547Some more changes; not quite ready.
a44c44cLittle parent classes all in a row.
03ee40e19160: merge to 7.5
3728b1aTo Master version 8.2 Merge branch 'u/egunawan/snake_graphs-19160' of git://trac.sagemath.org/sage into 19160

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Jul 23, 2018

Branch: u/egunawan/snake_graphs-19160

@egunawan

This comment has been minimized.

@egunawan
Copy link
Mannequin Author

egunawan mannequin commented Jul 23, 2018

Commit: 3728b1a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants