# HG changeset patch
# User Gregg Musiker <musiker@math.mit.edu>
# Date 1364270348 18000
# Node ID a67adb86df7a546ba35da7047b5dd6f8c85aa36a
# Parent 6d4290ee4aa9aa712c10cdae467b6118e5747232
Fixed Sorting of Examples in mutation_type.py
diff git a/sage/combinat/cluster_algebra_quiver/mutation_type.py b/sage/combinat/cluster_algebra_quiver/mutation_type.py
a

b


1257  1257  sage: from sage.combinat.cluster_algebra_quiver.mutation_type import _mutation_type_test 
1258  1258  
1259  1259  sage: _mutation_type_test(2) # long time 
1260   True ('A', 2) 
1261  1260  True ('A', (1, 1), 1) 
 1261  True ('A', 2) 
1262  1262  True ('B', 2) 
1263  1263  True ('BC', 1, 1) 
1264  1264  True ('G', 2) 
1265  1265  
1266  1266  sage: _mutation_type_test(3) # long time 
 1267  True ('A', (2, 1), 1) 
1267  1268  True ('A', 3) 
1268   True ('A', (2, 1), 1) 
1269  1269  True ('B', 3) 
1270  1270  True ('BB', 2, 1) 
1271  1271  True ('BC', 2, 1) 
… 
… 

1275  1275  True ('G', 2, 1) 
1276  1276  
1277  1277  sage: _mutation_type_test(4) # long time 
1278   True ('A', 4) 
1279  1278  True ('A', (2, 2), 1) 
1280  1279  True ('A', (3, 1), 1) 
 1280  True ('A', 4) 
1281  1281  True ('B', 4) 
1282  1282  True ('BB', 3, 1) 
1283  1283  True ('BC', 3, 1) 
… 
… 

1288  1288  True ('D', 4) 
1289  1289  True ('F', 4) 
1290  1290  True ('G', 2, (1, 1)) 
 1291  True ('G', 2, (1, 3)) 
1291  1292  True ('G', 2, (3, 3)) 
1292   True ('G', 2, (1, 3)) 
1293  1293  
1294  1294  sage: _mutation_type_test(5) # long time 
1295   True ('A', 5) 
1296  1295  True ('A', (3, 2), 1) 
1297  1296  True ('A', (4, 1), 1) 
 1297  True ('A', 5) 
1298  1298  True ('B', 5) 
1299  1299  True ('BB', 4, 1) 
1300  1300  True ('BC', 4, 1) 
… 
… 

1304  1304  True ('CD', 4, 1) 
1305  1305  False ('D', 4, 1) 
1306  1306  True ('D', 5) 
 1307  True ('F', 4, 1) 
1307  1308  True ('F', 4, 1) 
1308   True ('F', 4, 1) 
1309  1309  """ 
1310  1310  from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _construct_classical_mutation_classes 
1311  1311  from sage.combinat.cluster_algebra_quiver.mutation_class import _dig6_to_matrix, _matrix_to_digraph, _digraph_mutate, _edge_list_to_matrix, _dig6_to_digraph 
1312  1312  from sage.combinat.cluster_algebra_quiver.quiver import ClusterQuiver 
1313  1313  data = _construct_classical_mutation_classes( n ) 
1314  1314  keys = data.keys() 
1315   keys.sort() 
1316   for mutation_type in keys: 
 1315  for mutation_type in sorted(keys, key=str): 
1317  1316  mt = QuiverMutationType( mutation_type ) 
1318  1317  print all( ClusterQuiver(_dig6_to_digraph(dig6)).mutation_type() == mt for dig6 in data[mutation_type]), mutation_type 
1319  1318  from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _construct_exceptional_mutation_classes 
1320  1319  data = _construct_exceptional_mutation_classes( n ) 
1321   for mutation_type in data: 
 1320  keys = data.keys() 
 1321  for mutation_type in sorted(keys, key=str): 
1322  1322  mt = QuiverMutationType( mutation_type ) 
1323  1323  print all( ClusterQuiver(_dig6_to_digraph(dig6)).mutation_type() == mt for dig6 in data[mutation_type]), mutation_type 
1324  1324  
… 
… 

1420  1420  
1421  1421  sage: from sage.combinat.cluster_algebra_quiver.mutation_type import _random_multi_tests 
1422  1422  sage: _random_multi_tests(2,100) # long time 
 1423  testing ('A', (1, 1), 1) 
1423  1424  testing ('A', 2) 
1424   testing ('A', (1, 1), 1) 
1425  1425  testing ('B', 2) 
1426  1426  testing ('BC', 1, 1) 
1427  1427  
1428  1428  sage: _random_multi_tests(3,100) # long time 
 1429  testing ('A', (2, 1), 1) 
1429  1430  testing ('A', 3) 
1430   testing ('A', (2, 1), 1) 
1431  1431  testing ('B', 3) 
1432  1432  testing ('BB', 2, 1) 
1433  1433  testing ('BC', 2, 1) 
… 
… 

1435  1435  testing ('CC', 2, 1) 
1436  1436  
1437  1437  sage: _random_multi_tests(4,100) # long time 
1438   testing ('A', 4) 
1439  1438  testing ('A', (2, 2), 1) 
1440  1439  testing ('A', (3, 1), 1) 
 1440  testing ('A', 4) 
1441  1441  testing ('B', 4) 
1442  1442  testing ('BB', 3, 1) 
1443  1443  testing ('BC', 3, 1) 
… 
… 

1449  1449  """ 
1450  1450  from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _construct_classical_mutation_classes 
1451  1451  mutation_classes = _construct_classical_mutation_classes( n ) 
1452   for mutation_type in sorted(mutation_classes): 
 1452  for mutation_type in sorted(mutation_classes, key=str): 
1453  1453  _random_tests( mutation_type, k, mut_class=mutation_classes[mutation_type], nr_mut=nr_mut ) 