Skip to content

Commit 5f56f5e

Browse files
committed
PR #35891: fix issues in combinat
1 parent 34d9c98 commit 5f56f5e

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def irreducible_component_index_sets(self):
766766
for i,j in itertools.combinations(I,2)
767767
if s[i]*s[j] != s[j]*s[i] ]],
768768
format="vertices_and_edges")
769-
return G.connected_components()
769+
return G.connected_components(sort=False)
770770

771771
@abstract_method(optional=True)
772772
def irreducible_components(self):

src/sage/categories/loop_crystals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ def one_dimensional_configuration_sum(self, q=None, group_components=True):
868868
B = P0.algebra(q.parent())
869869
if group_components:
870870
G = self.digraph(index_set=self.cartan_type().classical().index_set())
871-
C = G.connected_components()
871+
C = G.connected_components(sort=False)
872872
return B.sum(q**(c[0].energy_function())*B.sum(B(P0(b.weight())) for b in c)
873873
for c in C)
874874
return B.sum(q**(b.energy_function())*B(P0(b.weight())) for b in self)

src/sage/combinat/cluster_algebra_quiver/mutation_type.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ def _connected_mutation_type_AAtildeD(dg, ret_conn_vert=False):
895895
dg_tmp = DiGraph( dg )
896896
dg_tmp.delete_vertices( c1 )
897897

898-
components = dg_tmp.connected_components()
898+
components = dg_tmp.connected_components(sort=False)
899899
# if not len(components) == 2:
900900
if len(components) != 2:
901901
return _false_return(4)
@@ -937,7 +937,7 @@ def _connected_mutation_type_AAtildeD(dg, ret_conn_vert=False):
937937
else:
938938
c2.reverse()
939939
dg_tmp.delete_edge( tuple( c2 ) )
940-
components = dg_tmp.connected_components()
940+
components = dg_tmp.connected_components(sort=False)
941941
if len(components) != 2:
942942
return _false_return(7)
943943
else:
@@ -1189,7 +1189,7 @@ def _connected_mutation_type_AAtildeD(dg, ret_conn_vert=False):
11891189
edge = long_cycle[0][0]
11901190
sg = DiGraph( dg )
11911191
sg. delete_vertices(edge)
1192-
connected_components = sg.connected_components()
1192+
connected_components = sg.connected_components(sort=False)
11931193
cycle = []
11941194
if connected_components:
11951195
cycle.append( ( edge[0], edge[1], len( connected_components[0] ) + 1 ) )
@@ -1199,7 +1199,7 @@ def _connected_mutation_type_AAtildeD(dg, ret_conn_vert=False):
11991199
for edge in tmp:
12001200
sg = DiGraph( dg )
12011201
sg. delete_vertices(edge)
1202-
connected_components = sg.connected_components()
1202+
connected_components = sg.connected_components(sort=False)
12031203
if len( connected_components ) == 2:
12041204
#if len( list_intersection( [ connected_components[0], list_substract( long_cycle[0], [edge] )[0] ] ) ) > 0:
12051205
if len( set(connected_components[0]).intersection( set(long_cycle[0]).difference([edge]).pop() ) ) > 0:

src/sage/combinat/cluster_algebra_quiver/quiver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ def mutation_type(self):
10041004

10051005
# checking the type for each connected component
10061006
mutation_type = []
1007-
connected_components = sorted(dg.connected_components())
1007+
connected_components = sorted(dg.connected_components(sort=False))
10081008
for component in connected_components:
10091009
# constructing the digraph for this component
10101010
dg_component = dg.subgraph( component )
@@ -1154,7 +1154,7 @@ def canonical_label(self, certificate=False):
11541154
if dg.is_connected():
11551155
Q._mutation_type = self._mutation_type
11561156
else:
1157-
CC = sorted( self._digraph.connected_components() )
1157+
CC = sorted(self._digraph.connected_components(sort=False))
11581158
CC_new = sorted(zip([sorted(iso[i] for i in L) for L in CC],
11591159
range(len(CC))))
11601160
comp_iso = [L[1] for L in CC_new]

src/sage/combinat/constellation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ def connected_components(self):
475475
G.add_vertices(list(range(self.degree())))
476476
for p in self._g:
477477
G.add_edges(enumerate(p.domain()), loops=False)
478-
m = G.connected_components()
478+
m = G.connected_components(sort=False)
479479
if len(m) == 1:
480480
return [self]
481481
for mm in m:

src/sage/combinat/crystals/littelmann_path.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ def weight(x):
809809
return P0.sum(int(c)*P0.basis()[i] for i,c in w if i in P0.index_set())
810810
if group_components:
811811
G = self.digraph(index_set=self.cartan_type().classical().index_set())
812-
C = G.connected_components()
812+
C = G.connected_components(sort=False)
813813
return sum(q**(c[0].energy_function())*B.sum(B(weight(b)) for b in c) for c in C)
814814
return B.sum(q**(b.energy_function())*B(weight(b)) for b in self)
815815

