This file contains helper functions for detecting the mutation type of

a cluster algebra or quiver.

For the compendium on the cluster algebra and quiver package see

Arxiv 1102.4844

AUTHORS:

  • Gregg Musiker
  • Christian Stump
sage.combinat.cluster_algebra_quiver.mutation_type.is_mutation_finite(M, nr_of_checks=None)

Use a non-deterministic method by random mutations in various directions. Can result in a wrong answer.

INPUT:

  • nr_of_checks – (default: None) number of mutations applied. Standard is 500*(number of vertices of self).

ALGORITHM:

A quiver is mutation infinite if and only if every edge label (a,-b) satisfy a*b > 4. Thus, we apply random mutations in random directions

EXAMPLES:

sage: from sage.combinat.cluster_algebra_quiver.mutation_type import is_mutation_finite

sage: Q = ClusterQuiver(['A',10])
sage: M = Q.b_matrix()
sage: is_mutation_finite(M)
(True, None)

sage: Q = ClusterQuiver([(0,1),(1,2),(2,3),(3,4),(4,5),(5,6),(6,7),(7,8),(2,9)])
sage: M = Q.b_matrix()
sage: is_mutation_finite(M) # random
(False, [9, 6, 9, 8, 9, 4, 0, 4, 5, 2, 1, 0, 1, 0, 7, 1, 9, 2, 5, 7, 8, 6, 3, 0, 2, 5, 4, 2, 6, 9, 2, 7, 3, 5, 3, 7, 9, 5, 9, 0, 2, 7, 9, 2, 4, 2, 1, 6, 9, 4, 3, 5, 0, 8, 2, 9, 5, 3, 7, 0, 1, 8, 3, 7, 2, 7, 3, 4, 8, 0, 4, 9, 5, 2, 8, 4, 8, 1, 7, 8, 9, 1, 5, 0, 8, 7, 4, 8, 9, 8, 0, 7, 4, 7, 1, 2, 8, 6, 1, 3, 9, 3, 9, 1, 3, 2, 4, 9, 5, 1, 2, 9, 4, 8, 5, 3, 4, 6, 8, 9, 2, 5, 9, 4, 6, 2, 1, 4, 9, 6, 0, 9, 8, 0, 4, 7, 9, 2, 1, 6])

Check that trac ticket #19495 is fixed:

sage: dg = DiGraph(); dg.add_vertex(0); S = ClusterSeed(dg); S
A seed for a cluster algebra of rank 1
sage: S.is_mutation_finite()
True
sage.combinat.cluster_algebra_quiver.mutation_type.load_data(n)

Load a dict with keys being tuples representing exceptional QuiverMutationTypes, and with values being lists or sets containing all mutation equivalent quivers as dig6 data.

We check

  • if the data is stored by the user, and if this is not the case
  • if the data is stored by the optional package install.

EXAMPLES:

sage: from sage.combinat.cluster_algebra_quiver.mutation_type import load_data
sage: load_data(2) # random - depends on the data the user has stored
{('G', 2): [('AO', (((0, 1), (1, -3)),)), ('AO', (((0, 1), (3, -1)),))]}

TESTS:

We test data from the database_mutation_class optional package:

sage: def test_database(n):
....:     import os.path
....:     from six.moves import cPickle
....:     from sage.env import SAGE_SHARE
....:     relative_filename = 'cluster_algebra_quiver/mutation_classes_%s.dig6'%n
....:     filename = os.path.join(SAGE_SHARE, relative_filename)
....:     f = open(filename,'r')
....:     data = cPickle.load(f)
....:     f.close()
....:     return data
sage: test_database(2) # optional - database_mutation_class
{('G', 2): [('AO', (((0, 1), (1, -3)),)), ('AO', (((0, 1), (3, -1)),))]}
sage: sorted(test_database(3).items()) # optional - database_mutation_class
[(('G', 2, -1),
  [('BH?', (((1, 2), (1, -3)),)),
   ('BGO', (((2, 1), (3, -1)),)),
   ('BW?', (((0, 1), (3, -1)),)),
   ('BP?', (((0, 1), (1, -3)),)),
   ('BP_', (((0, 1), (1, -3)), ((2, 0), (3, -1)))),
   ('BP_', (((0, 1), (3, -1)), ((1, 2), (1, -3)), ((2, 0), (2, -2))))]),
 (('G', 2, 1),
  [('BH?', (((1, 2), (3, -1)),)),
   ('BGO', (((2, 1), (1, -3)),)),
   ('BW?', (((0, 1), (1, -3)),)),
   ('BP?', (((0, 1), (3, -1)),)),
   ('BKO', (((1, 0), (3, -1)), ((2, 1), (1, -3)))),
   ('BP_', (((0, 1), (2, -2)), ((1, 2), (1, -3)), ((2, 0), (3, -1))))])]