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

Commit

Permalink
continue merging to 8.2. reduce doctest failures
Browse files Browse the repository at this point in the history
  • Loading branch information
egunawan committed Jul 27, 2018
1 parent af89a54 commit 1b3c18c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
24 changes: 12 additions & 12 deletions src/sage/combinat/cluster_algebra_quiver/cluster_triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def __init__(self, data, frozen=None, is_principal=None, from_surface=False, bou
self._F = None
self._y = None
self._yhat = None
self._mut_path = None
#self._mut_path = None

#The initial B-matrix is set to be the B-matrix corresponding to the input triangulation
self._b_initial = copy(self._M)
Expand Down Expand Up @@ -808,7 +808,7 @@ def mutate(self, sequence, inplace=True, user_labels=True):
ct._M.mutate(pos)
S = S.mutate(pos, inplace=False)

ct._cluster = S._cluster
ct._cluster = S.cluster()
ct._map_label_to_variable = produce_dict_label_to_variable (ct._triangles, ct._cluster[0:ct._n], ct._boundary_edges, ct._boundary_edges_vars)
ct._map_variable_to_label = produce_dict_variable_to_label (ct._map_label_to_variable)
ct._triangulation = _get_user_label_triangulation(ct._triangles)
Expand Down Expand Up @@ -848,7 +848,7 @@ def boundary_edges(self):
"""
return self._boundary_edges

#def cluster(self):
def cluster(self):
"""
Return the cluster seed list (i.e. [x_0, x_1, ..., x_{n-1}])
corresponding to ``self``.
Expand All @@ -860,7 +860,7 @@ def boundary_edges(self):
sage: T.cluster()
[x0, x1, x2, x3]
"""
#return self._cluster
return self._cluster

def boundary_edges_vars(self):
"""
Expand Down Expand Up @@ -1578,7 +1578,7 @@ def arc_laurent_expansion(self, crossed_arcs, first_triangle=None,
``crossed_arcs`` is a list of labels
- ``return_labels`` -- (default: ``False``) allows the Laurent expansion
to be returned in terms of labels rather than variables
to be returned in terms of labels rather than variables
.. SEEALSO::
Expand Down Expand Up @@ -1744,12 +1744,12 @@ def arc_laurent_expansion(self, crossed_arcs, first_triangle=None,

#expansion = LaurentExpansionFromSurface(CT, crossed_arcs, first_triangle, final_triangle, True, False, verbose, CT._boundary_edges_vars, fig_size=fig_size)
#print expansion
# reverses the label -> variable dictionary so we can use it for substitution
#labelDict = {v:k for k,v in T._map_label_to_variable.items()}
#expansion = str(expansion)
#for key in labelDict.keys():
# expansion = expansion.replace(str(key),labelDict.get(key))
#return expansion
# reverses the label -> variable dictionary so we can use it for substitution
#labelDict = {v:k for k,v in T._map_label_to_variable.items()}
#expansion = str(expansion)
#for key in labelDict.keys():
# expansion = expansion.replace(str(key),labelDict.get(key))
#return expansion

def loop_laurent_expansion(self, crossed_arcs, first_triangle=None,
final_triangle=None, verbose=False,
Expand Down Expand Up @@ -1912,4 +1912,4 @@ def principal_extension(self,ignore_coefficients=False):
#seed = ClusterTriangulation( self, is_principal=is_principal )
seed = ClusterTriangulation( self._triangles, is_principal=is_principal, boundary_edges=self._boundary_edges ) # this will give initial cluster (x0,x1,..,xn) even if self has been mutated
seed._mutation_type = self._mutation_type
return seed
return seed
18 changes: 9 additions & 9 deletions src/sage/combinat/cluster_algebra_quiver/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,12 @@ def produce_dict_label_to_variable(T, cluster_xs, boundary_edges, boundary_edges
sage: from sage.combinat.cluster_algebra_quiver.surface import produce_dict_label_to_variable
sage: Triangles = [(1, 4, 7), (1, 2, 5), (6, 3, 0), (2, 0, 3), (0, 6, 3), [7, 1, 4]]
sage: T = ClusterTriangulation(Triangles)
sage: produce_dict_label_to_variable(T._triangles, T._cluster, T._boundary_edges, T._boundary_edges_vars)
sage: produce_dict_label_to_variable(T._triangles, T.cluster(), T._boundary_edges, T._boundary_edges_vars)
{0: x0, 1: x1, 2: x2, 3: x3, 4: x4, 5: x5, 6: x6, 7: x7}
sage: twice_punctured_bigon = [(1,1,2),(3,4,3),(2,4,0),(0,6,7)]
sage: T = ClusterTriangulation(twice_punctured_bigon)
sage: produce_dict_label_to_variable(T._triangles, T._cluster, T._boundary_edges, T._boundary_edges_vars)
sage: produce_dict_label_to_variable(T._triangles, T.cluster(), T._boundary_edges, T._boundary_edges_vars)
{0: x0, 1: x1, 2: x1*x2, 3: x3, 4: x3*x4, 6: x5, 7: x6}
sage: twice_punctured_bigon = [('e','d','a'), ('a','r','b'), ('r','d','g'), ('g','n','b')]
Expand Down Expand Up @@ -1017,7 +1017,7 @@ def LaurentExpansionFromSurface(CT, crossed_arcs, first_triangle=None,
sage: CT = ClusterTriangulation([(0,2,1),(0,4,3),(1,6,5)])
sage: S = ClusterSeed(CT)
sage: S1=S.mutate(0,inplace=False)
sage: S1._cluster
sage: S1.cluster()
[(x1*x3 + x2*x4)/x0, x1, x2, x3, x4, x5, x6]
sage: S1.cluster_variable(0) ==\
....: LaurentExpansionFromSurface(CT,[CT.cluster_variable(0)],None,None,\
Expand All @@ -1026,7 +1026,7 @@ def LaurentExpansionFromSurface(CT, crossed_arcs, first_triangle=None,
sage: SP = S.principal_extension()
sage: SP.mutate(0)
sage: SP._cluster
sage: SP.cluster()
[(x2*x4*y0 + x1*x3)/x0, x1, x2, x3, x4, x5, x6, y0, y1, y2, y3, y4, y5, y6]
sage: CTP = CT.principal_extension()
Expand Down Expand Up @@ -1171,13 +1171,13 @@ def replace_x_with_y(CT, G_x):
#print 'diagonal_x tuple: ', diagonal_x
label_of_radius_x = CT._get_map_variable_to_label(diagonal_x[0])
position_of_radius_x = CT.get_edge_position(label_of_radius_x)
radius_y = CT._cluster[CT._n+position_of_radius_x]
radius_y = CT.cluster()[CT._n+position_of_radius_x]

triangle_rrl = _get_triangle(CT.triangles(), label_of_radius_x, None)[0]
r,r,label_of_ell_x = is_selffolded(triangle_rrl)
position_of_ell_x = CT.get_edge_position(label_of_ell_x)

r_notched_y = CT._cluster[CT._n+position_of_ell_x]
r_notched_y = CT.cluster()[CT._n+position_of_ell_x]
diagonal_y = radius_y/r_notched_y
diagonal_y_bottom = (diagonal_y, diagonal_x[1])
if diagonal_x[1] == 'clockwise':
Expand All @@ -1195,13 +1195,13 @@ def replace_x_with_y(CT, G_x):
#label_of_x_r = CT._get_map_variable_to_label(x_r)
position_of_x_rnotched = CT.get_edge_position(label_of_x_ell)
#position_of_x_r = CT.get_edge_position(label_of_x_r)
y_rnotched = CT._cluster[CT._n+position_of_x_rnotched]
#y_r = CT._cluster[CT._n+position_of_x_r]
y_rnotched = CT.cluster()[CT._n+position_of_x_rnotched]
#y_r = CT.cluster()[CT._n+position_of_x_r]
diagonal_y_bottom = diagonal_y_top = y_rnotched
else:
label_of_diagonal_x = CT._get_map_variable_to_label(diagonal_x)
position_of_diagonal_x = CT.get_edge_position(label_of_diagonal_x)
diagonal_y_bottom = diagonal_y_top = CT._cluster[CT._n+position_of_diagonal_x]
diagonal_y_bottom = diagonal_y_top = CT.cluster()[CT._n+position_of_diagonal_x]

G_y_triangle_bottom = (G_x[tile_pos][0][0],(triangle_bottom[0], diagonal_y_bottom, triangle_bottom[2]))
G_y_triangle_top = (G_x[tile_pos][1][0],(triangle_top[0], diagonal_y_top, triangle_top[2]), tile_dir)
Expand Down

0 comments on commit 1b3c18c

Please sign in to comment.