@@ -488,34 +488,58 @@ def shortened_000_111_extended_binary_Golay_code_graph():
488
488
EXAMPLES::
489
489
490
490
sage: # long time, needs sage. modules sage. rings. finite_rings
491
- sage: G = graphs. shortened_000_111_extended_binary_Golay_code_graph( ) # 25 s
491
+ sage: G = graphs. shortened_000_111_extended_binary_Golay_code_graph( )
492
492
sage: G. is_distance_regular( True)
493
493
( [21, 20, 16, 9, 2, 1, None ], [None, 1, 2, 3, 16, 20, 21 ])
494
494
495
495
ALGORITHM:
496
496
497
- Compute the extended binary Golay code. Compute its subcode whose codewords
498
- start with 000 or 111. Remove the first 3 entries from all the codewords
499
- from the new linear code and compute its coset graph.
497
+ The vertices and edges of this graph have been precomputed and
498
+ pickled, so truthfully, we just unpickle them and pass them to the
499
+ Graph constructor. But the algorithm used to compute those
500
+ vertices and edges in the first place is,
500
501
501
- REFERENCES:
502
-
503
- Description and construction of this graph can be found in [BCN1989 ]_ p. 365.
504
- """
505
- from sage.coding.linear_code import LinearCode
506
-
507
- code = codes.GolayCode(GF(2 ))
508
- C_basis = code.basis()
502
+ #. Compute the extended binary Golay code.
503
+ #. Compute its subcode whose codewords start with 000 or 111.
504
+ #. Remove the first 3 entries from all the codewords from the
505
+ new linear code and compute its coset graph.
509
506
510
- # now special shortening
511
- v = C_basis[0 ] + C_basis[1 ] + C_basis[2 ] # v has 111 at the start
512
- C_basis = C_basis[3 :]
513
- C_basis.append(v)
514
- C_basis = list (map (lambda x : x[3 :], C_basis))
507
+ This construction is tested in ``generators_test. py``, where the
508
+ result is compared with the result from this method.
515
509
516
- code = LinearCode(Matrix(GF( 2 ), C_basis))
510
+ REFERENCES:
517
511
518
- G = code.cosetGraph()
512
+ The description and construction of this graph can be found in
513
+ [BCN1989 ]_, page 365.
514
+ """
515
+ import lzma
516
+ from importlib.resources import as_file, files
517
+ from pickle import load
518
+
519
+ # Path to the pickled-and-xz'd list of (vertices, edges)
520
+ ppath = files(' sage.graphs.generators' ).joinpath(
521
+ " shortened_000_111_extended_binary_Golay_code_graph.pickle.xz"
522
+ )
523
+
524
+ with as_file(ppath) as p:
525
+ with lzma.open(p) as f:
526
+ vs_and_es = load(f, fix_imports = False )
527
+
528
+ # Vertices/edges are pickled as tuples of ints, but should be
529
+ # vectors with entries in GF(2).
530
+ V = VectorSpace(GF(2 ), 21 )
531
+ for i in range (2048 ):
532
+ # vertex i
533
+ vs_and_es[0 ][i] = V(vs_and_es[0 ][i])
534
+ vs_and_es[0 ][i].set_immutable()
535
+ for i in range (21504 ):
536
+ # edge i = (v1, v2, l)
537
+ vs_and_es[1 ][i][0 ] = V(vs_and_es[1 ][i][0 ]) # v1
538
+ vs_and_es[1 ][i][0 ].set_immutable()
539
+ vs_and_es[1 ][i][1 ] = V(vs_and_es[1 ][i][1 ]) # v2
540
+ vs_and_es[1 ][i][1 ].set_immutable()
541
+
542
+ G = Graph(vs_and_es, format = ' vertices_and_edges' )
519
543
G.name(" Shortened 000 111 extended binary Golay code" )
520
544
return G
521
545
0 commit comments