Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
sandpiles.sandpiles: rst fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mezzarobba committed Apr 11, 2015
1 parent 30599c4 commit a3261b8
Showing 1 changed file with 50 additions and 48 deletions.
98 changes: 50 additions & 48 deletions src/sage/sandpiles/sandpile.py
Original file line number Diff line number Diff line change
@@ -1,61 +1,34 @@
from string import join
import os
from sage.symbolic.all import I, pi
from sage.functions.log import exp
from sage.graphs.all import DiGraph, Graph, graphs, digraphs
from copy import deepcopy
from sage.rings.all import PolynomialRing, QQ, ZZ, lcm
from sage.misc.all import prod, det, forall, tmp_filename, random, randint, exists, denominator, srange
from sage.modules.free_module_element import vector
from sage.matrix.constructor import matrix, identity_matrix
from sage.interfaces.singular import singular
from sage.combinat.combinat import CombinatorialClass
from sage.combinat.set_partition import SetPartitions
from sage.homology.simplicial_complex import SimplicialComplex
from sage.plot.colors import rainbow
from sage.env import SAGE_LOCAL

r"""
To calculate linear systems associated with divisors, 4ti2 must be installed.
One way to do this is to run sage -i to install glpk, then 4ti2. See
http://sagemath.org/download-packages.html to get the exact names of these
packages. An alternative is to install 4ti2 separately, then point the
following variable to the correct path.
"""

path_to_zsolve = os.path.join(SAGE_LOCAL,'bin','zsolve')

r"""
Sage Sandpiles
Sandpiles
Functions and classes for mathematical sandpiles.
Version: 2.3
AUTHOR:
-- Marshall Hampton (2010-1-10) modified for inclusion as a module
within Sage library.
-- David Perkinson (2010-12-14) added show3d(), fixed bug in resolution(),
replaced elementary_divisors() with invariant_factors(), added show() for
SandpileConfig and SandpileDivisor.
- Marshall Hampton (2010-1-10) modified for inclusion as a module within Sage
library.
- David Perkinson (2010-12-14) added show3d(), fixed bug in resolution(),
replaced elementary_divisors() with invariant_factors(), added show() for
SandpileConfig and SandpileDivisor.
-- David Perkinson (2010-9-18): removed is_undirected, added show(), added
verbose arguments to several functions to display SandpileConfigs and divisors as
lists of integers
- David Perkinson (2010-9-18): removed is_undirected, added show(), added
verbose arguments to several functions to display SandpileConfigs and
divisors as lists of integers
-- David Perkinson (2010-12-19): created separate SandpileConfig, SandpileDivisor, and
Sandpile classes
- David Perkinson (2010-12-19): created separate SandpileConfig,
SandpileDivisor, and Sandpile classes
-- David Perkinson (2009-07-15): switched to using config_to_list instead
of .values(), thus fixing a few bugs when not using integer labels for
vertices.
- David Perkinson (2009-07-15): switched to using config_to_list instead of
.values(), thus fixing a few bugs when not using integer labels for vertices.
-- David Perkinson (2009): many undocumented improvements
- David Perkinson (2009): many undocumented improvements
-- David Perkinson (2008-12-27): initial version
- David Perkinson (2008-12-27): initial version
EXAMPLES::
EXAMPLES:
A weighted directed graph given as a Python dictionary::
Expand Down Expand Up @@ -229,6 +202,33 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from string import join
import os
from sage.symbolic.all import I, pi
from sage.functions.log import exp
from sage.graphs.all import DiGraph, Graph, graphs, digraphs
from copy import deepcopy
from sage.rings.all import PolynomialRing, QQ, ZZ, lcm
from sage.misc.all import prod, det, forall, tmp_filename, random, randint, exists, denominator, srange
from sage.modules.free_module_element import vector
from sage.matrix.constructor import matrix, identity_matrix
from sage.interfaces.singular import singular
from sage.combinat.combinat import CombinatorialClass
from sage.combinat.set_partition import SetPartitions
from sage.homology.simplicial_complex import SimplicialComplex
from sage.plot.colors import rainbow
from sage.env import SAGE_LOCAL

r"""
To calculate linear systems associated with divisors, 4ti2 must be installed.
One way to do this is to run sage -i to install glpk, then 4ti2. See
http://sagemath.org/download-packages.html to get the exact names of these
packages. An alternative is to install 4ti2 separately, then point the
following variable to the correct path.
"""

path_to_zsolve = os.path.join(SAGE_LOCAL,'bin','zsolve')

class Sandpile(DiGraph):
"""
Class for Dhar's abelian sandpile model.
Expand Down Expand Up @@ -560,7 +560,7 @@ def laplacian(self):
[ 0 -1 0 -1 2 0]
[ 0 0 -1 -1 0 2]
NOTES::
NOTES:
The function ``laplacian_matrix`` should be avoided. It returns the
indegree version of the laplacian.
Expand Down Expand Up @@ -1312,7 +1312,7 @@ def max_superstables(self, verbose=True):
list (of maximal superstables)
EXAMPLES:
EXAMPLES::
sage: S=sandlib('riemann-roch2')
sage: S.max_superstables()
Expand Down Expand Up @@ -4699,9 +4699,11 @@ def grid_sandpile(m,n):
The mxn grid sandpile. Each nonsink vertex has degree 4.
INPUT:
``m``, ``n`` - positive integers
OUTPUT:
Sandpile with sink named ``sink``.
EXAMPLES::
Expand Down Expand Up @@ -5282,8 +5284,8 @@ def firing_vector(S,D,E):
INPUT:
- ``S`` -Sandpile
``D``, ``E`` - tuples (representing linearly equivalent divisors)
- ``S`` - Sandpile
- ``D``, ``E`` - tuples (representing linearly equivalent divisors)
OUTPUT:
Expand Down

0 comments on commit a3261b8

Please sign in to comment.