Skip to content

Commit e6ac103

Browse files
author
Matthias Koeppe
committed
sage.combinat: Update # needs
1 parent 1a9086c commit e6ac103

File tree

7 files changed

+83
-67
lines changed

7 files changed

+83
-67
lines changed

src/sage/combinat/posets/lattices.py

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,8 +2298,8 @@ def is_orthocomplemented(self, unique=False):
22982298
sage: D6.is_orthocomplemented(unique=True) # needs sage.groups
22992299
False
23002300
2301-
sage: hexagon = LatticePoset({0:[1, 2], 1:[3], 2:[4], 3:[5], 4:[5]})
2302-
sage: hexagon.is_orthocomplemented(unique=True)
2301+
sage: hexagon = LatticePoset({0: [1, 2], 1: [3], 2: [4], 3:[5], 4: [5]})
2302+
sage: hexagon.is_orthocomplemented(unique=True) # needs sage.groups
23032303
True
23042304
23052305
.. SEEALSO::
@@ -4046,7 +4046,7 @@ def is_subdirectly_reducible(self, certificate=False):
40464046
40474047
TESTS::
40484048
4049-
sage: [posets.ChainPoset(i).is_subdirectly_reducible() for i in range(5)]
4049+
sage: [posets.ChainPoset(i).is_subdirectly_reducible() for i in range(5)] # needs sage.combinat
40504050
[False, False, False, True, True]
40514051
"""
40524052
H = self._hasse_diagram
@@ -4256,7 +4256,7 @@ def is_constructible_by_doublings(self, type) -> bool:
42564256
sage: L = L.day_doubling([(3,0), (1,1), (2,1)]) # An upper pseudo-interval
42574257
sage: L.is_constructible_by_doublings('upper')
42584258
False
4259-
sage: L.is_constructible_by_doublings('convex')
4259+
sage: L.is_constructible_by_doublings('convex') # needs sage.combinat
42604260
True
42614261
42624262
An example of a lattice that can be constructed by doublings
@@ -4378,18 +4378,20 @@ def is_isoform(self, certificate=False):
43784378
43794379
EXAMPLES::
43804380
4381-
sage: L = LatticePoset({1:[2, 3, 4], 2: [5, 6], 3: [6, 7], 4: [7], 5: [8], 6: [8], 7: [8]})
4382-
sage: L.is_isoform()
4381+
sage: L = LatticePoset({1: [2, 3, 4], 2: [5, 6], 3: [6, 7],
4382+
....: 4: [7], 5: [8], 6: [8], 7: [8]})
4383+
sage: L.is_isoform() # needs sage.combinat
43834384
True
43844385
43854386
Every isoform lattice is (trivially) uniform, but the converse is
43864387
not true::
43874388
4388-
sage: L = LatticePoset({1: [2, 3, 6], 2: [4, 5], 3: [5], 4: [9, 8], 5: [7, 8], 6: [9], 7: [10], 8: [10], 9: [10]})
4389-
sage: L.is_isoform(), L.is_uniform()
4389+
sage: L = LatticePoset({1: [2, 3, 6], 2: [4, 5], 3: [5], 4: [9, 8],
4390+
....: 5: [7, 8], 6: [9], 7: [10], 8: [10], 9: [10]})
4391+
sage: L.is_isoform(), L.is_uniform() # needs sage.combinat
43904392
(False, True)
43914393
4392-
sage: L.is_isoform(certificate=True)
4394+
sage: L.is_isoform(certificate=True) # needs sage.combinat
43934395
(False, {{1, 2, 4, 6, 9}, {3, 5, 7, 8, 10}})
43944396
43954397
.. SEEALSO::
@@ -4404,7 +4406,7 @@ def is_isoform(self, certificate=False):
44044406
sage: [posets.ChainPoset(i).is_isoform() for i in range(5)]
44054407
[True, True, True, False, False]
44064408
4407-
sage: posets.DiamondPoset(5).is_isoform() # Simple, so trivially isoform
4409+
sage: posets.DiamondPoset(5).is_isoform() # Simple, so trivially isoform # needs sage.combinat
44084410
True
44094411
"""
44104412
ok = (True, None) if certificate else True
@@ -4451,8 +4453,9 @@ def is_uniform(self, certificate=False):
44514453
44524454
EXAMPLES::
44534455
4454-
sage: L = LatticePoset({1: [2, 3, 4], 2: [6, 7], 3: [5], 4: [5], 5: [9, 8], 6: [9], 7: [10], 8: [10], 9: [10]})
4455-
sage: L.is_uniform()
4456+
sage: L = LatticePoset({1: [2, 3, 4], 2: [6, 7], 3: [5], 4: [5],
4457+
....: 5: [9, 8], 6: [9], 7: [10], 8: [10], 9: [10]})
4458+
sage: L.is_uniform() # needs sage.combinat
44564459
True
44574460
44584461
Every uniform lattice is regular, but the converse is not true::
@@ -4461,7 +4464,7 @@ def is_uniform(self, certificate=False):
44614464
sage: N6.is_uniform(), N6.is_regular()
44624465
(False, True)
44634466
4464-
sage: N6.is_uniform(certificate=True)
4467+
sage: N6.is_uniform(certificate=True) # needs sage.combinat
44654468
(False, {{1, 2, 3, 4}, {5, 6}})
44664469
44674470
.. SEEALSO::
@@ -4475,7 +4478,7 @@ def is_uniform(self, certificate=False):
44754478
sage: [posets.ChainPoset(i).is_uniform() for i in range(5)]
44764479
[True, True, True, False, False]
44774480
4478-
sage: posets.DiamondPoset(5).is_uniform() # Simple, so trivially uniform
4481+
sage: posets.DiamondPoset(5).is_uniform() # Simple, so trivially uniform # needs sage.combinat
44794482
True
44804483
"""
44814484
ok = (True, None) if certificate else True
@@ -4532,14 +4535,15 @@ def is_regular(self, certificate=False):
45324535
45334536
EXAMPLES::
45344537
4535-
sage: L = LatticePoset({1: [2, 3, 4], 2: [5, 6], 3: [8, 7], 4: [6, 7], 5: [8], 6: [9], 7: [9], 8: [9]})
4536-
sage: L.is_regular()
4538+
sage: L = LatticePoset({1: [2, 3, 4], 2: [5, 6], 3: [8, 7], 4: [6, 7],
4539+
....: 5: [8], 6: [9], 7: [9], 8: [9]})
4540+
sage: L.is_regular() # needs sage.combinat
45374541
True
45384542
45394543
sage: N5 = posets.PentagonPoset()
4540-
sage: N5.is_regular()
4544+
sage: N5.is_regular() # needs sage.combinat
45414545
False
4542-
sage: N5.is_regular(certificate=True)
4546+
sage: N5.is_regular(certificate=True) # needs sage.combinat
45434547
(False, ({{0}, {1}, {2, 3}, {4}}, [0]))
45444548
45454549
.. SEEALSO::
@@ -4552,7 +4556,7 @@ def is_regular(self, certificate=False):
45524556
45534557
TESTS::
45544558
4555-
sage: [posets.ChainPoset(i).is_regular() for i in range(5)]
4559+
sage: [posets.ChainPoset(i).is_regular() for i in range(5)] # needs sage.combinat
45564560
[True, True, True, False, False]
45574561
"""
45584562
ok = (True, None) if certificate else True
@@ -4598,6 +4602,7 @@ def is_simple(self, certificate=False):
45984602
45994603
EXAMPLES::
46004604
4605+
sage: # needs sage.combinat
46014606
sage: posets.DiamondPoset(5).is_simple() # Smallest nontrivial example
46024607
True
46034608
sage: L = LatticePoset({1: [2, 3], 2: [4, 5], 3: [6], 4: [6], 5: [6]})
@@ -4611,11 +4616,11 @@ def is_simple(self, certificate=False):
46114616
46124617
sage: L = LatticePoset({1: [2, 3, 4], 2: [5], 3: [5], 4: [6, 7],
46134618
....: 5: [8], 6: [8], 7: [8]})
4614-
sage: L.is_simple()
4619+
sage: L.is_simple() # needs sage.combinat
46154620
False
46164621
sage: L = LatticePoset({1: [2, 3], 2: [4, 5], 3: [6, 7], 4: [8],
46174622
....: 5: [8], 6: [8], 7: [8]})
4618-
sage: L.is_simple()
4623+
sage: L.is_simple() # needs sage.combinat
46194624
True
46204625
46214626
.. SEEALSO::
@@ -4652,9 +4657,10 @@ def subdirect_decomposition(self):
46524657
46534658
EXAMPLES::
46544659
4655-
sage: posets.ChainPoset(3).subdirect_decomposition()
4660+
sage: posets.ChainPoset(3).subdirect_decomposition() # needs sage.combinat
46564661
[Finite lattice containing 2 elements, Finite lattice containing 2 elements]
46574662
4663+
sage: # needs sage.combinat
46584664
sage: L = LatticePoset({1: [2, 4], 2: [3], 3: [6, 7], 4: [5, 7],
46594665
....: 5: [9, 8], 6: [9], 7: [9], 8: [10], 9: [10]})
46604666
sage: Ldecomp = L.subdirect_decomposition()
@@ -4665,6 +4671,7 @@ def subdirect_decomposition(self):
46654671
46664672
TESTS::
46674673
4674+
sage: # needs sage.combinat
46684675
sage: posets.ChainPoset(0).subdirect_decomposition()
46694676
[Finite lattice containing 0 elements]
46704677
sage: posets.ChainPoset(1).subdirect_decomposition()
@@ -4676,7 +4683,7 @@ def subdirect_decomposition(self):
46764683
has only one element::
46774684
46784685
sage: N5 = posets.PentagonPoset()
4679-
sage: N5.subdirect_decomposition()
4686+
sage: N5.subdirect_decomposition() # needs sage.combinat
46804687
[Finite lattice containing 5 elements]
46814688
"""
46824689
H = self._hasse_diagram
@@ -4737,6 +4744,7 @@ def congruence(self, S):
47374744
47384745
EXAMPLES::
47394746
4747+
sage: # needs sage.combinat
47404748
sage: L = posets.DivisorLattice(12)
47414749
sage: cong = L.congruence([[1, 3]])
47424750
sage: sorted(sorted(c) for c in cong)
@@ -4745,19 +4753,20 @@ def congruence(self, S):
47454753
{{1, 2, 4}, {3, 6, 12}}
47464754
47474755
sage: L = LatticePoset({1: [2, 3], 2: [4], 3: [4], 4: [5]})
4748-
sage: L.congruence([[1, 2]])
4756+
sage: L.congruence([[1, 2]]) # needs sage.combinat
47494757
{{1, 2}, {3, 4}, {5}}
47504758
47514759
sage: L = LatticePoset({1: [2, 3], 2: [4, 5, 6], 4: [5], 5: [7, 8],
47524760
....: 6: [8], 3: [9], 7: [10], 8: [10], 9:[10]})
4753-
sage: cong = L.congruence([[1, 2]])
4754-
sage: cong[0]
4761+
sage: cong = L.congruence([[1, 2]]) # needs sage.combinat
4762+
sage: cong[0] # needs sage.combinat
47554763
frozenset({1, 2, 3, 4, 5, 6, 7, 8, 9, 10})
47564764
47574765
.. SEEALSO:: :meth:`quotient`
47584766
47594767
TESTS::
47604768
4769+
sage: # needs sage.combinat
47614770
sage: P = posets.PentagonPoset()
47624771
sage: P.congruence([])
47634772
{{0}, {1}, {2}, {3}, {4}}
@@ -4774,13 +4783,13 @@ def congruence(self, S):
47744783
works::
47754784
47764785
sage: L = LatticePoset(DiGraph('P^??@_?@??B_?@??B??@_?@??B_?@??B??@??A??C??G??O???'))
4777-
sage: sorted(sorted(p) for p in L.congruence([[1,6]]))
4786+
sage: sorted(sorted(p) for p in L.congruence([[1,6]])) # needs sage.combinat
47784787
[[0], [1, 6], [2], [3, 8], [4], [5, 10], [7, 12], [9, 14], [11], [13], [15], [16]]
47794788
47804789
Simple lattice, i.e. a lattice without any nontrivial congruence::
47814790
47824791
sage: L = LatticePoset(DiGraph('GPb_@?OC@?O?'))
4783-
sage: L.congruence([[1,2]])
4792+
sage: L.congruence([[1,2]]) # needs sage.combinat
47844793
{{0, 1, 2, 3, 4, 5, 6, 7}}
47854794
"""
47864795
from sage.combinat.set_partition import SetPartition
@@ -4821,6 +4830,7 @@ def quotient(self, congruence, labels='tuple'):
48214830
48224831
EXAMPLES::
48234832
4833+
sage: # needs sage.combinat
48244834
sage: L = posets.PentagonPoset()
48254835
sage: c = L.congruence([[0, 1]])
48264836
sage: I = L.quotient(c); I
@@ -4831,6 +4841,7 @@ def quotient(self, congruence, labels='tuple'):
48314841
sage: I.top()
48324842
Finite lattice containing 3 elements
48334843
4844+
sage: # needs sage.combinat
48344845
sage: B3 = posets.BooleanLattice(3)
48354846
sage: c = B3.congruence([[0,1]])
48364847
sage: B2 = B3.quotient(c, labels='integer')
@@ -4846,7 +4857,7 @@ def quotient(self, congruence, labels='tuple'):
48464857
Finite lattice containing 0 elements
48474858
48484859
sage: L = posets.PentagonPoset()
4849-
sage: L.quotient(L.congruence([[1]])).is_isomorphic(L)
4860+
sage: L.quotient(L.congruence([[1]])).is_isomorphic(L) # needs sage.combinat
48504861
True
48514862
"""
48524863
if labels not in ['lattice', 'tuple', 'integer']:
@@ -4894,6 +4905,7 @@ def congruences_lattice(self, labels='congruence'):
48944905
48954906
EXAMPLES::
48964907
4908+
sage: # needs sage.combinat
48974909
sage: N5 = posets.PentagonPoset()
48984910
sage: CL = N5.congruences_lattice(); CL
48994911
Finite lattice containing 5 elements
@@ -4903,12 +4915,13 @@ def congruences_lattice(self, labels='congruence'):
49034915
[{{0, 1}, {2, 3, 4}}, {{0, 2, 3}, {1, 4}}]
49044916
49054917
sage: C4 = posets.ChainPoset(4)
4906-
sage: CL = C4.congruences_lattice(labels='integer')
4907-
sage: CL.is_isomorphic(posets.BooleanLattice(3))
4918+
sage: CL = C4.congruences_lattice(labels='integer') # needs sage.combinat
4919+
sage: CL.is_isomorphic(posets.BooleanLattice(3)) # needs sage.combinat
49084920
True
49094921
49104922
TESTS::
49114923
4924+
sage: # needs sage.combinat
49124925
sage: posets.ChainPoset(0).congruences_lattice()
49134926
Finite lattice containing 1 elements
49144927
sage: posets.ChainPoset(1).congruences_lattice()
@@ -5002,6 +5015,7 @@ def feichtner_yuzvinsky_ring(self, G, use_defining=False, base_ring=None):
50025015
50035016
We reproduce the example from Section 5 of [Coron2023]_::
50045017
5018+
sage: # needs sage.geometry.polyhedron
50055019
sage: H.<a,b,c,d> = HyperplaneArrangements(QQ)
50065020
sage: Arr = H(a-b, b-c, c-d, d-a)
50075021
sage: P = LatticePoset(Arr.intersection_poset())

src/sage/combinat/posets/posets.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,9 +3745,9 @@ def magnitude(self) -> Integer:
37453745
sage: P.magnitude() == m1*m2
37463746
True
37473747
3748-
sage: Poset({}).magnitude()
3748+
sage: Poset({}).magnitude() # needs sage.libs.flint
37493749
0
3750-
sage: Poset({1:[]}).magnitude()
3750+
sage: Poset({1: []}).magnitude() # needs sage.libs.flint
37513751
1
37523752
"""
37533753
H = self._hasse_diagram
@@ -4314,7 +4314,7 @@ def coxeter_transformation(self):
43144314
43154315
EXAMPLES::
43164316
4317-
sage: posets.PentagonPoset().coxeter_transformation()
4317+
sage: posets.PentagonPoset().coxeter_transformation() # needs sage.libs.flint
43184318
[ 0 0 0 0 -1]
43194319
[ 0 0 0 1 -1]
43204320
[ 0 1 0 0 -1]
@@ -4327,8 +4327,8 @@ def coxeter_transformation(self):
43274327
43284328
TESTS::
43294329
4330-
sage: M = posets.PentagonPoset().coxeter_transformation()
4331-
sage: M ** 8 == 1
4330+
sage: M = posets.PentagonPoset().coxeter_transformation() # needs sage.libs.flint
4331+
sage: M ** 8 == 1 # needs sage.libs.flint
43324332
True
43334333
"""
43344334
return self._hasse_diagram.coxeter_transformation()
@@ -4348,11 +4348,11 @@ def coxeter_polynomial(self):
43484348
EXAMPLES::
43494349
43504350
sage: P = posets.PentagonPoset()
4351-
sage: P.coxeter_polynomial()
4351+
sage: P.coxeter_polynomial() # needs sage.libs.flint
43524352
x^5 + x^4 + x + 1
43534353
43544354
sage: p = posets.SymmetricGroupWeakOrderPoset(3) # needs sage.groups
4355-
sage: p.coxeter_polynomial() # needs sage.groups
4355+
sage: p.coxeter_polynomial() # needs sage.groups sage.libs.flint
43564356
x^6 + x^5 - x^3 + x + 1
43574357
43584358
.. SEEALSO::
@@ -4398,7 +4398,7 @@ def coxeter_smith_form(self, algorithm='singular'):
43984398
TESTS::
43994399
44004400
sage: P = posets.PentagonPoset()
4401-
sage: P.coxeter_smith_form(algorithm='sage')
4401+
sage: P.coxeter_smith_form(algorithm='sage') # needs sage.libs.flint
44024402
[1, 1, 1, 1, x^5 + x^4 + x + 1]
44034403
sage: P.coxeter_smith_form(algorithm='gap') # needs sage.libs.gap
44044404
[1, 1, 1, 1, x^5 + x^4 + x + 1]
@@ -8099,33 +8099,33 @@ def is_eulerian(self, k=None, certificate=False):
80998099
81008100
sage: P = Poset({0: [1, 2, 3], 1: [4, 5], 2: [4, 6], 3: [5, 6],
81018101
....: 4: [7, 8], 5: [7, 8], 6: [7, 8], 7: [9], 8: [9]})
8102-
sage: P.is_eulerian()
8102+
sage: P.is_eulerian() # needs sage.libs.flint
81038103
True
81048104
sage: P = Poset({0: [1, 2, 3], 1: [4, 5, 6], 2: [4, 6], 3: [5,6],
81058105
....: 4: [7], 5:[7], 6:[7]})
8106-
sage: P.is_eulerian()
8106+
sage: P.is_eulerian() # needs sage.libs.flint
81078107
False
81088108
81098109
Canonical examples of Eulerian posets are the face lattices of
81108110
convex polytopes::
81118111
81128112
sage: P = polytopes.cube().face_lattice() # needs sage.geometry.polyhedron
8113-
sage: P.is_eulerian() # needs sage.geometry.polyhedron
8113+
sage: P.is_eulerian() # needs sage.geometry.polyhedron sage.libs.flint
81148114
True
81158115
81168116
A poset that is 3- but not 4-eulerian::
81178117
81188118
sage: P = Poset(DiGraph('MWW@_?W?@_?W??@??O@_?W?@_?W?@??O??')); P
81198119
Finite poset containing 14 elements
8120-
sage: P.is_eulerian(k=3)
8120+
sage: P.is_eulerian(k=3) # needs sage.libs.flint
81218121
True
8122-
sage: P.is_eulerian(k=4)
8122+
sage: P.is_eulerian(k=4) # needs sage.libs.flint
81238123
False
81248124
81258125
Getting an interval that is not Eulerian::
81268126
81278127
sage: P = posets.DivisorLattice(12)
8128-
sage: P.is_eulerian(certificate=True)
8128+
sage: P.is_eulerian(certificate=True) # needs sage.libs.flint
81298129
(False, (1, 4))
81308130
81318131
TESTS::
@@ -8143,7 +8143,7 @@ def is_eulerian(self, k=None, certificate=False):
81438143
...
81448144
ValueError: the poset is not graded
81458145
8146-
sage: posets.BooleanLattice(3).is_eulerian(k=123, certificate=True)
8146+
sage: posets.BooleanLattice(3).is_eulerian(k=123, certificate=True) # needs sage.libs.flint
81478147
(True, None)
81488148
"""
81498149
if k is not None:

src/sage/combinat/root_system/coxeter_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def CoxeterGroup(data, implementation="reflection", base_ring=None, index_set=No
116116
117117
TESTS::
118118
119-
sage: W = groups.misc.CoxeterGroup(["H",3]) # needs sage.groups
119+
sage: W = groups.misc.CoxeterGroup(["H",3]) # needs sage.graphs sage.groups
120120
"""
121121
if implementation not in ["permutation", "matrix", "coxeter3", "reflection", "chevie", None]:
122122
raise ValueError("invalid type implementation")

0 commit comments

Comments
 (0)