Skip to content

Commit abdcae8

Browse files
author
Matthias Koeppe
committed
sage.graphs: Use yet more block # needs
1 parent db061a9 commit abdcae8

File tree

7 files changed

+224
-194
lines changed

7 files changed

+224
-194
lines changed

src/sage/graphs/generators/classical_geometries.py

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,8 @@ def SymplecticPolarGraph(d, q, algorithm=None):
6767
(40, 12, 2, 4)
6868
sage: O.is_isomorphic(G)
6969
False
70-
sage: O.is_isomorphic(G) # optional - GOT (with --distribution 'sagemath-graphs[modules]')
71-
Traceback (most recent call last):
72-
...
73-
File "<doctest...>", line 1, in <module>
74-
O.is_isomorphic(G)
75-
AttributeError: 'function' object has no attribute 'is_isomorphic'
76-
sage: S = graphs.SymplecticPolarGraph(6,4,algorithm="gap") # not tested (long time), needs sage.libs.gap
77-
sage: S.is_strongly_regular(parameters=True) # not tested (long time) # needs sage.libs.gap
70+
sage: S = graphs.SymplecticPolarGraph(6, 4, algorithm="gap") # not tested (long time)
71+
sage: S.is_strongly_regular(parameters=True) # not tested (long time)
7872
(1365, 340, 83, 85)
7973
8074
TESTS::
@@ -273,7 +267,7 @@ def _orthogonal_polar_graph(m, q, sign="+", point_type=[0]):
273267
`NO^{-,\perp}(5,5)`::
274268
275269
sage: g = _orthogonal_polar_graph(5,5,point_type=[2,3]) # long time, needs sage.libs.gap
276-
sage: g.is_strongly_regular(parameters=True) # long time # needs sage.libs.gap
270+
sage: g.is_strongly_regular(parameters=True) # long time, needs sage.libs.gap
277271
(300, 65, 10, 15)
278272
279273
`NO^{+,\perp}(5,5)`::
@@ -487,19 +481,22 @@ def NonisotropicOrthogonalPolarGraph(m, q, sign="+", perp=None):
487481
NO^-,perp(3, 5): Graph on 10 vertices
488482
sage: g.is_strongly_regular(parameters=True)
489483
(10, 3, 0, 1)
490-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,3,'+') # long time, needs sage.libs.gap
491-
sage: g.is_strongly_regular(parameters=True) # long time # needs sage.libs.gap
484+
485+
sage: # long time, needs sage.libs.gap
486+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,3,'+')
487+
sage: g.is_strongly_regular(parameters=True)
492488
(117, 36, 15, 9)
493-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,3,'-'); g # long time
489+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,3,'-'); g
494490
NO^-(6, 3): Graph on 126 vertices
495-
sage: g.is_strongly_regular(parameters=True) # long time # needs sage.libs.gap
491+
sage: g.is_strongly_regular(parameters=True)
496492
(126, 45, 12, 18)
497-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,5,'-') # long time, needs sage.libs.gap
498-
sage: g.is_strongly_regular(parameters=True) # long time # needs sage.libs.gap
493+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,5,'-')
494+
sage: g.is_strongly_regular(parameters=True)
499495
(300, 104, 28, 40)
500-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,5,'+') # long time, needs sage.libs.gap
501-
sage: g.is_strongly_regular(parameters=True) # long time # needs sage.libs.gap
496+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,5,'+')
497+
sage: g.is_strongly_regular(parameters=True)
502498
(325, 144, 68, 60)
499+
503500
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,4,'+')
504501
Traceback (most recent call last):
505502
...
@@ -871,11 +868,11 @@ def TaylorTwographDescendantSRG(q, clique_partition=False):
871868
sage: g.is_strongly_regular(parameters=True)
872869
(27, 10, 1, 5)
873870
sage: from sage.combinat.designs.twographs import taylor_twograph
874-
sage: T = taylor_twograph(3) # long time # needs sage.rings.finite_rings
875-
sage: g.is_isomorphic(T.descendant(T.ground_set()[1])) # long time # needs sage.rings.finite_rings
871+
sage: T = taylor_twograph(3) # long time
872+
sage: g.is_isomorphic(T.descendant(T.ground_set()[1])) # long time
876873
True
877-
sage: g = graphs.TaylorTwographDescendantSRG(5) # not tested (long time)
878-
sage: g.is_strongly_regular(parameters=True) # not tested (long time)
874+
sage: g = graphs.TaylorTwographDescendantSRG(5) # not tested (long time)
875+
sage: g.is_strongly_regular(parameters=True) # not tested (long time)
879876
(125, 52, 15, 26)
880877
881878
TESTS::
@@ -1198,7 +1195,7 @@ def HaemersGraph(q, hyperoval=None, hyperoval_matching=None, field=None, check_h
11981195
...
11991196
RuntimeError: incorrect hyperoval
12001197
1201-
sage: g = graphs.HaemersGraph(8); g # not tested (long time) # needs sage.rings.finite_rings
1198+
sage: g = graphs.HaemersGraph(8); g # not tested (long time) # needs sage.rings.finite_rings
12021199
Haemers(8): Graph on 640 vertices
12031200
sage: g.is_strongly_regular(parameters=True) # not tested (long time) # needs sage.rings.finite_rings
12041201
(640, 71, 6, 8)
@@ -1498,9 +1495,9 @@ def OrthogonalDualPolarGraph(e, d, q):
14981495
sage: G.is_distance_regular(True)
14991496
([7, 6, 4, None], [None, 1, 3, 7])
15001497
sage: G = graphs.OrthogonalDualPolarGraph(0,3,3) # long time
1501-
sage: G.is_distance_regular(True) # long time
1498+
sage: G.is_distance_regular(True) # long time
15021499
([39, 36, 27, None], [None, 1, 4, 13])
1503-
sage: G.order() # long time
1500+
sage: G.order() # long time
15041501
1120
15051502
15061503
REFERENCES:
@@ -1514,7 +1511,7 @@ def OrthogonalDualPolarGraph(e, d, q):
15141511
sage: G.is_distance_regular(True)
15151512
([14, 12, 8, None], [None, 1, 3, 7])
15161513
sage: G = graphs.OrthogonalDualPolarGraph(-1,3,2) # long time
1517-
sage: G.is_distance_regular(True) # long time
1514+
sage: G.is_distance_regular(True) # long time
15181515
([28, 24, 16, None], [None, 1, 3, 7])
15191516
sage: G = graphs.OrthogonalDualPolarGraph(1,3,4)
15201517
sage: G.is_distance_regular(True)

src/sage/graphs/generators/distance_regular.pyx

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,15 +1418,16 @@ def GeneralisedOctagonGraph(const int s, const int t):
14181418
14191419
EXAMPLES::
14201420
1421-
sage: G = graphs.GeneralisedOctagonGraph(1, 4) # needs sage.libs.gap
1422-
sage: G.is_distance_regular(True) # needs sage.libs.gap
1423-
([5, 4, 4, 4, None], [None, 1, 1, 1, 5])
1424-
sage: G = graphs.GeneralisedOctagonGraph(2, 4) # optional - gap_packages internet
1425-
sage: G.is_distance_regular(True) # optional - gap_packages internet
1426-
([10, 8, 8, 8, None], [None, 1, 1, 1, 5])
1427-
sage: G = graphs.GeneralisedOctagonGraph(5, 1) # needs sage.libs.gap
1428-
sage: G.is_distance_regular(True) # needs sage.libs.gap
1429-
([10, 5, 5, 5, None], [None, 1, 1, 1, 2])
1421+
sage: # needs sage.libs.gap
1422+
sage: G = graphs.GeneralisedOctagonGraph(1, 4)
1423+
sage: G.is_distance_regular(True)
1424+
([5, 4, 4, 4, None], [None, 1, 1, 1, 5])
1425+
sage: G = graphs.GeneralisedOctagonGraph(2, 4) # optional - gap_packages internet
1426+
sage: G.is_distance_regular(True) # optional - gap_packages internet
1427+
([10, 8, 8, 8, None], [None, 1, 1, 1, 5])
1428+
sage: G = graphs.GeneralisedOctagonGraph(5, 1)
1429+
sage: G.is_distance_regular(True)
1430+
([10, 5, 5, 5, None], [None, 1, 1, 1, 2])
14301431
14311432
.. NOTE::
14321433
@@ -1528,13 +1529,14 @@ def GeneralisedHexagonGraph(const int s, const int t):
15281529
15291530
EXAMPLES::
15301531
1532+
sage: # needs sage.libs.gap
15311533
sage: G = graphs.GeneralisedHexagonGraph(5, 5) # optional - gap_packages internet
15321534
sage: G.is_distance_regular(True) # optional - gap_packages internet
15331535
([30, 25, 25, None], [None, 1, 1, 6])
1534-
sage: G = graphs.GeneralisedHexagonGraph(7, 1) # needs sage.libs.gap
1535-
sage: G.is_distance_regular(True) # needs sage.libs.gap
1536+
sage: G = graphs.GeneralisedHexagonGraph(7, 1)
1537+
sage: G.is_distance_regular(True)
15361538
([14, 7, 7, None], [None, 1, 1, 2])
1537-
sage: graphs.GeneralisedHexagonGraph(1, 1) # needs sage.libs.gap
1539+
sage: graphs.GeneralisedHexagonGraph(1, 1)
15381540
Cycle graph: Graph on 6 vertices
15391541
15401542
.. NOTE::
@@ -1752,16 +1754,17 @@ def _line_graph_generalised_polygon(H):
17521754
17531755
EXAMPLES::
17541756
1755-
sage: from sage.graphs.generators.distance_regular import \
1756-
....: _line_graph_generalised_polygon
1757-
sage: G = graphs.GeneralisedHexagonGraph(1, 8) # needs sage.libs.gap
1758-
sage: H = _line_graph_generalised_polygon(G) # needs sage.libs.gap
1759-
sage: H.is_distance_regular(True) # needs sage.libs.gap
1760-
([16, 8, 8, None], [None, 1, 1, 2])
1761-
sage: G = graphs.GeneralisedHexagonGraph(3, 3) # optional - gap_packages internet
1762-
sage: H = _line_graph_generalised_polygon(G) # optional - gap_packages internet
1763-
sage: G.is_isomorphic(H) # optional - gap_packages internet
1764-
True
1757+
sage: # needs sage.libs.gap
1758+
sage: from sage.graphs.generators.distance_regular import \
1759+
....: _line_graph_generalised_polygon
1760+
sage: G = graphs.GeneralisedHexagonGraph(1, 8)
1761+
sage: H = _line_graph_generalised_polygon(G)
1762+
sage: H.is_distance_regular(True)
1763+
([16, 8, 8, None], [None, 1, 1, 2])
1764+
sage: G = graphs.GeneralisedHexagonGraph(3, 3) # optional - gap_packages internet
1765+
sage: H = _line_graph_generalised_polygon(G) # optional - gap_packages internet
1766+
sage: G.is_isomorphic(H) # optional - gap_packages internet
1767+
True
17651768
17661769
REFERENCES:
17671770
@@ -2416,19 +2419,20 @@ def is_near_polygon(array):
24162419
24172420
TESTS::
24182421
2422+
sage: # needs sage.combinat sage.libs.pari
24192423
sage: from sage.graphs.generators.distance_regular import (
24202424
....: is_near_polygon, near_polygon_graph)
2421-
sage: is_near_polygon([7, 6, 6, 4, 4, 1, 1, 3, 3, 7]) # needs sage.combinat sage.libs.pari
2425+
sage: is_near_polygon([7, 6, 6, 4, 4, 1, 1, 3, 3, 7])
24222426
(4, (2, 2))
24232427
sage: near_polygon_graph(4, (2, 2))
24242428
Double Grassmann graph (5, 2, 2): Graph on 310 vertices
2425-
sage: near_polygon_graph(*is_near_polygon([3, 2, 2, 1, 1, 3])) # needs sage.combinat sage.rings.finite_rings
2429+
sage: near_polygon_graph(*is_near_polygon([3, 2, 2, 1, 1, 3])) # needs sage.rings.finite_rings
24262430
Generalised hexagon of order (1, 2): Graph on 14 vertices
2427-
sage: is_near_polygon([16, 12, 8, 4, 1, 2, 3, 4]) # needs sage.combinat sage.libs.pari
2431+
sage: is_near_polygon([16, 12, 8, 4, 1, 2, 3, 4])
24282432
(6, (4, 5))
2429-
sage: is_near_polygon([]) # needs sage.combinat sage.libs.pari
2433+
sage: is_near_polygon([])
24302434
False
2431-
sage: is_near_polygon([25, 16, 9, 4, 1, 1, 4, 9, 16, 25]) # JohnsonGraph # needs sage.combinat sage.libs.pari
2435+
sage: is_near_polygon([25, 16, 9, 4, 1, 1, 4, 9, 16, 25]) # JohnsonGraph
24322436
False
24332437
"""
24342438
from sage.arith.misc import is_prime_power
@@ -2719,21 +2723,23 @@ def distance_regular_graph(list arr, existence=False, check=True):
27192723
TESTS::
27202724
27212725
sage: graphs.distance_regular_graph([3, 2, 2, 1, 1, 1, 1, 2, 2, 3], # needs sage.combinat
2722-
....: existence=True)
2726+
....: existence=True)
27232727
True
27242728
sage: graphs.distance_regular_graph([3, 2, 2, 1, 2, 1, 1, 2, 2, 3],
2725-
....: existence=True)
2729+
....: existence=True)
27262730
False
27272731
sage: graphs.distance_regular_graph([18, 16, 16, 1, 1, 9]) # optional - internet gap_packages
27282732
Generalised hexagon of order (2, 8): Graph on 819 vertices
2729-
sage: graphs.distance_regular_graph([14, 12, 10, 8, 6, 4, 2, # needs sage.combinat
2730-
....: 1, 2, 3, 4, 5, 6, 7])
2733+
2734+
sage: # needs sage.combinat
2735+
sage: graphs.distance_regular_graph([14, 12, 10, 8, 6, 4, 2,
2736+
....: 1, 2, 3, 4, 5, 6, 7])
27312737
Hamming Graph with parameters 7,3: Graph on 2187 vertices
2732-
sage: graphs.distance_regular_graph([66, 45, 28, 1, 6, 30]) # needs sage.combinat
2738+
sage: graphs.distance_regular_graph([66, 45, 28, 1, 6, 30])
27332739
Graph on 1024 vertices
2734-
sage: graphs.distance_regular_graph([6,5,5,5,1,1,1,6]) # needs sage.combinat
2740+
sage: graphs.distance_regular_graph([6,5,5,5,1,1,1,6])
27352741
Generalised octagon of order (1, 5): Graph on 312 vertices
2736-
sage: graphs.distance_regular_graph([64, 60, 1, 1, 15, 64], check=True) # needs sage.combinat
2742+
sage: graphs.distance_regular_graph([64, 60, 1, 1, 15, 64], check=True)
27372743
Graph on 325 vertices
27382744
"""
27392745
from sage.misc.unknown import Unknown

0 commit comments

Comments
 (0)