This file is indexed.

/usr/share/gap/pkg/guava/doc/chap6.txt is in gap-guava 3.13+ds-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
  
  6 Manipulating Codes
  
  In  this  chapter  we  describe  several  functions GUAVA uses to manipulate
  codes.  Some  of  the best codes are obtained by starting with for example a
  BCH code, and manipulating it.
  
  In  some cases, it is faster to perform calculations with a manipulated code
  than  to use the original code. For example, if the dimension of the code is
  larger  than  half  the  word  length, it is generally faster to compute the
  weight distribution by first calculating the weight distribution of the dual
  code  than  by  directly calculating the weight distribution of the original
  code. The size of the dual code is smaller in these cases.
  
  Because  GUAVA  keeps  all  information  in a code record, in some cases the
  information can be preserved after manipulations. Therefore, computations do
  not always have to start from scratch.
  
  In  Section  6.1,  we  describe  functions  that  take  a  code with certain
  parameters,  modify  it  in  some  way  and  return  a  different  code (see
  ExtendedCode  (6.1-1),  PuncturedCode  (6.1-2),  EvenWeightSubcode  (6.1-3),
  PermutedCode   (6.1-4),   ExpurgatedCode   (6.1-5),  AugmentedCode  (6.1-6),
  RemovedElementsCode   (6.1-7),   AddedElementsCode   (6.1-8),  ShortenedCode
  (6.1-9),  LengthenedCode  (6.1-10),  ResidueCode (6.1-12), ConstructionBCode
  (6.1-13),      DualCode      (6.1-14),     ConversionFieldCode     (6.1-15),
  ConstantWeightSubcode  (6.1-18),  StandardFormCode  (6.1-19)  and  CosetCode
  (6.1-17)).  In  Section  6.2, we describe functions that generate a new code
  out   of   two   codes   (see   DirectSumCode   (6.2-1),   UUVCode  (6.2-2),
  DirectProductCode (6.2-3), IntersectionCode (6.2-4) and UnionCode (6.2-5)).
  
  
  6.1 Functions that Generate a New Code from a Given Code
  
  6.1-1 ExtendedCode
  
  ExtendedCode( C[, i] )  function
  
  ExtendedCode  extends  the code C i times and returns the result. i is equal
  to  1  by  default. Extending is done by adding a parity check bit after the
  last coordinate. The coordinates of all codewords now add up to zero. In the
  binary case, each codeword has even weight.
  
  The  word  length  increases by i. The size of the code remains the same. In
  the  binary  case,  the  minimum distance increases by one if it was odd. In
  other cases, that is not always true.
  
  A cyclic code in general is no longer cyclic after extending.
  
    Example  
    gap> C1 := HammingCode( 3, GF(2) );
    a linear [7,4,3]1 Hamming (3,2) code over GF(2)
    gap> C2 := ExtendedCode( C1 );
    a linear [8,4,4]2 extended code
    gap> IsEquivalent( C2, ReedMullerCode( 1, 3 ) );
    true
    gap> List( AsSSortedList( C2 ), WeightCodeword );
    [ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 ]
    gap> C3 := EvenWeightSubcode( C1 );
    a linear [7,3,4]2..3 even weight subcode 
  
  
  To  undo  extending,  call  PuncturedCode  (see  PuncturedCode (6.1-2)). The
  function  EvenWeightSubcode  (see  EvenWeightSubcode (6.1-3)) also returns a
  related code with only even weights, but without changing its word length.
  
  6.1-2 PuncturedCode
  
  PuncturedCode( C )  function
  
  PuncturedCode  punctures  C  in  the  last  column,  and returns the result.
  Puncturing is done simply by cutting off the last column from each codeword.
  This means the word length decreases by one. The minimum distance in general
  also decrease by one.
  
  This  command  can  also be called with the syntax PuncturedCode( C, L ). In
  this  case,  PuncturedCode punctures C in the columns specified by L, a list
  of integers. All columns specified by L are omitted from each codeword. If l
  is  the  length  of  L  (so  the number of removed columns), the word length
  decreases by l. The minimum distance can also decrease by l or less.
  
  Puncturing  a  cyclic  code  in general results in a non-cyclic code. If the
  code  is  punctured  in  all  the  columns where a word of minimal weight is
  unequal to zero, the dimension of the resulting code decreases.
  
    Example  
    gap> C1 := BCHCode( 15, 5, GF(2) );
    a cyclic [15,7,5]3..5 BCH code, delta=5, b=1 over GF(2)
    gap> C2 := PuncturedCode( C1 );
    a linear [14,7,4]3..5 punctured code
    gap> ExtendedCode( C2 ) = C1;
    false
    gap> PuncturedCode( C1, [1,2,3,4,5,6,7] );
    a linear [8,7,1]1 punctured code
    gap> PuncturedCode( WholeSpaceCode( 4, GF(5) ) );
    a linear [3,3,1]0 punctured code  # The dimension decreased from 4 to 3 
  
  
  ExtendedCode  extends the code again (see ExtendedCode (6.1-1)), although in
  general this does not result in the old code.
  
  6.1-3 EvenWeightSubcode
  
  EvenWeightSubcode( C )  function
  
  EvenWeightSubcode  returns  the  even weight subcode of C, consisting of all
  codewords of C with even weight. If C is a linear code and contains words of
  odd  weight,  the  resulting  code  has a dimension of one less. The minimum
  distance  always  increases  with one if it was odd. If C is a binary cyclic
  code,  and  g(x) is its generator polynomial, the even weight subcode either
  has  generator  polynomial g(x) (if g(x) is divisible by x-1) or g(x)⋅ (x-1)
  (if  no factor x-1 was present in g(x)). So the even weight subcode is again
  cyclic.
  
  Of  course,  if  all codewords of C are already of even weight, the returned
  code is equal to C.
  
    Example  
    gap> C1 := EvenWeightSubcode( BCHCode( 8, 4, GF(3) ) );
    an (8,33,4..8)3..8 even weight subcode
    gap> List( AsSSortedList( C1 ), WeightCodeword );
    [ 0, 4, 4, 4, 4, 4, 4, 6, 4, 4, 4, 4, 6, 4, 4, 6, 4, 4, 8, 6, 4, 6, 8, 4, 4, 
      4, 6, 4, 6, 8, 4, 6, 8 ]
    gap> EvenWeightSubcode( ReedMullerCode( 1, 3 ) );
    a linear [8,4,4]2 Reed-Muller (1,3) code over GF(2) 
  
  
  ExtendedCode  also  returns a related code of only even weights, but without
  reducing its dimension (see ExtendedCode (6.1-1)).
  
  6.1-4 PermutedCode
  
  PermutedCode( C, L )  function
  
  PermutedCode  returns  C after column permutations. L (in GAP disjoint cycle
  notation)  is  the  permutation  to be executed on the columns of C. If C is
  cyclic,  the result in general is no longer cyclic. If a permutation results
  in the same code as C, this permutation belongs to the automorphism group of
  C  (see  AutomorphismGroup  (4.4-3)).  In  any  case,  the  returned code is
  equivalent to C (see IsEquivalent (4.4-1)).
  
    Example  
    gap> C1 := PuncturedCode( ReedMullerCode( 1, 4 ) );
    a linear [15,5,7]5 punctured code
    gap> C2 := BCHCode( 15, 7, GF(2) );
    a cyclic [15,5,7]5 BCH code, delta=7, b=1 over GF(2)
    gap> C2 = C1;
    false
    gap> p := CodeIsomorphism( C1, C2 );
    ( 2, 4,14, 9,13, 7,11,10, 6, 8,12, 5)
    gap> C3 := PermutedCode( C1, p );
    a linear [15,5,7]5 permuted code
    gap> C2 = C3;
    true 
  
  
  6.1-5 ExpurgatedCode
  
  ExpurgatedCode( C, L )  function
  
  ExpurgatedCode  expurgates the code C> by throwing away codewords in list L.
  C  must  be a linear code. L must be a list of codeword input. The generator
  matrix  of  the new code no longer is a basis for the codewords specified by
  L.  Since the returned code is still linear, it is very likely that, besides
  the words of L, more codewords of C are no longer in the new code.
  
    Example  
    gap> C1 := HammingCode( 4 );; WeightDistribution( C1 );
    [ 1, 0, 0, 35, 105, 168, 280, 435, 435, 280, 168, 105, 35, 0, 0, 1 ]
    gap> L := Filtered( AsSSortedList(C1), i -> WeightCodeword(i) = 3 );;
    gap> C2 := ExpurgatedCode( C1, L );
    a linear [15,4,3..4]5..11 code, expurgated with 7 word(s)
    gap> WeightDistribution( C2 );
    [ 1, 0, 0, 0, 14, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 ] 
  
  
  This  function  does not work on non-linear codes. For removing words from a
  non-linear  code, use RemovedElementsCode (see RemovedElementsCode (6.1-7)).
  For  expurgating  a code of all words of odd weight, use `EvenWeightSubcode'
  (see EvenWeightSubcode (6.1-3)).
  
  6.1-6 AugmentedCode
  
  AugmentedCode( C, L )  function
  
  AugmentedCode returns C after augmenting. C must be a linear code, L must be
  a  list  of codeword inputs. The generator matrix of the new code is a basis
  for  the  codewords specified by L as well as the words that were already in
  code  C.  Note  that the new code in general will consist of more words than
  only  the codewords of C and the words L. The returned code is also a linear
  code.
  
  This  command  can  also  be  called  with the syntax AugmentedCode(C). When
  called without a list of codewords, AugmentedCode returns C after adding the
  all-ones  vector  to  the  generator matrix. C must be a linear code. If the
  all-ones  vector  was already in the code, nothing happens and a copy of the
  argument  is  returned.  If  C  is  a binary code which does not contain the
  all-ones vector, the complement of all codewords is added.
  
    Example  
    gap> C31 := ReedMullerCode( 1, 3 );
    a linear [8,4,4]2 Reed-Muller (1,3) code over GF(2)
    gap> C32 := AugmentedCode(C31,["00000011","00000101","00010001"]);
    a linear [8,7,1..2]1 code, augmented with 3 word(s)
    gap> C32 = ReedMullerCode( 2, 3 );
    true 
    gap> C1 := CordaroWagnerCode(6);
    a linear [6,2,4]2..3 Cordaro-Wagner code over GF(2)
    gap> Codeword( [0,0,1,1,1,1] ) in C1;
    true
    gap> C2 := AugmentedCode( C1 );
    a linear [6,3,1..2]2..3 code, augmented with 1 word(s)
    gap> Codeword( [1,1,0,0,0,0] ) in C2;
    true
  
  
  The  function  AddedElementsCode  adds  elements to the codewords instead of
  adding them to the basis (see AddedElementsCode (6.1-8)).
  
  6.1-7 RemovedElementsCode
  
  RemovedElementsCode( C, L )  function
  
  RemovedElementsCode returns code C after removing a list of codewords L from
  its  elements.  L  must  be  a  list  of  codeword  input.  The result is an
  unrestricted code.
  
    Example  
    gap> C1 := HammingCode( 4 );; WeightDistribution( C1 );
    [ 1, 0, 0, 35, 105, 168, 280, 435, 435, 280, 168, 105, 35, 0, 0, 1 ]
    gap> L := Filtered( AsSSortedList(C1), i -> WeightCodeword(i) = 3 );;
    gap> C2 := RemovedElementsCode( C1, L );
    a (15,2013,3..15)2..15 code with 35 word(s) removed
    gap> WeightDistribution( C2 );
    [ 1, 0, 0, 0, 105, 168, 280, 435, 435, 280, 168, 105, 35, 0, 0, 1 ]
    gap> MinimumDistance( C2 );
    3        # C2 is not linear, so the minimum weight does not have to
             # be equal to the minimum distance 
  
  
  Adding  elements  to  a  code is done by the function AddedElementsCode (see
  AddedElementsCode  (6.1-8)).  To  remove codewords from the base of a linear
  code, use ExpurgatedCode (see ExpurgatedCode (6.1-5)).
  
  6.1-8 AddedElementsCode
  
  AddedElementsCode( C, L )  function
  
  AddedElementsCode  returns  code C after adding a list of codewords L to its
  elements.  L must be a list of codeword input. The result is an unrestricted
  code.
  
    Example  
    gap> C1 := NullCode( 6, GF(2) );
    a cyclic [6,0,6]6 nullcode over GF(2)
    gap> C2 := AddedElementsCode( C1, [ "111111" ] );
    a (6,2,1..6)3 code with 1 word(s) added
    gap> IsCyclicCode( C2 );
    true
    gap> C3 := AddedElementsCode( C2, [ "101010", "010101" ] );
    a (6,4,1..6)2 code with 2 word(s) added
    gap> IsCyclicCode( C3 );
    true 
  
  
  To   remove   elements   from   a   code,   use   RemovedElementsCode   (see
  RemovedElementsCode  (6.1-7)). To add elements to the base of a linear code,
  use AugmentedCode (see AugmentedCode (6.1-6)).
  
  6.1-9 ShortenedCode
  
  ShortenedCode( C[, L] )  function
  
  ShortenedCode(  C  ) returns the code C shortened by taking a cross section.
  If  C  is  a  linear code, this is done by removing all codewords that start
  with  a  non-zero entry, after which the first column is cut off. If C was a
  [n,k,d]  code,  the  shortened  code  generally is a [n-1,k-1,d] code. It is
  possible  that  the dimension remains the same; it is also possible that the
  minimum distance increases.
  
  If  C  is  a  non-linear code, ShortenedCode first checks which finite field
  element  occurs  most  often  in  the  first  column  of  the codewords. The
  codewords  not  starting  with this element are removed from the code, after
  which the first column is cut off. The resulting shortened code has at least
  the same minimum distance as C.
  
  This  command  can  also be called using the syntax ShortenedCode(C,L). When
  called  in this format, ShortenedCode repeats the shortening process on each
  of the columns specified by L. L therefore is a list of integers. The column
  numbers in L are the numbers as they are before the shortening process. If L
  has  l  entries,  the returned code has a word length of l positions shorter
  than C.
  
    Example  
    gap> C1 := HammingCode( 4 );
    a linear [15,11,3]1 Hamming (4,2) code over GF(2)
    gap> C2 := ShortenedCode( C1 );
    a linear [14,10,3]2 shortened code
    gap> C3 := ElementsCode( ["1000", "1101", "0011" ], GF(2) );
    a (4,3,1..4)2 user defined unrestricted code over GF(2)
    gap> MinimumDistance( C3 );
    2
    gap> C4 := ShortenedCode( C3 );
    a (3,2,2..3)1..2 shortened code
    gap> AsSSortedList( C4 );
    [ [ 0 0 0 ], [ 1 0 1 ] ]
    gap> C5 := HammingCode( 5, GF(2) );
    a linear [31,26,3]1 Hamming (5,2) code over GF(2)
    gap> C6 := ShortenedCode( C5, [ 1, 2, 3 ] );
    a linear [28,23,3]2 shortened code
    gap> OptimalityLinearCode( C6 );
    0
  
  
  The  function  LengthenedCode  lengthens  the  code  again  (only for linear
  codes),  see  LengthenedCode  (6.1-10).  In general, this is not exactly the
  inverse function.
  
  6.1-10 LengthenedCode
  
  LengthenedCode( C[, i] )  function
  
  LengthenedCode(  C ) returns the code C lengthened. C must be a linear code.
  First,   the   all-ones  vector  is  added  to  the  generator  matrix  (see
  AugmentedCode  (6.1-6)).  If  the  all-ones  vector  was already a codeword,
  nothing  happens  to  the  code.  Then,  the  code  is extended i times (see
  ExtendedCode  (6.1-1)).  i is equal to 1 by default. If C was an [n,k] code,
  the new code generally is a [n+i,k+1] code.
  
    Example  
    gap> C1 := CordaroWagnerCode( 5 );
    a linear [5,2,3]2 Cordaro-Wagner code over GF(2)
    gap> C2 := LengthenedCode( C1 );
    a linear [6,3,2]2..3 code, lengthened with 1 column(s) 
  
  
  ShortenedCode'  shortens  the  code,  see ShortenedCode (6.1-9). In general,
  this is not exactly the inverse function.
  
  6.1-11 SubCode
  
  SubCode( C[, s] )  function
  
  This  function SubCode returns a subcode of C by taking the first k - s rows
  of  the generator matrix of C, where k is the dimension of C. The interger s
  may be omitted and in this case it is assumed as 1.
  
    Example  
    gap> C := BCHCode(31,11);
    a cyclic [31,11,11]7..11 BCH code, delta=11, b=1 over GF(2)
    gap> S1:= SubCode(C);
    a linear [31,10,11]7..13 subcode
    gap> WeightDistribution(S1);
    [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 190, 0, 0, 272, 255, 0, 0, 120, 66,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
    gap> S2:= SubCode(C, 8);
    a linear [31,3,11]14..20 subcode
    gap> History(S2);
    [ "a linear [31,3,11]14..20 subcode of",
      "a cyclic [31,11,11]7..11 BCH code, delta=11, b=1 over GF(2)" ]
    gap> WeightDistribution(S2);
    [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0 ]
  
  
  6.1-12 ResidueCode
  
  ResidueCode( C[, c] )  function
  
  The  function  ResidueCode  takes  a  codeword  c  of  C (if c is omitted, a
  codeword of minimal weight is used). It removes this word and all its linear
  combinations  from  the  code and then punctures the code in the coordinates
  where  c  is  unequal  to  zero.  The  resulting  code  is an [n-w, k-1, d-⌊
  w*(q-1)/q  ⌋ ] code. C must be a linear code and c must be non-zero. If c is
  not in  then no change is made to C.
  
    Example  
    gap> C1 := BCHCode( 15, 7 );
    a cyclic [15,5,7]5 BCH code, delta=7, b=1 over GF(2)
    gap> C2 := ResidueCode( C1 );
    a linear [8,4,4]2 residue code
    gap> c := Codeword( [ 0,0,0,1,0,0,1,1,0,1,0,1,1,1,1 ], C1);;
    gap> C3 := ResidueCode( C1, c );
    a linear [7,4,3]1 residue code 
  
  
  6.1-13 ConstructionBCode
  
  ConstructionBCode( C )  function
  
  The  function  ConstructionBCode takes a binary linear code C and calculates
  the  minimum  distance  of  the  dual  of C (see DualCode (6.1-14)). It then
  removes  the columns of the parity check matrix of C where a codeword of the
  dual  code  of minimal weight has coordinates unequal to zero. The resulting
  matrix is a parity check matrix for an [n-dd, k-dd+1, ≥ d] code, where dd is
  the minimum distance of the dual of C.
  
    Example  
    gap> C1 := ReedMullerCode( 2, 5 );
    a linear [32,16,8]6 Reed-Muller (2,5) code over GF(2)
    gap> C2 := ConstructionBCode( C1 );
    a linear [24,9,8]5..10 Construction B (8 coordinates)
    gap> BoundsMinimumDistance( 24, 9, GF(2) );
    rec( n := 24, k := 9, q := 2, references := rec(  ), 
      construction := [ [ Operation "UUVCode" ], 
          [ [ [ Operation "UUVCode" ], [ [ [ Operation "DualCode" ], 
                          [ [ [ Operation "RepetitionCode" ], [ 6, 2 ] ] ] ], 
                      [ [ Operation "CordaroWagnerCode" ], [ 6 ] ] ] ], 
              [ [ Operation "CordaroWagnerCode" ], [ 12 ] ] ] ], lowerBound := 8, 
      lowerBoundExplanation := [ "Lb(24,9)=8, u u+v construction of C1 and C2:", 
          "Lb(12,7)=4, u u+v construction of C1 and C2:", 
          "Lb(6,5)=2, dual of the repetition code", 
          "Lb(6,2)=4, Cordaro-Wagner code", "Lb(12,2)=8, Cordaro-Wagner code" ], 
      upperBound := 8, 
      upperBoundExplanation := [ "Ub(24,9)=8, otherwise construction B would 
                                 contradict:", "Ub(18,4)=8, Griesmer bound" ] )
    # so C2 is optimal
  
  
  6.1-14 DualCode
  
  DualCode( C )  function
  
  DualCode returns the dual code of C. The dual code consists of all codewords
  that  are  orthogonal  to  the  codewords  of  C. If C is a linear code with
  generator  matrix  G,  the  dual code has parity check matrix G (or if C has
  parity  check  matrix H, the dual code has generator matrix H). So if C is a
  linear  [n, k] code, the dual code of C is a linear [n, n-k] code. If C is a
  cyclic code with generator polynomial g(x), the dual code has the reciprocal
  polynomial of g(x) as check polynomial.
  
  The dual code is always a linear code, even if C is non-linear.
  
  If a code C is equal to its dual code, it is called self-dual.
  
    Example  
    gap> R := ReedMullerCode( 1, 3 );
    a linear [8,4,4]2 Reed-Muller (1,3) code over GF(2)
    gap> RD := DualCode( R );
    a linear [8,4,4]2 Reed-Muller (1,3) code over GF(2)
    gap> R = RD;
    true
    gap> N := WholeSpaceCode( 7, GF(4) );
    a cyclic [7,7,1]0 whole space code over GF(4)
    gap> DualCode( N ) = NullCode( 7, GF(4) );
    true 
  
  
  6.1-15 ConversionFieldCode
  
  ConversionFieldCode( C )  function
  
  ConversionFieldCode  returns  the  code obtained from C after converting its
  field. If the field of C is GF(q^m), the returned code has field GF(q). Each
  symbol  of  every  codeword is replaced by a concatenation of m symbols from
  GF(q).  If  C  is an (n, M, d_1) code, the returned code is a (n⋅ m, M, d_2)
  code, where d_2 > d_1.
  
  See also HorizontalConversionFieldMat (7.3-10).
  
    Example  
    gap> R := RepetitionCode( 4, GF(4) );
    a cyclic [4,1,4]3 repetition code over GF(4)
    gap> R2 := ConversionFieldCode( R );
    a linear [8,2,4]3..4 code, converted to basefield GF(2)
    gap> Size( R ) = Size( R2 );
    true
    gap> GeneratorMat( R );
    [ [ Z(2)^0, Z(2)^0, Z(2)^0, Z(2)^0 ] ]
    gap> GeneratorMat( R2 );
    [ [ Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2) ],
      [ 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0 ] ] 
  
  
  6.1-16 TraceCode
  
  TraceCode( C )  function
  
  Input:  C is a linear code defined over an extension E of F (F is the ``base
  field'')
  
  Output: The linear code generated by Tr_E/F(c), for all c ∈ C.
  
  TraceCode  returns the image of the code C under the trace map. If the field
  of C is GF(q^m), the returned code has field GF(q).
  
  Very  slow.  It  does  not  seem to be easy to related the parameters of the
  trace code to the original except in the ``Galois closed'' case.
  
    Example  
    gap> C:=RandomLinearCode(10,4,GF(4)); MinimumDistance(C);
    a  [10,4,?] randomly generated code over GF(4)
    5
    gap> trC:=TraceCode(C,GF(2)); MinimumDistance(trC);
    a linear [10,7,1]1..3 user defined unrestricted code over GF(2)
    1
    
  
  
  6.1-17 CosetCode
  
  CosetCode( C, w )  function
  
  CosetCode returns the coset of a code C with respect to word w. w must be of
  the  codeword  type.  Then,  w  is added to each codeword of C, yielding the
  elements  of  the new code. If C is linear and w is an element of C, the new
  code is equal to C, otherwise the new code is an unrestricted code.
  
  Generating  a  coset  is also possible by simply adding the word w to C. See
  4.2.
  
    Example  
    gap> H := HammingCode(3, GF(2));
    a linear [7,4,3]1 Hamming (3,2) code over GF(2)
    gap> c := Codeword("1011011");; c in H;
    false
    gap> C := CosetCode(H, c);
    a (7,16,3)1 coset code
    gap> List(AsSSortedList(C), el-> Syndrome(H, el));
    [ [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ],
      [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ],
      [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ], [ 1 1 1 ] ]
    # All elements of the coset have the same syndrome in H 
  
  
  6.1-18 ConstantWeightSubcode
  
  ConstantWeightSubcode( C, w )  function
  
  ConstantWeightSubcode  returns  the  subcode of C that only has codewords of
  weight  w.  The  resulting  code  is  a non-linear code, because it does not
  contain the all-zero vector.
  
  This  command also can be called with the syntax ConstantWeightSubcode(C) In
  this  format,  ConstantWeightSubcode  returns the subcode of C consisting of
  all minimum weight codewords of C.
  
  ConstantWeightSubcode  first  checks  if Leon's binary wtdist exists on your
  computer  (in  the  default  directory).  If  it  does, then this program is
  called.  Otherwise,  the  constant  weight  subcode  is computed using a GAP
  program  which  checks  each  codeword  in  C to see if it is of the desired
  weight.
  
    Example  
    gap> N := NordstromRobinsonCode();; WeightDistribution(N);
    [ 1, 0, 0, 0, 0, 0, 112, 0, 30, 0, 112, 0, 0, 0, 0, 0, 1 ]
    gap> C := ConstantWeightSubcode(N, 8);
    a (16,30,6..16)5..8 code with codewords of weight 8
    gap> WeightDistribution(C);
    [ 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0 ] 
    gap> eg := ExtendedTernaryGolayCode();; WeightDistribution(eg);
    [ 1, 0, 0, 0, 0, 0, 264, 0, 0, 440, 0, 0, 24 ]
    gap> C := ConstantWeightSubcode(eg);
    a (12,264,6..12)3..6 code with codewords of weight 6
    gap> WeightDistribution(C);
    [ 0, 0, 0, 0, 0, 0, 264, 0, 0, 0, 0, 0, 0 ] 
  
  
  6.1-19 StandardFormCode
  
  StandardFormCode( C )  function
  
  StandardFormCode  returns  C  after  putting  it in standard form. If C is a
  non-linear code, this means the elements are organized using lexicographical
  order. This means they form a legal GAP `Set'.
  
  If  C is a linear code, the generator matrix and parity check matrix are put
  in  standard  form.  The generator matrix then has an identity matrix in its
  left part, the parity check matrix has an identity matrix in its right part.
  Although  GUAVA  always puts both matrices in a standard form using BaseMat,
  this   never   alters   the   code.  StandardFormCode  even  applies  column
  permutations  if  unavoidable,  and  thereby  changes  the  code. The column
  permutations  are  recorded in the construction history of the new code (see
  Display (4.6-3)). C and the new code are of course equivalent.
  
  If C is a cyclic code, its generator matrix cannot be put in the usual upper
  triangular  form,  because  then it would be inconsistent with the generator
  polynomial.  The  reason  is that generating the elements from the generator
  matrix  would  result in a different order than generating the elements from
  the  generator  polynomial.  This  is  an  unwanted  effect,  and  therefore
  StandardFormCode just returns a copy of C for cyclic codes.
  
    Example  
    gap> G := GeneratorMatCode( Z(2) * [ [0,1,1,0], [0,1,0,1], [0,0,1,1] ], 
              "random form code", GF(2) );
    a linear [4,2,1..2]1..2 random form code over GF(2)
    gap> Codeword( GeneratorMat( G ) );
    [ [ 0 1 0 1 ], [ 0 0 1 1 ] ]
    gap> Codeword( GeneratorMat( StandardFormCode( G ) ) );
    [ [ 1 0 0 1 ], [ 0 1 0 1 ] ] 
  
  
  6.1-20 PiecewiseConstantCode
  
  PiecewiseConstantCode( part, wts[, F] )  function
  
  PiecewiseConstantCode  returns  a  code  with length n = ∑ n_i, where part=[
  n_1,  dots,  n_k  ].  wts  is a list of constraints w=(w_1,...,w_k), each of
  length k, where 0 ≤ w_i ≤ n_i. The default field is GF(2).
  
  A  constraint  is  a  list  of  integers,  and a word c = ( c_1, dots, c_k )
  (according  to  part,  i.e.,  each c_i is a subword of length n_i) is in the
  resulting  code if and only if, for some constraint w ∈ wts, |c_i| = w_i for
  all 1 ≤ i ≤ k, where | ...| denotes the Hamming weight.
  
  An example might make things clearer:
  
    Example  
    gap> PiecewiseConstantCode( [ 2, 3 ],
         [ [ 0, 0 ], [ 0, 3 ], [ 1, 0 ], [ 2, 2 ] ],GF(2) );
    the C code programs are compiled, so using Leon's binary....
    the C code programs are compiled, so using Leon's binary....
    the C code programs are compiled, so using Leon's binary....
    the C code programs are compiled, so using Leon's binary....
    a (5,7,1..5)1..5 piecewise constant code over GF(2)
    gap> AsSSortedList(last);
    [ [ 0 0 0 0 0 ], [ 0 0 1 1 1 ], [ 0 1 0 0 0 ], [ 1 0 0 0 0 ], 
      [ 1 1 0 1 1 ], [ 1 1 1 0 1 ], [ 1 1 1 1 0 ] ]
    gap>
    
  
  
  The  first  constraint is satisfied by codeword 1, the second by codeword 2,
  the third by codewords 3 and 4, and the fourth by codewords 5, 6 and 7.
  
  
  6.2 Functions that Generate a New Code from Two or More Given Codes
  
  6.2-1 DirectSumCode
  
  DirectSumCode( C1, C2 )  function
  
  DirectSumCode returns the direct sum of codes C1 and C2. The direct sum code
  consists  of  every  codeword  of  C1  concatenated by every codeword of C2.
  Therefore,   if   Ci   was   a   (n_i,M_i,d_i)   code,   the   result  is  a
  (n_1+n_2,M_1*M_2,min(d_1,d_2)) code.
  
  If both C1 and C2 are linear codes, the result is also a linear code. If one
  of  them  is  non-linear,  the  direct  sum is non-linear too. In general, a
  direct sum code is not cyclic.
  
  Performing  a  direct  sum can also be done by adding two codes (see Section
  4.2).  Another  often used method is the `u, u+v'-construction, described in
  UUVCode (6.2-2).
  
    Example  
    gap> C1 := ElementsCode( [ [1,0], [4,5] ], GF(7) );;
    gap> C2 := ElementsCode( [ [0,0,0], [3,3,3] ], GF(7) );;
    gap> D := DirectSumCode(C1, C2);;
    gap> AsSSortedList(D);
    [ [ 1 0 0 0 0 ], [ 1 0 3 3 3 ], [ 4 5 0 0 0 ], [ 4 5 3 3 3 ] ]
    gap> D = C1 + C2;   # addition = direct sum
    true 
  
  
  6.2-2 UUVCode
  
  UUVCode( C1, C2 )  function
  
  UUVCode returns the so-called (u|u+v) construction applied to C1 and C2. The
  resulting code consists of every codeword u of C1 concatenated by the sum of
  u  and  every  codeword  v  of C2. If C1 and C2 have different word lengths,
  sufficient zeros are added to the shorter code to make this sum possible. If
  Ci  is  a  (n_i,M_i,d_i)  code,  the  result  is  an  (n_1+max(n_1,n_2),M_1⋅
  M_2,min(2⋅ d_1,d_2)) code.
  
  If both C1 and C2 are linear codes, the result is also a linear code. If one
  of  them is non-linear, the UUV sum is non-linear too. In general, a UUV sum
  code is not cyclic.
  
  The  function  DirectSumCode returns another sum of codes (see DirectSumCode
  (6.2-1)).
  
    Example  
    gap> C1 := EvenWeightSubcode(WholeSpaceCode(4, GF(2)));
    a cyclic [4,3,2]1 even weight subcode
    gap> C2 := RepetitionCode(4, GF(2));
    a cyclic [4,1,4]2 repetition code over GF(2)
    gap> R := UUVCode(C1, C2);
    a linear [8,4,4]2 U U+V construction code
    gap> R = ReedMullerCode(1,3);
    true 
  
  
  6.2-3 DirectProductCode
  
  DirectProductCode( C1, C2 )  function
  
  DirectProductCode  returns  the direct product of codes C1 and C2. Both must
  be  linear codes. Suppose Ci has generator matrix G_i. The direct product of
  C1  and  C2  then  has the Kronecker product of G_1 and G_2 as the generator
  matrix (see the GAP command KroneckerProduct).
  
  If  Ci  is  a  [n_i,  k_i,  d_i]  code,  the direct product then is an [n_1⋅
  n_2,k_1⋅ k_2,d_1⋅ d_2] code.
  
    Example  
    gap> L1 := LexiCode(10, 4, GF(2));
    a linear [10,5,4]2..4 lexicode over GF(2)
    gap> L2 := LexiCode(8, 3, GF(2));
    a linear [8,4,3]2..3 lexicode over GF(2)
    gap> D := DirectProductCode(L1, L2);
    a linear [80,20,12]20..45 direct product code 
  
  
  6.2-4 IntersectionCode
  
  IntersectionCode( C1, C2 )  function
  
  IntersectionCode  returns  the  intersection  of  codes C1 and C2. This code
  consists  of  all  codewords  that  are both in C1 and C2. If both codes are
  linear,  the  result  is also linear. If both are cyclic, the result is also
  cyclic.
  
    Example  
    gap> C := CyclicCodes(7, GF(2));
    [ a cyclic [7,7,1]0 enumerated code over GF(2),
      a cyclic [7,6,1..2]1 enumerated code over GF(2),
      a cyclic [7,3,1..4]2..3 enumerated code over GF(2),
      a cyclic [7,0,7]7 enumerated code over GF(2),
      a cyclic [7,3,1..4]2..3 enumerated code over GF(2),
      a cyclic [7,4,1..3]1 enumerated code over GF(2),
      a cyclic [7,1,7]3 enumerated code over GF(2),
      a cyclic [7,4,1..3]1 enumerated code over GF(2) ]
    gap> IntersectionCode(C[6], C[8]) = C[7];
    true 
  
  
  The  hull  of  a  linear  code is the intersection of the code with its dual
  code. In other words, the hull of C is IntersectionCode(C, DualCode(C)).
  
  6.2-5 UnionCode
  
  UnionCode( C1, C2 )  function
  
  UnionCode  returns  the  union of codes C1 and C2. This code consists of the
  union  of  all codewords of C1 and C2 and all linear combinations. Therefore
  this  function  works  only for linear codes. The function AddedElementsCode
  can  be  used  for  non-linear  codes,  or  if the resulting code should not
  include   linear   combinations.  See  AddedElementsCode  (6.1-8).  If  both
  arguments are cyclic, the result is also cyclic.
  
    Example  
    gap> G := GeneratorMatCode([[1,0,1],[0,1,1]]*Z(2)^0, GF(2));
    a linear [3,2,1..2]1 code defined by generator matrix over GF(2)
    gap> H := GeneratorMatCode([[1,1,1]]*Z(2)^0, GF(2));
    a linear [3,1,3]1 code defined by generator matrix over GF(2)
    gap> U := UnionCode(G, H);
    a linear [3,3,1]0 union code
    gap> c := Codeword("010");; c in G;
    false
    gap> c in H;
    false
    gap> c in U;
    true 
  
  
  6.2-6 ExtendedDirectSumCode
  
  ExtendedDirectSumCode( L, B, m )  function
  
  The extended direct sum construction is described in section V of Graham and
  Sloane  [GS85].  The  resulting  code consists of m copies of L, extended by
  repeating the codewords of B m times.
  
  Suppose  L  is  an  [n_L,  k_L]r_L  code,  and  B  is  an [n_L, k_B]r_B code
  (non-linear  codes are also permitted). The length of B must be equal to the
  length  of L. The length of the new code is n = m n_L, the dimension (in the
  case of linear codes) is k ≤ m k_L + k_B, and the covering radius is r ≤ ⌊ m
  Ψ( L, B ) ⌋, with
  
  
        \Psi( L, B ) = \max_{u \in F_2^{n_L}} \frac{1}{2^{k_B}} \sum_{v \in B}
        {\rm d}( L, v + u ). 
  
  
  However,  this  computation will not be executed, because it may be too time
  consuming for large codes.
  
  If  L  ⊆  B, and L and B are linear codes, the last copy of L is omitted. In
  this case the dimension is k = m k_L + (k_B - k_L).
  
    Example  
    gap> c := HammingCode( 3, GF(2) );
    a linear [7,4,3]1 Hamming (3,2) code over GF(2)
    gap> d := WholeSpaceCode( 7, GF(2) );
    a cyclic [7,7,1]0 whole space code over GF(2)
    gap> e := ExtendedDirectSumCode( c, d, 3 );
    a linear [21,15,1..3]2 3-fold extended direct sum code
  
  
  6.2-7 AmalgamatedDirectSumCode
  
  AmalgamatedDirectSumCode( c1, c2[, check] )  function
  
  AmalgamatedDirectSumCode  returns the amalgamated direct sum of the codes c1
  and  c2.  The  amalgamated  direct sum code consists of all codewords of the
  form (u | 0 | v) if (u | 0) ∈ c_1 and (0 | v) ∈ c_2 and all codewords of the
  form  (u  |  1 | v) if (u | 1) ∈ c_1 and (1 | v) ∈ c_2. The result is a code
  with length n = n_1 + n_2 - 1 and size M ≤ M_1 ⋅ M_2 / 2.
  
  If  both codes are linear, they will first be standardized, with information
  symbols  in  the  last  and  first coordinates of the first and second code,
  respectively.
  
  If  c1  is a normal code (see IsNormalCode (7.4-5)) with the last coordinate
  acceptable  (see  IsCoordinateAcceptable  (7.4-3)),  and c2 is a normal code
  with  the  first  coordinate acceptable, then the covering radius of the new
  code  is r ≤ r_1 + r_2. However, checking whether a code is normal or not is
  a  lot of work, and almost all codes seem to be normal. Therefore, an option
  check  can be supplied. If check is true, then the codes will be checked for
  normality. If check is false or omitted, then the codes will not be checked.
  In  this  case it is assumed that they are normal. Acceptability of the last
  and  first  coordinate of the first and second code, respectively, is in the
  last case also assumed to be done by the user.
  
    Example  
    gap> c := HammingCode( 3, GF(2) );
    a linear [7,4,3]1 Hamming (3,2) code over GF(2)
    gap> d := ReedMullerCode( 1, 4 );
    a linear [16,5,8]6 Reed-Muller (1,4) code over GF(2)
    gap> e := DirectSumCode( c, d );
    a linear [23,9,3]7 direct sum code
    gap> f := AmalgamatedDirectSumCode( c, d );;
    gap> MinimumDistance( f );;
    gap> CoveringRadius( f );; 
    gap> f;
    a linear [22,8,3]7 amalgamated direct sum code
  
  
  6.2-8 BlockwiseDirectSumCode
  
  BlockwiseDirectSumCode( C1, L1, C2, L2 )  function
  
  BlockwiseDirectSumCode returns a subcode of the direct sum of C1 and C2. The
  fields  of  C1 and C2 must be same. The lists L1 and L2 are two equally long
  with  elements from the ambient vector spaces of C1 and C2, respectively, or
  L1  and  L2  are  two  equally long lists containing codes. The union of the
  codes in L1 and L2 must be C1 and C2, respectively.
  
  In the first case, the blockwise direct sum code is defined as
  
  
        bds = \bigcup_{1 \leq i \leq \ell} ( C_1 + (L_1)_i ) \oplus ( C_2 +
        (L_2)_i ), 
  
  
  where ℓ is the length of L1 and L2, and ⊕ is the direct sum.
  
  In the second case, it is defined as
  
  
        bds = \bigcup_{1 \leq i \leq \ell} ( (L_1)_i \oplus (L_2)_i ). 
  
  
  The length of the new code is n = n_1 + n_2.
  
    Example  
    gap> C1 := HammingCode( 3, GF(2) );;
    gap> C2 := EvenWeightSubcode( WholeSpaceCode( 6, GF(2) ) );;
    gap> BlockwiseDirectSumCode( C1, [[ 0,0,0,0,0,0,0 ],[ 1,0,1,0,1,0,0 ]],
    > C2, [[ 0,0,0,0,0,0 ],[ 1,0,1,0,1,0 ]] );
    a (13,1024,1..13)1..2 blockwise direct sum code
  
  
  6.2-9 ConstructionXCode
  
  ConstructionXCode( C, A )  function
  
  Consider  a  list of j linear codes of the same length N over the same field
  F,  C = { C_1, C_2, ..., C_j }, where the parameter of the ith code is C_i =
  [N,  K_i,  D_i]  and  C_j  ⊂ C_j-1 ⊂ ... ⊂ C_2 ⊂ C_1. Consider a list of j-1
  auxiliary  linear  codes  of  the same field F, A = { A_1, A_2, ..., A_j-1 }
  where  the  parameter of the ith code A_i is [n_i, k_i=(K_i-K_i+1), d_i], an
  [n,  K_1,  d]  linear  code  over  field  F can be constructed where n = N +
  ∑_i=1^j-1  n_i, and d = min{ D_j, D_j-1 + d_j-1, D_j-2 + d_j-2 + d_j-1, ...,
  D_1 + ∑_i=1^j-1 d_i}.
  
  For more information on Construction X, refer to [SRC72].
  
    Example  
    gap> C1 := BCHCode(127, 43);
    a cyclic [127,29,43]31..59 BCH code, delta=43, b=1 over GF(2)
    gap> C2 := BCHCode(127, 47);
    a cyclic [127,22,47..51]36..63 BCH code, delta=47, b=1 over GF(2)
    gap> C3 := BCHCode(127, 55);
    a cyclic [127,15,55]41..62 BCH code, delta=55, b=1 over GF(2)
    gap> G1 := ShallowCopy( GeneratorMat(C2) );;
    gap> Append(G1, [ GeneratorMat(C1)[23] ]);;
    gap> C1 := GeneratorMatCode(G1, GF(2));
    a linear [127,23,1..43]35..63 code defined by generator matrix over GF(2)
    gap> MinimumDistance(C1);
    43
    gap> C := [ C1, C2, C3 ];
    [ a linear [127,23,43]35..63 code defined by generator matrix over GF(2), 
      a cyclic [127,22,47..51]36..63 BCH code, delta=47, b=1 over GF(2), 
      a cyclic [127,15,55]41..62 BCH code, delta=55, b=1 over GF(2) ]
    gap> IsSubset(C[1], C[2]);
    true
    gap> IsSubset(C[2], C[3]);
    true
    gap> A := [ RepetitionCode(4, GF(2)), EvenWeightSubcode( QRCode(17, GF(2)) ) ];
    [ a cyclic [4,1,4]2 repetition code over GF(2), a cyclic [17,8,6]3..6 even weight subcode ]
    gap> CX := ConstructionXCode(C, A);
    a linear [148,23,53]43..74 Construction X code
    gap> History(CX);
    [ "a linear [148,23,53]43..74 Construction X code of", 
      "Base codes: [ a cyclic [127,15,55]41..62 BCH code, delta=55, b=1 over GF(2)\
    , a cyclic [127,22,47..51]36..63 BCH code, delta=47, b=1 over GF(2), a linear \
    [127,23,43]35..63 code defined by generator matrix over GF(2) ]", 
      "Auxiliary codes: [ a cyclic [4,1,4]2 repetition code over GF(2), a cyclic [\
    17,8,6]3..6 even weight subcode ]" ]
  
  
  6.2-10 ConstructionXXCode
  
  ConstructionXXCode( C1, C2, C3, A1, A2 )  function
  
  Consider  a  set of linear codes over field F of the same length, n, C_1=[n,
  k_1,  d_1], C_2=[n, k_2, d_2] and C_3=[n, k_3, d_3] such that C_2 ⊂ C_1, C_3
  ⊂ C_1 and C_4 = C_2 ∩ C_3. Given two auxiliary codes A_1=[n_1, k_1-k_2, e_1]
  and  A_2=[n_2,  k_1-k_3,  e_2]  over  the  same  field  F,  there  exists an
  [n+n_1+n_2,  k_1, d] linear code C_XX over field F, where d = min{d_4, d_3 +
  e_1, d_2 + e_2, d_1 + e_1 + e_2}.
  
  The  codewords  of C_XX can be partitioned into three sections ( v | a | b )
  where v has length n, a has length n_1 and b has length n_2. A codeword from
  Construction XX takes the following form:
  
      ( v | 0 | 0 ) if v ∈ C_4
  
      ( v | a_1 | 0 ) if v ∈ C_3 backslash C_4
  
      ( v | 0 | a_2 ) if v ∈ C_2 backslash C_4
  
      ( v | a_1 | a_2 ) otherwise
  
  For more information on Construction XX, refer to [All84].
  
    Example  
    gap> a := PrimitiveRoot(GF(32));
    Z(2^5)
    gap> f0 := MinimalPolynomial( GF(2), a^0 );
    x_1+Z(2)^0
    gap> f1 := MinimalPolynomial( GF(2), a^1 );
    x_1^5+x_1^2+Z(2)^0
    gap> f5 := MinimalPolynomial( GF(2), a^5 );
    x_1^5+x_1^4+x_1^2+x_1+Z(2)^0
    gap> C2 := CheckPolCode( f0 * f1, 31, GF(2) );; MinimumDistance(C2);; Display(C2);
    a cyclic [31,6,15]10..13 code defined by check polynomial over GF(2)
    gap> C3 := CheckPolCode( f0 * f5, 31, GF(2) );; MinimumDistance(C3);; Display(C3);
    a cyclic [31,6,15]10..13 code defined by check polynomial over GF(2)
    gap> C1 := UnionCode(C2, C3);; MinimumDistance(C1);; Display(C1);
    a linear [31,11,11]7..11 union code of
    U: a cyclic [31,6,15]10..13 code defined by check polynomial over GF(2)
    V: a cyclic [31,6,15]10..13 code defined by check polynomial over GF(2)
    gap> A1 := BestKnownLinearCode( 10, 5, GF(2) );
    a linear [10,5,4]2..4 shortened code
    gap> A2 := DualCode( RepetitionCode(6, GF(2)) );
    a cyclic [6,5,2]1 dual code
    gap> CXX:= ConstructionXXCode(C1, C2, C3, A1, A2 );
    a linear [47,11,15..17]13..23 Construction XX code
    gap> MinimumDistance(CXX);
    17
    gap> History(CXX);        
    [ "a linear [47,11,17]13..23 Construction XX code of", 
      "C1: a cyclic [31,11,11]7..11 union code", 
      "C2: a cyclic [31,6,15]10..13 code defined by check polynomial over GF(2)", 
      "C3: a cyclic [31,6,15]10..13 code defined by check polynomial over GF(2)", 
      "A1: a linear [10,5,4]2..4 shortened code", 
      "A2: a cyclic [6,5,2]1 dual code" ]
  
  
  6.2-11 BZCode
  
  BZCode( O, I )  function
  
  Given  a  set  of  outer  codes  of the same length O_i = [N, K_i, D_i] over
  GF(q^e_i), where i=1,2,...,t and a set of inner codes of the same length I_i
  =  [n,  k_i,  d_i]  over  GF(q),  BZCode  returns a Blokh-Zyablov multilevel
  concatenated   code   with   parameter   [   n  ×  N,  ∑_i=1^t  e_i  ×  K_i,
  min_i=1,...,t{d_i × D_i} ] over GF(q).
  
  Note  that  the  set of inner codes must satisfy chain condition, i.e. I_1 =
  [n,  k_1,  d_1]  ⊂ I_2=[n, k_2, d_2] ⊂ ... ⊂ I_t=[n, k_t, d_t] where 0=k_0 <
  k_1  <  k_2  <  ... < k_t. The dimension of the inner codes must satisfy the
  condition  e_i  = k_i - k_i-1, where GF(q^e_i) is the field of the ith outer
  code.
  
  For more information on Blokh-Zyablov multilevel concatenated code, refer to
  [Bro98].
  
  6.2-12 BZCodeNC
  
  BZCodeNC( O, I )  function
  
  This  function  is  the  same as BZCode, except this version is faster as it
  does  not  estimate the covering radius of the code. Users are encouraged to
  use this version unless you are working on very small codes.
  
    Example  
    gap> #
    gap> # Binary code
    gap> #
    gap> O := [ CyclicMDSCode(2,3,7), BestKnownLinearCode(9,5,GF(2)), CyclicMDSCode(2,3,4) ];
    [ a cyclic [9,7,3]1 MDS code over GF(8), a linear [9,5,3]2..3 shortened code, 
      a cyclic [9,4,6]4..5 MDS code over GF(8) ]
    gap> A := ExtendedCode( HammingCode(3,GF(2)) );;
    gap> I := [ SubCode(A), A, DualCode( RepetitionCode(8, GF(2)) ) ];
    [ a linear [8,3,4]3..4 subcode, a linear [8,4,4]2 extended code, a cyclic [8,7,2]1 dual code ]
    gap> C := BZCodeNC(O, I);
    a linear [72,38,12]0..72 Blokh Zyablov concatenated code
    gap> #
    gap> # Non binary code
    gap> #
    gap> O2 := ExtendedCode(GoppaCode(ConwayPolynomial(5,2), Elements(GF(5))));;
    gap> O3 := ExtendedCode(GoppaCode(ConwayPolynomial(5,3), Elements(GF(5))));;
    gap> O1 := DualCode( O3 );;
    gap> MinimumDistance(O1);; MinimumDistance(O2);; MinimumDistance(O3);;
    gap> Cy := CyclicCodes(5, GF(5));;
    gap> for i in [4, 5] do; MinimumDistance(Cy[i]);; od;
    gap> O  := [ O1, O2, O3 ];
    [ a linear [6,4,3]1 dual code, a linear [6,3,4]2..3 extended code,
      a linear [6,2,5]3..4 extended code ]
    gap> I  := [ Cy[5], Cy[4], Cy[3] ];
    [ a cyclic [5,1,5]3..4 enumerated code over GF(5),
      a cyclic [5,2,4]2..3 enumerated code over GF(5),
      a cyclic [5,3,1..3]2 enumerated code over GF(5) ]
    gap> C  := BZCodeNC( O, I );
    a linear [30,9,5..15]0..30 Blokh Zyablov concatenated code
    gap> MinimumDistance(C);
    15
    gap> History(C);
    [ "a linear [30,9,15]0..30 Blokh Zyablov concatenated code of",
      "Inner codes: [ a cyclic [5,1,5]3..4 enumerated code over GF(5), a cyclic [5\
    ,2,4]2..3 enumerated code over GF(5), a cyclic [5,3,1..3]2 enumerated code ove\
    r GF(5) ]",
      "Outer codes: [ a linear [6,4,3]1 dual code, a linear [6,3,4]2..3 extended c\
    ode, a linear [6,2,5]3..4 extended code ]" ]