@@ -487,35 +487,46 @@ def shortened_000_111_extended_binary_Golay_code_graph():
487
487
488
488
EXAMPLES::
489
489
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
490
+ sage: # needs sage. modules sage. rings. finite_rings
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,
501
+
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.
506
+
507
+ This construction is tested in ``generators_test. py``, where the
508
+ result is compared ( up to isomorphism) with the result from this
509
+ method.
500
510
501
511
REFERENCES:
502
512
503
- Description and construction of this graph can be found in [BCN1989 ]_ p. 365.
513
+ The description and construction of this graph can be found in
514
+ [BCN1989 ]_, page 365.
504
515
"""
505
- from sage.coding.linear_code import LinearCode
516
+ import lzma
517
+ from importlib.resources import as_file, files
518
+ from pickle import load
506
519
507
- code = codes.GolayCode(GF(2 ))
508
- C_basis = code.basis()
520
+ # Path to the pickled-and-xz'd list of (vertices, edges)
521
+ ppath = files(' sage.graphs.generators' ).joinpath(
522
+ " shortened_000_111_extended_binary_Golay_code_graph.pickle.xz"
523
+ )
509
524
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))
525
+ with as_file(ppath) as p:
526
+ with lzma.open(p) as f:
527
+ vs_and_es = load(f, fix_imports = False )
515
528
516
- code = LinearCode(Matrix(GF(2 ), C_basis))
517
-
518
- G = code.cosetGraph()
529
+ G = Graph(vs_and_es, format = ' vertices_and_edges' )
519
530
G.name(" Shortened 000 111 extended binary Golay code" )
520
531
return G
521
532
0 commit comments