# 65.71 BestKnownLinearCode

`BestKnownLinearCode( n, k , F )`

`BestKnownLinearCode` returns the best known linear code of length n, dimension k over field F. The function uses the tables described in section BoundsMinimumDistance to construct this code.

```    gap> C1 := BestKnownLinearCode( 23, 12, GF(2) );
a cyclic [23,12,7]3 binary Golay code over GF(2)
gap> C1 = BinaryGolayCode();
true
gap> Display( BestKnownLinearCode( 8, 4, GF(4) ) );
a linear [8,4,4]2..3 U```
`|`
```U+V construction code of
U: a cyclic [4,3,2]1 dual code of
a cyclic [4,1,4]3 repetition code over GF(4)
V: a cyclic [4,1,4]3 repetition code over GF(4)
gap> C := BestKnownLinearCode(131,47);
a linear [131,47,28..32]23..68 shortened code ```

`BestKnownLinearCode( rec )`

In this form, rec must be a record containing the fields `lowerBound`, `upperBound` and `construction`. It uses the information in this field to construct a code. This form is meant to be used together with the function `BoundsMinimumDistance` (see BoundsMinimumDistance), if the bounds are already calculated.

```    gap> bounds := BoundsMinimumDistance( 20, 17, GF(4) );
an optimal linear [20,17,d] code over GF(4) has d=3
gap> C := BestKnownLinearCode( bounds );
a linear [20,17,3]2 shortened code
gap> C = BestKnownLinearCode( 20, 17, GF(4) );
true ```

GAP 3.4.4
April 1997