@@ -349,6 +349,53 @@ def Path(self, n):
349
349
g .set_pos ({i : (i , 0 ) for i in range (n )})
350
350
return g
351
351
352
+ def StronglyRegular (self , n ):
353
+ r"""
354
+ Return a Strongly Regular digraph with `n` vertices.
355
+
356
+ The adjacency matrix of the graph is constructed from a skew Hadamard
357
+ matrix of order `n+1`. These graphs were first constructed in [Duv1988]_.
358
+
359
+ INPUT:
360
+
361
+ - ``n`` -- integer, the number of vertices of the digraph.
362
+
363
+ .. SEEALSO::
364
+
365
+ - :func:`sage.combinat.matrices.hadamard_matrix.skew_hadamard_matrix`
366
+ - :meth:`Paley`
367
+
368
+ EXAMPLES:
369
+
370
+ A Strongly Regular digraph satisfies the condition `AJ = JA = kJ` where
371
+ `A` is the adjacency matrix::
372
+
373
+ sage: g = digraphs.StronglyRegular(7); g
374
+ Strongly regular digraph: Digraph on 7 vertices
375
+ sage: A = g.adjacency_matrix()*ones_matrix(7); B = ones_matrix(7)*g.adjacency_matrix()
376
+ sage: A == B == A[0, 0]*ones_matrix(7)
377
+ True
378
+
379
+ TESTS:
380
+
381
+ Wrong parameter::
382
+
383
+ sage: digraphs.StronglyRegular(73)
384
+ Traceback (most recent call last):
385
+ ...
386
+ ValueError: strongly regular digraph with 73 vertices not yet implemented
387
+
388
+ """
389
+ from sage .combinat .matrices .hadamard_matrix import skew_hadamard_matrix
390
+ from sage .matrix .constructor import ones_matrix , identity_matrix
391
+ if skew_hadamard_matrix (n + 1 , existence = True ) is not True :
392
+ raise ValueError (f'strongly regular digraph with { n } vertices not yet implemented' )
393
+
394
+ H = skew_hadamard_matrix (n + 1 , skew_normalize = True )
395
+ M = H [1 :, 1 :]
396
+ M = (M + ones_matrix (n )) / 2 - identity_matrix (n )
397
+ return DiGraph (M , format = 'adjacency_matrix' , name = f'Strongly regular digraph' )
398
+
352
399
def Paley (self , q ):
353
400
r"""
354
401
Return a Paley digraph on `q` vertices.
0 commit comments