Skip to content

Commit ce9e367

Browse files
author
Matthias Koeppe
committed
src/sage/graphs/generators/classical_geometries.py: Fix up # needs
1 parent b0be9aa commit ce9e367

File tree

1 file changed

+71
-72
lines changed

1 file changed

+71
-72
lines changed

src/sage/graphs/generators/classical_geometries.py

Lines changed: 71 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def SymplecticPolarGraph(d, q, algorithm=None):
4848
4949
Computation of the spectrum of `Sp(6,2)`::
5050
51-
sage: g = graphs.SymplecticPolarGraph(6,2)
51+
sage: g = graphs.SymplecticPolarGraph(6, 2)
5252
sage: g.is_strongly_regular(parameters=True)
5353
(63, 30, 13, 15)
5454
sage: set(g.spectrum()) == {-5, 3, 30} # needs sage.rings.number_field
@@ -57,28 +57,18 @@ def SymplecticPolarGraph(d, q, algorithm=None):
5757
The parameters of `Sp(4,q)` are the same as of `O(5,q)`, but they are
5858
not isomorphic if `q` is odd::
5959
60-
sage: G = graphs.SymplecticPolarGraph(4,3)
60+
sage: G = graphs.SymplecticPolarGraph(4, 3)
6161
sage: G.is_strongly_regular(parameters=True)
6262
(40, 12, 2, 4)
63-
sage: O = graphs.OrthogonalPolarGraph(5,3) # needs sage.libs.gap
64-
sage: O.is_strongly_regular(parameters=True) # optional - EXPECTED
63+
64+
sage: # needs sage.libs.gap
65+
sage: O = graphs.OrthogonalPolarGraph(5, 3)
66+
sage: O.is_strongly_regular(parameters=True)
6567
(40, 12, 2, 4)
66-
sage: O.is_strongly_regular(parameters=True) # optional - GOT (with --distribution 'sagemath-graphs[modules]')
67-
Traceback (most recent call last):
68-
...
69-
File "<doctest...>", line 1, in <module>
70-
O.is_strongly_regular(parameters=True)
71-
AttributeError: 'function' object has no attribute 'is_strongly_regular'
72-
sage: O.is_isomorphic(G) # optional - EXPECTED
68+
sage: O.is_isomorphic(G)
7369
False
74-
sage: O.is_isomorphic(G) # optional - GOT (with --distribution 'sagemath-graphs[modules]')
75-
Traceback (most recent call last):
76-
...
77-
File "<doctest...>", line 1, in <module>
78-
O.is_isomorphic(G)
79-
AttributeError: 'function' object has no attribute 'is_isomorphic'
80-
sage: S = graphs.SymplecticPolarGraph(6,4,algorithm="gap") # not tested (long time), needs sage.libs.gap
81-
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)
8272
(1365, 340, 83, 85)
8373
8474
TESTS::
@@ -160,30 +150,32 @@ def AffineOrthogonalPolarGraph(d, q, sign="+"):
160150
`VO^-(4,3)`::
161151
162152
sage: g = graphs.AffineOrthogonalPolarGraph(4,3,"-") # needs sage.libs.gap
163-
sage: g.is_isomorphic(graphs.BrouwerHaemersGraph()) # optional - NameError: 'g' (with --distribution 'sagemath-graphs[modules]')
153+
sage: g.is_isomorphic(graphs.BrouwerHaemersGraph()) # needs sage.libs.gap
164154
True
165155
166156
Some examples from `Brouwer's table or strongly regular graphs
167157
<https://www.win.tue.nl/~aeb/graphs/srg/srgtab.html>`_::
168158
169-
sage: g = graphs.AffineOrthogonalPolarGraph(6,2,"-"); g # needs sage.libs.gap
159+
sage: # needs sage.libs.gap
160+
sage: g = graphs.AffineOrthogonalPolarGraph(6,2,"-"); g
170161
Affine Polar Graph VO^-(6,2): Graph on 64 vertices
171-
sage: g.is_strongly_regular(parameters=True) # optional - NameError: 'g' (with --distribution 'sagemath-graphs[modules]')
162+
sage: g.is_strongly_regular(parameters=True)
172163
(64, 27, 10, 12)
173-
sage: g = graphs.AffineOrthogonalPolarGraph(6,2,"+"); g # needs sage.libs.gap
164+
sage: g = graphs.AffineOrthogonalPolarGraph(6,2,"+"); g
174165
Affine Polar Graph VO^+(6,2): Graph on 64 vertices
175-
sage: g.is_strongly_regular(parameters=True) # optional - NameError: 'g' (with --distribution 'sagemath-graphs[modules]')
166+
sage: g.is_strongly_regular(parameters=True)
176167
(64, 35, 18, 20)
177168
178169
When ``sign is None``::
179170
180-
sage: g = graphs.AffineOrthogonalPolarGraph(5,2,None); g # needs sage.libs.gap
171+
sage: # needs sage.libs.gap
172+
sage: g = graphs.AffineOrthogonalPolarGraph(5,2,None); g
181173
Affine Polar Graph VO^-(5,2): Graph on 32 vertices
182-
sage: g.is_strongly_regular(parameters=True) # optional - NameError: 'g' (with --distribution 'sagemath-graphs[modules]')
174+
sage: g.is_strongly_regular(parameters=True)
183175
False
184-
sage: g.is_regular() # optional - NameError: 'g' (with --distribution 'sagemath-graphs[modules]')
176+
sage: g.is_regular()
185177
True
186-
sage: g.is_vertex_transitive() # optional - NameError: 'g' (with --distribution 'sagemath-graphs[modules]')
178+
sage: g.is_vertex_transitive()
187179
True
188180
"""
189181
if sign in ["+", "-"]:
@@ -275,7 +267,7 @@ def _orthogonal_polar_graph(m, q, sign="+", point_type=[0]):
275267
`NO^{-,\perp}(5,5)`::
276268
277269
sage: g = _orthogonal_polar_graph(5,5,point_type=[2,3]) # long time, needs sage.libs.gap
278-
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
279271
(300, 65, 10, 15)
280272
281273
`NO^{+,\perp}(5,5)`::
@@ -465,11 +457,12 @@ def NonisotropicOrthogonalPolarGraph(m, q, sign="+", perp=None):
465457
466458
Wilbrink's graphs::
467459
468-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,4,'+') # needs sage.libs.gap
469-
sage: g.is_strongly_regular(parameters=True) # needs sage.libs.gap
460+
sage: # needs sage.libs.gap
461+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,4,'+')
462+
sage: g.is_strongly_regular(parameters=True)
470463
(136, 75, 42, 40)
471-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,4,'-') # needs sage.libs.gap
472-
sage: g.is_strongly_regular(parameters=True) # needs sage.libs.gap
464+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,4,'-')
465+
sage: g.is_strongly_regular(parameters=True)
473466
(120, 51, 18, 24)
474467
sage: g = graphs.NonisotropicOrthogonalPolarGraph(7,4,'+'); g # not tested (long time)
475468
NO^+(7, 4): Graph on 2080 vertices
@@ -478,27 +471,28 @@ def NonisotropicOrthogonalPolarGraph(m, q, sign="+", perp=None):
478471
479472
TESTS::
480473
481-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(4,2); g # needs sage.libs.gap
474+
sage: # needs sage.libs.gap
475+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(4,2); g
482476
NO^+(4, 2): Graph on 6 vertices
483-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(4,3,'-') # needs sage.libs.gap
484-
sage: g.is_strongly_regular(parameters=True) # needs sage.libs.gap
477+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(4,3,'-')
478+
sage: g.is_strongly_regular(parameters=True)
485479
(15, 6, 1, 3)
486-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(3,5,'-',perp=1); g # needs sage.libs.gap
480+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(3,5,'-',perp=1); g
487481
NO^-,perp(3, 5): Graph on 10 vertices
488-
sage: g.is_strongly_regular(parameters=True) # needs sage.libs.gap
482+
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+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,3,'+') # long time
485+
sage: g.is_strongly_regular(parameters=True) # long time
492486
(117, 36, 15, 9)
493-
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,3,'-'); g # long time, needs sage.libs.gap
487+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,3,'-'); g # long time
494488
NO^-(6, 3): Graph on 126 vertices
495-
sage: g.is_strongly_regular(parameters=True) # long time, needs sage.libs.gap
489+
sage: g.is_strongly_regular(parameters=True) # long time
496490
(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
491+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,5,'-') # long time
492+
sage: g.is_strongly_regular(parameters=True) # long time
499493
(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
494+
sage: g = graphs.NonisotropicOrthogonalPolarGraph(5,5,'+') # long time
495+
sage: g.is_strongly_regular(parameters=True) # long time
502496
(325, 144, 68, 60)
503497
sage: g = graphs.NonisotropicOrthogonalPolarGraph(6,4,'+')
504498
Traceback (most recent call last):
@@ -581,7 +575,7 @@ def _polar_graph(m, q, g, intersection_size=None):
581575
TESTS::
582576
583577
sage: from sage.graphs.generators.classical_geometries import _polar_graph
584-
sage: _polar_graph(4, 4, libgap.GeneralUnitaryGroup(4, 2)) # needs sage.libs.gap
578+
sage: _polar_graph(4, 4, libgap.GeneralUnitaryGroup(4, 2)) # needs sage.libs.gap
585579
Graph on 45 vertices
586580
sage: _polar_graph(4, 4, libgap.GeneralUnitaryGroup(4, 2), intersection_size=1) # needs sage.libs.gap
587581
Graph on 27 vertices
@@ -759,9 +753,9 @@ def UnitaryDualPolarGraph(m, q):
759753
The point graph of a generalized quadrangle (see
760754
:wikipedia:`Generalized_quadrangle`, [PT2009]_) of order (8,4)::
761755
762-
sage: G = graphs.UnitaryDualPolarGraph(5,2); G # long time, needs sage.libs.gap
756+
sage: G = graphs.UnitaryDualPolarGraph(5,2); G # long time # needs sage.libs.gap
763757
Unitary Dual Polar Graph DU(5, 2); GQ(8, 4): Graph on 297 vertices
764-
sage: G.is_strongly_regular(parameters=True) # long time, needs sage.libs.gap
758+
sage: G.is_strongly_regular(parameters=True) # long time # needs sage.libs.gap
765759
(297, 40, 7, 5)
766760
767761
Another way to get the generalized quadrangle of order (2,4)::
@@ -865,22 +859,24 @@ def TaylorTwographDescendantSRG(q, clique_partition=False):
865859
866860
EXAMPLES::
867861
868-
sage: g = graphs.TaylorTwographDescendantSRG(3); g # needs sage.rings.finite_rings
862+
sage: # needs sage.rings.finite_rings
863+
sage: g = graphs.TaylorTwographDescendantSRG(3); g
869864
Taylor two-graph descendant SRG: Graph on 27 vertices
870-
sage: g.is_strongly_regular(parameters=True) # needs sage.rings.finite_rings
865+
sage: g.is_strongly_regular(parameters=True)
871866
(27, 10, 1, 5)
872867
sage: from sage.combinat.designs.twographs import taylor_twograph
873-
sage: T = taylor_twograph(3) # long time, needs sage.rings.finite_rings
874-
sage: g.is_isomorphic(T.descendant(T.ground_set()[1])) # long time, needs sage.rings.finite_rings
868+
sage: T = taylor_twograph(3) # long time
869+
sage: g.is_isomorphic(T.descendant(T.ground_set()[1])) # long time
875870
True
876871
sage: g = graphs.TaylorTwographDescendantSRG(5) # not tested (long time)
877872
sage: g.is_strongly_regular(parameters=True) # not tested (long time)
878873
(125, 52, 15, 26)
879874
880875
TESTS::
881876
882-
sage: g,l,_ = graphs.TaylorTwographDescendantSRG(3, clique_partition=True) # needs sage.rings.finite_rings
883-
sage: all(g.is_clique(x) for x in l) # needs sage.rings.finite_rings
877+
sage: # needs sage.rings.finite_rings
878+
sage: g,l,_ = graphs.TaylorTwographDescendantSRG(3, clique_partition=True)
879+
sage: all(g.is_clique(x) for x in l)
884880
True
885881
sage: graphs.TaylorTwographDescendantSRG(4)
886882
Traceback (most recent call last):
@@ -1069,14 +1065,15 @@ def T2starGeneralizedQuadrangleGraph(q, dual=False, hyperoval=None, field=None,
10691065
10701066
TESTS::
10711067
1072-
sage: F = GF(4,'b') # repeating a point... # needs sage.libs.pari
1073-
sage: O = [vector(F,(0,1,0,0)),vector(F,(0,0,1,0))]+[vector(F, (0,1,x^2,x)) for x in F] # needs sage.rings.finite_rings
1074-
sage: graphs.T2starGeneralizedQuadrangleGraph(4, hyperoval=O, field=F) # needs sage.rings.finite_rings
1068+
sage: # needs sage.rings.finite_rings
1069+
sage: F = GF(4,'b') # repeating a point...
1070+
sage: O = [vector(F,(0,1,0,0)),vector(F,(0,0,1,0))]+[vector(F, (0,1,x^2,x)) for x in F]
1071+
sage: graphs.T2starGeneralizedQuadrangleGraph(4, hyperoval=O, field=F)
10751072
Traceback (most recent call last):
10761073
...
10771074
RuntimeError: incorrect hyperoval size
1078-
sage: O = [vector(F,(0,1,1,0)),vector(F,(0,0,1,0))]+[vector(F, (0,1,x^2,x)) for x in F] # needs sage.rings.finite_rings
1079-
sage: graphs.T2starGeneralizedQuadrangleGraph(4, hyperoval=O, field=F) # needs sage.rings.finite_rings
1075+
sage: O = [vector(F,(0,1,1,0)),vector(F,(0,0,1,0))]+[vector(F, (0,1,x^2,x)) for x in F]
1076+
sage: graphs.T2starGeneralizedQuadrangleGraph(4, hyperoval=O, field=F)
10801077
Traceback (most recent call last):
10811078
...
10821079
RuntimeError: incorrect hyperoval
@@ -1183,21 +1180,21 @@ def HaemersGraph(q, hyperoval=None, hyperoval_matching=None, field=None, check_h
11831180
TESTS::
11841181
11851182
sage: # needs sage.rings.finite_rings
1186-
sage: F=GF(4,'b') # repeating a point...
1187-
sage: O=[vector(F,(0,1,0,0)),vector(F,(0,0,1,0))]+[vector(F, (0,1,x^2,x)) for x in F]
1183+
sage: F = GF(4,'b') # repeating a point...
1184+
sage: O = [vector(F,(0,1,0,0)),vector(F,(0,0,1,0))]+[vector(F, (0,1,x^2,x)) for x in F]
11881185
sage: graphs.HaemersGraph(4, hyperoval=O, field=F)
11891186
Traceback (most recent call last):
11901187
...
11911188
RuntimeError: incorrect hyperoval size
1192-
sage: O=[vector(F,(0,1,1,0)),vector(F,(0,0,1,0))]+[vector(F, (0,1,x^2,x)) for x in F]
1189+
sage: O = [vector(F,(0,1,1,0)),vector(F,(0,0,1,0))]+[vector(F, (0,1,x^2,x)) for x in F]
11931190
sage: graphs.HaemersGraph(4, hyperoval=O, field=F)
11941191
Traceback (most recent call last):
11951192
...
11961193
RuntimeError: incorrect hyperoval
11971194
1198-
sage: g = graphs.HaemersGraph(8); g # not tested (long time), needs sage.rings.finite_rings
1195+
sage: g = graphs.HaemersGraph(8); g # not tested (long time) # needs sage.rings.finite_rings
11991196
Haemers(8): Graph on 640 vertices
1200-
sage: g.is_strongly_regular(parameters=True) # not tested (long time), needs sage.rings.finite_rings
1197+
sage: g.is_strongly_regular(parameters=True) # not tested (long time) # needs sage.rings.finite_rings
12011198
(640, 71, 6, 8)
12021199
12031200
"""
@@ -1392,9 +1389,10 @@ def Nowhere0WordsTwoWeightCodeGraph(q, hyperoval=None, field=None, check_hyperov
13921389
13931390
using the built-in construction::
13941391
1395-
sage: g = graphs.Nowhere0WordsTwoWeightCodeGraph(8); g # needs sage.rings.finite_rings
1392+
sage: # needs sage.rings.finite_rings
1393+
sage: g = graphs.Nowhere0WordsTwoWeightCodeGraph(8); g
13961394
Nowhere0WordsTwoWeightCodeGraph(8): Graph on 196 vertices
1397-
sage: g.is_strongly_regular(parameters=True) # needs sage.rings.finite_rings
1395+
sage: g.is_strongly_regular(parameters=True)
13981396
(196, 60, 14, 20)
13991397
sage: g = graphs.Nowhere0WordsTwoWeightCodeGraph(16) # not tested (long time)
14001398
sage: g.is_strongly_regular(parameters=True) # not tested (long time)
@@ -1413,14 +1411,15 @@ def Nowhere0WordsTwoWeightCodeGraph(q, hyperoval=None, field=None, check_hyperov
14131411
14141412
TESTS::
14151413
1416-
sage: F = GF(8) # repeating a point... # needs sage.rings.finite_rings
1417-
sage: O = [vector(F,(1,0,0)),vector(F,(0,1,0))]+[vector(F, (1,x^2,x)) for x in F] # needs sage.rings.finite_rings
1418-
sage: graphs.Nowhere0WordsTwoWeightCodeGraph(8,hyperoval=O,field=F) # needs sage.rings.finite_rings
1414+
sage: # needs sage.rings.finite_rings
1415+
sage: F = GF(8) # repeating a point...
1416+
sage: O = [vector(F,(1,0,0)),vector(F,(0,1,0))]+[vector(F, (1,x^2,x)) for x in F]
1417+
sage: graphs.Nowhere0WordsTwoWeightCodeGraph(8,hyperoval=O,field=F)
14191418
Traceback (most recent call last):
14201419
...
14211420
RuntimeError: incorrect hyperoval size
1422-
sage: O = [vector(F,(1,1,0)),vector(F,(0,1,0))]+[vector(F, (1,x^2,x)) for x in F] # needs sage.rings.finite_rings
1423-
sage: graphs.Nowhere0WordsTwoWeightCodeGraph(8,hyperoval=O,field=F) # optional - NameError: 'F' (with --distribution 'sagemath-graphs[modules]')
1421+
sage: O = [vector(F,(1,1,0)),vector(F,(0,1,0))]+[vector(F, (1,x^2,x)) for x in F]
1422+
sage: graphs.Nowhere0WordsTwoWeightCodeGraph(8,hyperoval=O,field=F)
14241423
Traceback (most recent call last):
14251424
...
14261425
RuntimeError: incorrect hyperoval

0 commit comments

Comments
 (0)