A cluster seed is a pair with
being a skew-symmetrizable
-matrix
and with
being an
-tuple of independent elements in the field of rational functions in
variables.
For the compendium on the cluster algebra and quiver package see
http://arxiv.org/abs/1102.4844.
AUTHORS:
See also
For mutation types of cluster seeds, see sage.combinat.cluster_algebra_quiver.quiver_mutation_type.QuiverMutationType(). Cluster seeds are closely related to sage.combinat.cluster_algebra_quiver.quiver.ClusterQuiver().
Bases: sage.structure.sage_object.SageObject
The cluster seed associated to an exchange matrix.
INPUT:
data – can be any of the following:
* QuiverMutationType
* str - a string representing a QuiverMutationType or a common quiver type (see Examples)
* ClusterQuiver
* Matrix - a skew-symmetrizable matrix
* DiGraph - must be the input data for a quiver
* List of edges - must be the edge list of a digraph for a quiver
EXAMPLES:
sage: S = ClusterSeed(['A',5]); S
A seed for a cluster algebra of rank 5 of type ['A', 5]
sage: S = ClusterSeed(['A',[2,5],1]); S
A seed for a cluster algebra of rank 7 of type ['A', [2, 5], 1]
sage: T = ClusterSeed( S ); T
A seed for a cluster algebra of rank 7 of type ['A', [2, 5], 1]
sage: T = ClusterSeed( S._M ); T
A seed for a cluster algebra of rank 7
sage: T = ClusterSeed( S.quiver()._digraph ); T
A seed for a cluster algebra of rank 7
sage: T = ClusterSeed( S.quiver()._digraph.edges() ); T
A seed for a cluster algebra of rank 7
sage: S = ClusterSeed(['B',2]); S
A seed for a cluster algebra of rank 2 of type ['B', 2]
sage: S = ClusterSeed(['C',2]); S
A seed for a cluster algebra of rank 2 of type ['B', 2]
sage: S = ClusterSeed(['A', [5,0],1]); S
A seed for a cluster algebra of rank 5 of type ['D', 5]
sage: S = ClusterSeed(['GR',[3,7]]); S
A seed for a cluster algebra of rank 6 of type ['E', 6]
sage: S = ClusterSeed(['F', 4, [2,1]]); S
A seed for a cluster algebra of rank 6 of type ['F', 4, [1, 2]]
Returns the -matrix of self.
EXAMPLES:
sage: ClusterSeed(['A',4]).b_matrix()
[ 0 1 0 0]
[-1 0 -1 0]
[ 0 1 0 1]
[ 0 0 -1 0]
sage: ClusterSeed(['B',4]).b_matrix()
[ 0 1 0 0]
[-1 0 -1 0]
[ 0 1 0 1]
[ 0 0 -2 0]
sage: ClusterSeed(['D',4]).b_matrix()
[ 0 1 0 0]
[-1 0 -1 -1]
[ 0 1 0 0]
[ 0 1 0 0]
sage: ClusterSeed(QuiverMutationType([['A',2],['B',2]])).b_matrix()
[ 0 1 0 0]
[-1 0 0 0]
[ 0 0 0 1]
[ 0 0 -2 0]
Returns all c-vectors of self.
Requires principal coefficients, initialized by using principal_extension(), or the user can set ‘ignore_coefficients=True’ to bypass this restriction.
Warning: this method assumes the sign-coherence conjecture and that the input seed is sign-coherent (has an exchange matrix with columns of like signs). Otherwise, computational errors might arise.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1,2])
sage: S.c_matrix()
[ 1 0 0]
[ 0 0 -1]
[ 0 -1 0]
Returns the k-th c-vector of self. It is obtained as the k-th column vector of the bottom part of the B-matrix of self.
Requires principal coefficients, initialized by using principal_extension(), or the user can set ‘ignore_coefficients=True’ to bypass this restriction.
Warning: this method assumes the sign-coherence conjecture and that the input seed is sign-coherent (has an exchange matrix with columns of like signs). Otherwise, computational errors might arise.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1,2])
sage: [ S.c_vector(k) for k in range(3) ]
[(1, 0, 0), (0, 0, -1), (0, -1, 0)]
sage: S = ClusterSeed(Matrix([[0,1],[-1,0],[1,0],[-1,1]])); S
A seed for a cluster algebra of rank 2 with 2 frozen variables
sage: S.c_vector(0)
Traceback (most recent call last):
...
ValueError: No principal coefficients initialized. Use principal_extension, or ignore_coefficients to ignore this.
sage: S.c_vector(0,ignore_coefficients=True)
(1, -1)
Returns the cluster of self.
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: S.cluster()
[x0, x1, x2]
sage: S.mutate(1)
sage: S.cluster()
[x0, (x0*x2 + 1)/x1, x2]
sage: S.mutate(2)
sage: S.cluster()
[x0, (x0*x2 + 1)/x1, (x0*x2 + x1 + 1)/(x1*x2)]
sage: S.mutate([2,1])
sage: S.cluster()
[x0, x1, x2]
Returns the -th cluster variable of self.
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: S.mutate([1,2])
sage: [S.cluster_variable(k) for k in range(3)]
[x0, (x0*x2 + 1)/x1, (x0*x2 + x1 + 1)/(x1*x2)]
Returns the coefficient of self at index k.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1,2])
sage: [ S.coefficient(k) for k in range(3) ]
[y0, 1/y2, 1/y1]
Returns all coefficients of self.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1,2])
sage: S.coefficients()
[y0, 1/y2, 1/y1]
Returns the restriction to the principal part (i.e. the exchangeable variables) of self.
EXAMPLES:
sage: S = ClusterSeed(['A',4])
sage: T = ClusterSeed( S.quiver().digraph().edges(), frozen=1 )
sage: T.quiver().digraph().edges()
[(0, 1, (1, -1)), (2, 1, (1, -1)), (2, 3, (1, -1))]
sage: T.exchangeable_part().quiver().digraph().edges()
[(0, 1, (1, -1)), (2, 1, (1, -1))]
sage: S2 = S.principal_extension()
sage: S3 = S2.principal_extension(ignore_coefficients=True)
sage: S2.exchangeable_part() == S3.exchangeable_part()
True
Returns the k-th F-polynomial of self. It is obtained from the
k-th cluster variable by setting all to
.
Requires principal coefficients, initialized by using principal_extension(), or the user can set ‘ignore_coefficients=True’ to bypass this restriction.
Warning: this method assumes the sign-coherence conjecture and that the input seed is sign-coherent (has an exchange matrix with columns of like signs). Otherwise, computational errors might arise.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1,2])
sage: [S.f_polynomial(k) for k in range(3)]
[1, y1*y2 + y2 + 1, y1 + 1]
sage: S = ClusterSeed(Matrix([[0,1],[-1,0],[1,0],[-1,1]])); S
A seed for a cluster algebra of rank 2 with 2 frozen variables
sage: T = ClusterSeed(Matrix([[0,1],[-1,0]])).principal_extension(); T
A seed for a cluster algebra of rank 2 with principal coefficients
sage: S.mutate(0)
sage: T.mutate(0)
sage: S.f_polynomials()
Traceback (most recent call last):
...
ValueError: No principal coefficients initialized. Use principal_extension, or ignore_coefficients to ignore this.
sage: S.f_polynomials(ignore_coefficients=True)
[y0 + y1, 1]
sage: T.f_polynomials()
[y0 + 1, 1]
Returns all F-polynomials of self. These are obtained from the
cluster variables by setting all ‘s to
.
Requires principal coefficients, initialized by using principal_extension(), or the user can set ‘ignore_coefficients=True’ to bypass this restriction.
Warning: this method assumes the sign-coherence conjecture and that the input seed is sign-coherent (has an exchange matrix with columns of like signs). Otherwise, computational errors might arise.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1,2])
sage: S.f_polynomials()
[1, y1*y2 + y2 + 1, y1 + 1]
Returns the matrix of all g-vectors of self. This are the degree vectors
of the cluster variables after setting all ‘s to
.
Requires principal coefficients, initialized by using principal_extension(), or the user can set ‘ignore_coefficients=True’ to bypass this restriction.
Warning: this method assumes the sign-coherence conjecture and that the input seed is sign-coherent (has an exchange matrix with columns of like signs). Otherwise, computational errors might arise.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1,2])
sage: S.g_matrix()
[ 1 0 0]
[ 0 0 -1]
[ 0 -1 0]
sage: S = ClusterSeed(['A',3])
sage: S2 = S.principal_extension()
sage: S.mutate([0,1])
sage: S2.mutate([0,1])
sage: S.g_matrix()
Traceback (most recent call last):
...
ValueError: No principal coefficients initialized. Use
principal_extension, or ignore_coefficients to ignore this.
sage: S.g_matrix(ignore_coefficients=True)
[-1 0 0]
[ 1 0 0]
[ 0 1 1]
sage: S2.g_matrix()
[-1 -1 0]
[ 1 0 0]
[ 0 0 1]
Returns the k-th g-vector of self. This is the degree vector
of the k-th cluster variable after setting all ‘s to
.
Requires principal coefficients, initialized by using principal_extension(), or the user can set ‘ignore_coefficients=True’ to bypass this restriction.
Warning: this method assumes the sign-coherence conjecture and that the input seed is sign-coherent (has an exchange matrix with columns of like signs). Otherwise, computational errors might arise.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1,2])
sage: [ S.g_vector(k) for k in range(3) ]
[(1, 0, 0), (0, 0, -1), (0, -1, 0)]
Returns the ground field of the cluster of self.
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: S.ground_field()
Fraction Field of Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
Only in notebook mode. Starts an interactive window for cluster seed mutations.
INPUT:
TESTS:
sage: S = ClusterSeed(['A',4])
sage: S.interact() # long time
'The interactive mode only runs in the Sage notebook.'
Returns True iff self is acyclic (i.e., if the underlying quiver is acyclic).
EXAMPLES:
sage: ClusterSeed(['A',4]).is_acyclic()
True
sage: ClusterSeed(['A',[2,1],1]).is_acyclic()
True
sage: ClusterSeed([[0,1],[1,2],[2,0]]).is_acyclic()
False
Returns True iff self is bipartite (i.e., if the underlying quiver is bipartite).
INPUT:
EXAMPLES:
sage: ClusterQuiver(['A',[3,3],1]).is_bipartite()
True
sage: ClusterQuiver(['A',[4,3],1]).is_bipartite()
False
Returns the number of frozen variables of self.
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: S.n()
3
sage: S.m()
0
sage: S = S.principal_extension()
sage: S.m()
3
Mutates self at a vertex or a sequence of vertices.
INPUT:
EXAMPLES:
sage: S = ClusterSeed(['A',4]); S.b_matrix()
[ 0 1 0 0]
[-1 0 -1 0]
[ 0 1 0 1]
[ 0 0 -1 0]
sage: S.mutate(0); S.b_matrix()
[ 0 -1 0 0]
[ 1 0 -1 0]
[ 0 1 0 1]
[ 0 0 -1 0]
sage: T = S.mutate(0, inplace=False); T
A seed for a cluster algebra of rank 4 of type ['A', 4]
sage: S.mutate(0)
sage: S == T
True
sage: S.mutate([0,1,0])
sage: S.b_matrix()
[ 0 -1 1 0]
[ 1 0 0 0]
[-1 0 0 1]
[ 0 0 -1 0]
sage: S = ClusterSeed(QuiverMutationType([['A',1],['A',3]]))
sage: S.b_matrix()
[ 0 0 0 0]
[ 0 0 1 0]
[ 0 -1 0 -1]
[ 0 0 1 0]
sage: T = S.mutate(0,inplace=False)
sage: S == T
False
Returns the seeds obtained by mutating self at all vertices in sequence.
INPUT:
sequence – an iterable of vertices of self.
show_sequence – (default: False) if True, a png containing the associated quivers is shown.
fig_size – (default: 1.2) factor by which the size of the plot is multiplied.
return_output – (default: ‘seed’) determines what output is to be returned:
* if 'seed', outputs all the cluster seeds obtained by the ``sequence`` of mutations.
* if 'matrix', outputs a list of exchange matrices.
* if 'var', outputs a list of new cluster variables obtained at each step.
EXAMPLES:
sage: S = ClusterSeed(['A',2])
sage: for T in S.mutation_sequence([0,1,0]):
... print T.b_matrix()
[ 0 -1]
[ 1 0]
[ 0 1]
[-1 0]
[ 0 -1]
[ 1 0]
sage: S=ClusterSeed(['A',2])
sage: S.mutation_sequence([0,1,0,1],return_output='var')
[(x1 + 1)/x0, (x0 + x1 + 1)/(x0*x1), (x0 + 1)/x1, x0]
Returns the mutation type of self.
EXAMPLES:
sage: ClusterSeed(['A',4]).mutation_type()
['A', 4]
sage: ClusterSeed(['A',(3,1),1]).mutation_type()
['A', [1, 3], 1]
sage: ClusterSeed(['C',2]).mutation_type()
['B', 2]
sage: ClusterSeed(['B',4,1]).mutation_type()
['BD', 4, 1]
Returns the number of exchangeable variables of self.
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: S.n()
3
Returns the plot of the quiver of self.
INPUT:
EXAMPLES:
sage: S = ClusterSeed(['A',5])
sage: pl = S.plot()
sage: pl = S.plot(circular=True)
Returns the principal extension of self, yielding a 2n-by-n matrix. Raises an error if the input seed has a non-square exchange matrix, unless ‘ignore_coefficients=True’ is set. In this case, the method instead adds n frozen variables to any previously frozen variables. I.e., the seed obtained by adding a frozen variable to every exchangeable variable of self.
EXAMPLES:
sage: S = ClusterSeed([[0,1],[1,2],[2,3],[2,4]]); S
A seed for a cluster algebra of rank 5
sage: T = S.principal_extension(); T
A seed for a cluster algebra of rank 5 with principal coefficients
sage: T.b_matrix()
[ 0 1 0 0 0]
[-1 0 1 0 0]
[ 0 -1 0 1 1]
[ 0 0 -1 0 0]
[ 0 0 -1 0 0]
[ 1 0 0 0 0]
[ 0 1 0 0 0]
[ 0 0 1 0 0]
[ 0 0 0 1 0]
[ 0 0 0 0 1]
sage: T2 = T.principal_extension()
Traceback (most recent call last):
...
ValueError: The b-matrix is not square. Use ignore_coefficients to ignore this.
sage: T2 = T.principal_extension(ignore_coefficients=True); T2.b_matrix()
[ 0 1 0 0 0]
[-1 0 1 0 0]
[ 0 -1 0 1 1]
[ 0 0 -1 0 0]
[ 0 0 -1 0 0]
[ 1 0 0 0 0]
[ 0 1 0 0 0]
[ 0 0 1 0 0]
[ 0 0 0 1 0]
[ 0 0 0 0 1]
[ 1 0 0 0 0]
[ 0 1 0 0 0]
[ 0 0 1 0 0]
[ 0 0 0 1 0]
[ 0 0 0 0 1]
Returns the quiver associated to self.
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: S.quiver()
Quiver on 3 vertices of type ['A', 3]
Reorients self with respect to the given total order, or with respect to an iterator of ordered pairs.
WARNING:
INPUT:
EXAMPLES:
sage: S = ClusterSeed(['A',[2,3],1])
sage: S.reorient([(0,1),(2,3)])
sage: S.reorient([(1,0),(2,3)])
sage: S.reorient([0,1,2,3,4])
Resets the cluster of self to the initial cluster.
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: S.mutate([1,2,1])
sage: S.cluster()
[x0, (x1 + 1)/x2, (x0*x2 + x1 + 1)/(x1*x2)]
sage: S.reset_cluster()
sage: S.cluster()
[x0, x1, x2]
sage: T = S.principal_extension()
sage: T.cluster()
[x0, x1, x2]
sage: T.mutate([1,2,1])
sage: T.cluster()
[x0, (x1*y2 + x0)/x2, (x1*y1*y2 + x0*y1 + x2)/(x1*x2)]
sage: T.reset_cluster()
sage: T.cluster()
[x0, x1, x2]
Resets the coefficients of self to the frozen variables but keeps the current cluster. Raises an error if the number of frozen variables is different than the number of exchangeable variables.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.b_matrix()
[ 0 1 0]
[-1 0 -1]
[ 0 1 0]
[ 1 0 0]
[ 0 1 0]
[ 0 0 1]
sage: S.mutate([1,2,1])
sage: S.b_matrix()
[ 0 1 -1]
[-1 0 1]
[ 1 -1 0]
[ 1 0 0]
[ 0 1 -1]
[ 0 0 -1]
sage: S.reset_coefficients()
sage: S.b_matrix()
[ 0 1 -1]
[-1 0 1]
[ 1 -1 0]
[ 1 0 0]
[ 0 1 0]
[ 0 0 1]
Saves the plot of the underlying digraph of the quiver of self.
INPUT:
EXAMPLES:
sage: Q = ClusterQuiver(['F',4,[1,2]])
sage: Q.save_image(os.path.join(SAGE_TMP, 'sage.png'))
Sets the cluster for self to cluster.
INPUT:
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: cluster = S.cluster()
sage: S.mutate([1,2,1])
sage: S.cluster()
[x0, (x1 + 1)/x2, (x0*x2 + x1 + 1)/(x1*x2)]
sage: S.set_cluster(cluster)
sage: S.cluster()
[x0, x1, x2]
Shows the plot of the quiver of self.
INPUT:
TESTS:
sage: S = ClusterSeed(['A',5])
sage: S.show() # long time
Returns the -th initial cluster variable for the associated cluster seed.
EXAMPLES:
sage: S = ClusterSeed(['A',3])
sage: S.mutate([2,1])
sage: S.x(0)
x0
sage: S.x(1)
x1
sage: S.x(2)
x2
Returns the -th initial coefficient (frozen variable) for the associated cluster seed.
EXAMPLES:
sage: S = ClusterSeed(['A',3]).principal_extension()
sage: S.mutate([2,1])
sage: S.y(0)
y0
sage: S.y(1)
y1
sage: S.y(2)
y2
Bases: sage.rings.fraction_field_element.FractionFieldElement
This class is a thin wrapper for cluster variables in cluster seeds.
It provides the extra feature to store if a variable is frozen or not.