@@ -1081,7 +1081,7 @@ def energy_function(self):
10811081
sage: La = R.weight_space().basis()
10821082
sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]+La[2])
10831083
sage: G = LS.digraph(index_set=[1,2])
1084-
sage: C = G.connected_components()
1084+
sage: C = G.connected_components(sort=False)
10851085
sage: [all(c[0].energy_function()==a.energy_function() for a in c) for c in C]
10861086
[True, True, True, True]
10871087
@@ -1093,15 +1093,15 @@ def energy_function(self):
10931093
sage: [(x.weight(), x.energy_function()) for x in hw]
10941094
[(-2*Lambda[0] + Lambda[2], 0), (-2*Lambda[0] + Lambda[1], 1), (0, 2)]
10951095
sage: G = LS.digraph(index_set=J)
1096-
sage: C = G.connected_components()
1096+
sage: C = G.connected_components(sort=False)
10971097
sage: [all(c[0].energy_function()==a.energy_function() for a in c) for c in C]
10981098
[True, True, True]
10991099
11001100
sage: R = RootSystem(CartanType(['G',2,1]).dual())
11011101
sage: La = R.weight_space().basis()
11021102
sage: LS = crystals.ProjectedLevelZeroLSPaths(La[1]+La[2])
11031103
sage: G = LS.digraph(index_set=[1,2])
1104-
sage: C = G.connected_components()
1104+
sage: C = G.connected_components(sort=False)
11051105
sage: [all(c[0].energy_function()==a.energy_function() for a in c) for c in C] # long time
11061106
[True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]
11071107
@@ -1110,15 +1110,15 @@ def energy_function(self):
11101110
sage: La = R.weight_space().basis()
11111111
sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]+La[2])
11121112
sage: G = LS.digraph(index_set=R.cartan_type().classical().index_set())
1113-
sage: C = G.connected_components()
1113+
sage: C = G.connected_components(sort=False)
11141114
sage: [all(c[0].energy_function()==a.energy_function() for a in c) for c in C] # long time
11151115
[True, True, True, True, True, True, True, True, True, True, True]
11161116
11171117
sage: R = RootSystem(['BC',2,2])
11181118
sage: La = R.weight_space().basis()
11191119
sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]+La[2])
11201120
sage: G = LS.digraph(index_set=R.cartan_type().classical().index_set())
1121-
sage: C = G.connected_components()
1121+
sage: C = G.connected_components(sort=False)
11221122
sage: [all(c[0].energy_function()==a.energy_function() for a in c) for c in C] # long time
11231123
[True, True, True, True, True, True, True, True, True, True, True, True, True, True, True,
11241124
True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]

src/sage/combinat/partition_algebra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ def set_partition_composition(sp1, sp2):
19741974
True
19751975
"""
19761976
g = pair_to_graph(sp1, sp2)
1977-
connected_components = g.connected_components()
1977+
connected_components = g.connected_components(sort=False)
19781978

19791979
res = []
19801980
total_removed = 0

src/sage/combinat/posets/mobile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _is_valid_ribbon(self, ribbon):
123123
continue
124124

125125
G_un.delete_edge(lc, r)
126-
P = Poset(G.subgraph(G_un.connected_component_containing_vertex(lc)))
126+
P = Poset(G.subgraph(G_un.connected_component_containing_vertex(lc, sort=False)))
127127
if P.top() != lc or not P.is_d_complete():
128128
return False
129129
G_un.add_edge(lc, r)

src/sage/combinat/posets/posets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,11 +1368,11 @@ def _latex_(self):
13681368
EXAMPLES::
13691369
13701370
sage: P = Poset(([1,2], [[1,2]]), cover_relations = True)
1371-
sage: print(P._latex_()) #optional - dot2tex graphviz
1371+
sage: print(P._latex_()) # optional - dot2tex graphviz
13721372
\begin{tikzpicture}[>=latex,line join=bevel,]
13731373
%%
1374-
\node (node_...) at (6.0...bp,...bp) [draw,draw=none] {$...$};
1375-
\node (node_...) at (6.0...bp,...bp) [draw,draw=none] {$...$};
1374+
\node (node_...) at (5...bp,...bp) [draw,draw=none] {$...$};
1375+
\node (node_...) at (5...bp,...bp) [draw,draw=none] {$...$};
13761376
\draw [black,->] (node_...) ..controls (...bp,...bp) and (...bp,...bp) .. (node_...);
13771377
%
13781378
\end{tikzpicture}
@@ -5330,7 +5330,7 @@ def edge_color(va, vb):
53305330

53315331
fusion = fusion.transitive_closure()
53325332
resu = []
5333-
for s in fusion.connected_components():
5333+
for s in fusion.connected_components(sort=False):
53345334
subg = [x for x in prod_dg if all(x[i] == v0[i] for i in factors_range
53355335
if i not in s)]
53365336
resu.append(Poset(prod_dg.subgraph(subg)))

src/sage/combinat/root_system/ambient_space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _test_norm_of_simple_roots(self, **options):
119119
T = self.cartan_type()
120120
D = T.symmetrizer()
121121
alpha = self.simple_roots()
122-
for C in T.dynkin_diagram().connected_components():
122+
for C in T.dynkin_diagram().connected_components(sort=False):
123123
tester.assertEqual(len( set( alpha[i].scalar(alpha[i]) / D[i] for i in C ) ), 1)
124124

125125
# FIXME: attribute or method?

0 commit comments

Comments
 (0)