arXiv:2008.00695v2 [.IT] 9 Aug 2020 a ubro oeod ihHmigweight Hamming with codewords of number of egtdistribution weight nonzero npr yteteNtrlSineBscRsac rga fS and of Science Program for Research Association University Basic of Science fund Natural Talent Young the the by part in uut1,2020 11, August cding@us (email: China Kong, Hong Kowloon, Bay, Water Clear 16300919 No. Proj. Council, Grants Research Kong Hong the by ufil oe of Codes Subfield The .Hn’ eerhwsspotdi atb h ainlNatu National the by part in supported was research Heng’ . .Dn swt h eateto optrSineadEngine and Science Computer of University, Department the Chang’an with Science, is of Ding . School the with is Heng Z. Let C dmninlsbpc fGF of subspace -dimensional oe vrGF over codes MDS netninfil ihsaldmnin hspprfis pres first paper This dimension. i small fields with small field over extension codes an subfield good very obtaining for idea aiiso eryotmlcdsoe GF over codes optimal nearly of families hspaper. this D oe vrGF over codes MDS eesuidaddsac-pia ufil oe vrGF over codes subfield distance-optimal and studied were sdfie y1 by defined is eety ufil oe fgoerccdsoe ag finite large over codes geometric of codes subfield Recently, iercd,wih itiuin ufil oe vlpolyn oval code, subfield distribution, weight code, Linear A eapiepwr Let power. prime a be i ntesequence the in ftecode the of + ( q ( A q ) aiiso ieso-pia oe vrGF over codes dimension-optimal of families Two . ) 1 hnsuistesbedcdsoe GF over codes subfield the studies then and , z + ( A A 1 2 iigHn,Cnhn Ding Cunsheng Heng, Ziling , z A 2 C ( n q + 2 , code A . , ) k ··· n ··· , d ihmnmm(amn)distance (Hamming) minimum with .I I. , + ( epstv nees An integers. positive be A ) A n NTRODUCTION ne Terms Index ) rdcd eea pnpolm r lopooe in proposed also are problems open Several produced. are n z Abstract seulto equal is C n n h sequence the and , i ehooyi hax,Cia .Dn’ eerhwssuppor was research Ding’s C. China. Shaanxi, in Technology nacode a in ssi ob a be to said is [ a cec onaino hn ne rn ubr11901049 number grant under China of Foundation Science ral q . .hk) ’n706,Cia(mi:[email protected]) (email: China 710064, i’an aniudrgatnme 00Q33 n npr ythe by part in and 2020JQ-343, number grant under haanxi rn,TeHn ogUiest fSineadTechnology, and Science of University Kong Hong The ering, + ( p t ) An . nsagnrlcntuto of construction general a ents 1 ocos eygo iercdsover codes linear good very choose to s C omial. eeotie,where obtained, were , ed GF fields flength of 2 [ n , , t wih oei h ubrof number the if code -weight ( k [ ( q n p , 1 ) , d ( , ( ] k p fsm fthe of some of A ] q , ) ) n 1 oeoe GF over code d r band n several and obtained, are D Codes MDS , ihdmnin3ad4 and 3 dimension with The . ] A code 2 , d ··· Let . q egtenumerator weight = , C A p n vrGF over [ ) [ A q q h key The . ( scle the called is i + + q eoethe denote 1 ) 1 , , scalled is 2 2 , , q q ( ] ] DRAFT q ) ted is 1 , 2

distance-optimal if there is no [n, k, d′] code over GF(q) with d′ > d, dimension-optimal if there

is no [n, k′, d] code over GF(q) with k′ > k, and length-optimal if there is no [n′, k, d] code over

GF(q) with n′ < n. A code is said to be optimal if it is distance-optimal, or dimension-optimal, or length-optimal, or it meets a bound for linear codes. An [n,k,d] code over GF(q) is said to be nearly optimal if an [n 1,k,d] code over GF(q) is distance-optimal, or an [n,k + 1,d] code − over GF(q) is dimension-optimal, or an [n,k,d + 1] code over GF(q) is distance-optimal.

A. Subfield codes and their properties

Let GF(pm) be a finite field with pm elements, where p is a prime and m is a positive integer. In this section, we introduce subfield codes of linear codes and some basic results of subfield codes. m (p) Given an [n,k] code C over GF(p ), we construct a new [n,k′] code C over GF(p) as follows. Let be a generator matrix of C. Take a basis of GF(pm) over GF(p). Represent each entry of G as an m 1 column vector of GF(p)m with respect to this basis, and replace each × entry of G with the corresponding m 1 column vector of GF(p)m. In this way, G is modified × into a km n matrix over GF(p), which generates the new subfield code C (p) over GF(p) with × length n. By definition, the dimension k of C (p) satisfies k mk. It was proved in [5] that the ′ ′ ≤ subfield code C (p) of C is independent of the choices of both G and the basis of GF(pm) over GF(p). Note that the subfield code C (p) contains the subfield subcodes over GF(p) of C as a subset and the two codes over GF(q) are different in general. Notice that the subfield subcodes have been well studied [3]. The following two theorems document basic properties of subfield codes [5].

m Theorem I.1. Let C be an [n,k] linear code over GF(p ). Let G =[gij]1 i k,1 n be a generator ≤ ≤ ≤ ≤ matrix of C. Then the trace representation of C (p) is given by

k k C (p) m = Trpm/p ∑ aigi1 , ,Trpm/p ∑ aigin : a1,...,ak GF(p ) . ( i=1 ! ··· i=1 !! ∈ )

(p) (p) Denote by C ⊥ and C ⊥ the dual codes of C and its subfield code C , respectively. Let (p) (p) (p) C ⊥ denote the subfield code of C ⊥. Since the dimensions of C ⊥ and C ⊥ vary from case (p) (p) to case, there may not be a general relation between the two codes C ⊥ and C ⊥. (p) A relation between the minimal distance of C ⊥ and that of C ⊥ is given as follows.

DRAFT August 11, 2020 3

m Theorem I.2. Let C be an [n,k] linear code over GF(p ). Then the minimal distance d⊥ of C ⊥ and the minimal distance d(p) of C (p) satisfy d(p) d . ⊥ ⊥ ⊥ ≥ ⊥

Two linear codes C1 and C2 are permutation equivalent if there is a permutation of coordinates C C C C C C which sends 1 to 2. If 1 and 2 are permutation equivalent, so are 1⊥ and 2⊥. Two permutation equivalent linear codes have the same dimension and weight distribution. A monomial matrix over a field is a square matrix having exactly one nonzero element of F in each row and column. A monomial matrix M can be written either in the form DP or the

form PD1, where D and D1 are diagonal matrices and P is a permutation matrix.

Let C1 and C2 be two linear codes of the same length over F. Then C1 and C2 are monomially

equivalent if there is a monomial matrix over F such that C2 = C1M. Monomial equivalence and

permutation equivalence are precisely the same for binary codes. If C1 and C2 are monomially equivalent, then they have the same weight distribution. m Let C and C ′ be two monomially equivalent [n,k] code over GF(p ). Let G =[gij] and G =[gij′ ]

be two generator matrices of C and C ′, respectively. By definition, there exist a permutation σ m of the set 1,2, ,n and elements b1,b2, ,bn in GF(p ) such that { ··· } ··· ∗

gij = jgi′σ( j)

for all 1 i k and 1 j n. It then follows that ≤ ≤ ≤ ≤ k k Trpm/p ∑ aigi1 , ,Trpm/p ∑ aigin i=1 ! ··· i=1 !! k k = Trpm/p b1 ∑ aigi′σ(1) , ,Trpm/p bn ∑ aigi′σn . i=1 !! ··· i=1 !!! Then the following conclusions follow from Theorem I.1: If C and C are permutation equivalent, so are C (p) and C (p). • ′ ′ (p) (p) If all bi GF(p) , then C and C are monomially equivalent. • ∈ ∗ ′ (p) (p) However, C and C ′ may not be monomially equivalent even if C and C ′ are monomially equivalent.

B. The motivations and objectives of this paper

Every linear code C over GF(pm) has a subfield code C (p), which may have very good or bad parameters. To obtain a subfield code C (p) with desirable parameters, one has to select the

August 11, 2020 DRAFT 4

code C over GF(pm) properly. Even if a code C over GF(pm) looks simple, the subfield code C (p) could be very complex and it could be very difficult to determine the minimum distance of the subfield code C (p), let alone the weight distribution of the subfield code. For example, the Simplex code C over GF(pm) is extremely simple and a one-weight code, but it is in general very hard to determine the weight distribution of the subfield code C (p). To be able to obtain a very good code C (p) and settle its parameters, one should select an optimal code or very good code C over GF(pm) with small dimension. This idea was successfully used in several references for obtaining infinite families of distance-optimal codes. Linear codes over GF(q) with parameters [q2 + 1,4,q2 q] are called ovoid codes and optimal with respect − to the Griesmer bound, as they correspond to ovoids in PG(3,GF(q)) [4, Chapter 13]. The subfield codes of some ovoid codes are very good [5]. Linear code over GF(2m) with parameters [2m +2,3,2m] are called hyperoval codes, as they correspond to hyperovals in PG(2,GF(2m)) [4, Chapter 12]. Linear code over GF(2m) with parameters [2m + 1,3,2m 1] are called oval codes, − as they correspond to ovals in PG(2,GF(2m)) [4, Chapter 12]. The subfield codes of some hyperoval and oval codes are distance-optimal [7]. Later, the subfield codes of some hyperoval codes were extended to more general cases [13]. Maximal arcs in PG(2,GF(2m)) give [n,3,n h] − two-weight codes over GF(2m), where h = 2s with 1 s < m and n = h2m +h 2m, whose duals ≤ − have parameters [n,n 3,4] if s = 1 and [n,n 3,3] if s > 1 [4, Chapter 12]. The subfield codes − − of some maximal arc codes are distance-optimal [8]. In [9], the subfield codes of some cyclic codes and linear codes with dimension 4 were also investigated. Motivated by the distance-optimal subfield codes obtained in [5], [7], [8], [9], in this paper we first present a general construction of [q + 1,2,q] MDS codes over GF(q), and then study the subfield codes of some of them. Our objective is to construct infinite families of codes over GF(p) with very good parameters. Some conjectures and open problems are proposed.

II. AUXILIARY RESULTS

In this section, we recall characters and some character sums over finite fields which will be needed in later sections. Let p be a prime and q = pm. Let GF(q) be the finite field with q elements and α a primitive

element of GF(q). Let Trq/p denote the trace function from GF(q) to GF(p) given by m 1 − pi Trq/p(x) = ∑ x , x GF(q). i=0 ∈

DRAFT August 11, 2020 5

Denote by ζp a primitive p- root of complex unity. An additive character of GF(q) is a function χ : (GF(q),+) C such that → ∗ χ(x + ) = χ(x)χ(y), x,y GF(q), ∈ where C denotes the set of all nonzero complex numbers. For any a GF(q), the function ∗ ∈

Trq/p(ax) χa(x) = ζp , x GF(q), ∈ defines an additive character of GF(q). In addition, χa : a GF(q) is a group consisting of { ∈ } all the additive characters of GF(q). If a = 0, we have χ0(x) = 1 for all x GF(q) and χ0 is ∈ referred to as the trivial additive character of GF(q). If a = 1, we call χ1 the canonical additive

character of GF(q). Clearly, χa(x) = χ1(ax). The orthogonality relation of additive characters is given by q for a = 0, χ (ax) = ∑ 1  x GF(q) 0 for a GF(q)∗. ∈  ∈ Let GF(q) = GF(q) 0 .A character ψ of the multiplicative group GF(q) is a function from ∗ \{ }  ∗ GF(q) to C such that ψ(xy) = ψ(x)ψ(y) for all (x,y) GF(q) GF(q). Define the multiplication ∗ ∗ ∈ × of two characters ψ,ψ by (ψψ )(x) = ψ(x)ψ (x) for x GF(q) . All the characters of GF(q) ′ ′ ′ ∈ ∗ ∗ are given by k jk ψ j(α ) = ζq 1 for k = 0,1, ,q 1, − ··· −

where 0 j q 2. Then all these ψ j, 0 j q 2, form a group under the multiplication of ≤ ≤ − ≤ ≤ − characters and are called multiplicative characters of GF(q). In particular, ψ0 is called the trivial

multiplicative character and for odd q, η := ψ(q 1)/2 is referred to as the quadratic multiplicative − character of GF(q). The orthogonality relation of multiplicative characters is given by

q 1 for j = 0, ψ (x) = − ∑ j  x GF(q) 0 for j = 0. ∈ ∗  6 For an additive character χ and a multiplicative character ψ of GF(q), the Gauss sum G(ψ,χ) over GF(q) is defined by G(ψ,χ) = ∑ ψ(x)χ(x). x GF(q) ∈ ∗ We call G(η,χ) the quadratic Gauss sum over GF(q) for nontrivial χ. The value of the quadratic Gauss sum is known as follows.

August 11, 2020 DRAFT 6

Lemma II.1. [11, Th. 5.15] Let q = pm with p odd. Let χ be the canonical additive character of GF(q). Then

p 1 2 m 1 ( − ) m G(η,χ) = ( 1) − (√ 1) 2 √q − − m 1 ( 1) − √q forp 1 (mod 4), = − ≡  ( 1)m 1(√ 1)m√q forp 3 (mod 4).  − − − ≡ Let χ be a nontrivial additive character of GF(q) and let f GF(q)[x] be a polynomial of ∈ positive degree. The character sums of the form

∑ χ( f (c)) c GF(q) ∈ are referred to as Weil sums. The problem of evaluating such character sums explicitly is very difficult in general. In certain special cases, Weil sums can be treated (see [11, Section 4 in Chapter 5]). If f is a quadratic polynomial, the Weil sum has an interesting relationship with quadratic Gauss sums, which is described in the following lemma.

Lemma II.2. [11, Th. 5.33] Let χ be a nontrivial additive character of GF(q) with q odd, and 2 let f (x) = a2x + a1x + a0 GF(q)[x] with a2 = 0. Then ∈ 6

2 1 ∑ χ( f (c)) = χ(a0 a1(4a2)− )η(a2)G(η,χ). c GF(q) − ∈ If f is a quadratic polynomial with q even, the Weil sums are evaluated explicitly as follows.

Lemma II.3. [11, Cor. 5.35] Let χb be a nontrivial additive character of GF(q) with b GF(q) , ∈ ∗ 2 and let f (x) = a2x + a1x + a0 GF(q)[x] with q even. Then ∈

2 χb(a0)q ifa2 = ba1, ∑ χb( f (c)) = c GF(q)  0 otherwise. ∈  The Weil sums can also be evaluated explicitly in the case that f is an affine p-polynomial over GF(q).

Lemma II.4. [11, Th. 5.34] Let q = pm and let

pr pr 1 p f (x) = arx + ar 1x − + + a1x + a0x + a − ···

DRAFT August 11, 2020 7

be an affine p-polynomial over GF(q). Let χb be a nontrivial additive character of GF(q) with b GF(q) . Then ∈ ∗ r 1 r 1 r r p p p − p − p p χb(a)q ifbar + b ar 1 + + b a1 + b a0 = 0, ∑ χb( f (c)) = − ··· c GF(q)  0 otherwise. ∈ 

III. PROPERTIES OF [q + 1,2,q] MDS CODES OVER GF(q)

The weight distribution of any [n,k,n k+1] MDS code over GF(q) is known and documented − in the following theorem [12, p. 321].

Theorem III.1. Let C be an [n,κ] code over GF(q) with d = n κ + 1, and let the weight − C n i enumerator of be 1 + ∑i=d Aiz . Then i d n − j i 1 i j d Ai = (q 1) ( 1) − q − − for all d i n. i − ∑ − j ≤ ≤   j=0   It follows from Theorem III.1 that any [q + 1,2,q] MDS code over GF(q) is a one-weight code with weight enumerator 1 +(q2 1)zq. The dual code of any [q + 1,2,q] MDS code over − GF(q) has parameters [q+1,q 1,3]. It is well known that every one-weight code is monomially − equivalent to the concatenation of several Simplex codes. Consequently, every [q + 1,2,q] MDS code over GF(q) must be monomially equivalent to the Simplex code with parameters [q + 1,2,q]. Hence, up to monomial equivalence, there is only one one-weight code over GF(q) with parameters [q + 1,2,q]. However, the subfield codes of [q + 1,2,q] MDS codes over GF(q) are very different, as they have different parameters and weight distributions. Thus, it is still very interesting to investigate [q + 1,2,q] MDS codes over GF(q), as they give different subfield codes. This will be demonstrated in subsequent sections.

IV. A GENERALCONSTRUCTIONOF [q + 1,2,q] MDS CODES OVER GF(q)

Let q = pm as before, where m is a positive integer and p is a prime. Let f (x) be a polynomial over GF(q). Define a 2 (q + 1) matrix over GF(q) by × 0 1 q 2 f (α ) f (α ) f (α − ) 0 1 G( f ,q) = ··· , (1)  α0 α1 αq 2 1 0  ··· −   where α is a generator of GF(q)∗. Let C( f ,q) denote the linear code over GF(q) with generator matrix G( f ,q).

August 11, 2020 DRAFT 8

Theorem IV.1. C( f ,q) is a [q + 1,2,q] MDS code if and only if 1) f (x) = 0 for all x GF(q) , and 6 ∈ ∗ 2) yf (x) xf (y) = 0 for all distinct x and y in GF(q) . − 6 ∗

Proof. Notice that the last two columns of G( f ,q) form a submatrix of rank 2. The code C( f ,q) has dimension 2 for any polynomial f over GF(q), and its dual has dimension q 1. By the − Singleton bound, the minimum distance d⊥ of the dual code C( f ,q) is at most 3.

Assume that Conditions 1) and 2) in this theorem are satisfied. We now prove that d⊥ = 3. Clearly, no column of G is the zero vector. As a result, we deduce that d 2. Note that ( f ,q) ⊥ ≥ 0 1 = 1. − 1 0

For each a GF(q)∗, by Condition 1) we have ∈ f (a) 0 = f (a) = 0. 6 a 1

For each a GF(q)∗, we have ∈ f (a) 1 = a = 0. 6 a 0

For any pair of distinct elements a and b in GF (q)∗, by Condition 2) we have

f (a) f (b) = bf (a) af (b) = 0. − 6 a b

We then arrived at the conclusion that any two columns of G( f ,q) are linearly independent over

GF(q). Consequently, d = 3 and C is a [q+1,q 1,3] MDS code over GF(q). Hence, C ⊥ (⊥f ,q) − ( f ,q) is a [q + 1,2,q] MDS code. Assume that C is a [q+1,2,q] MDS code. Then C is a [q+1,q 1,3] MDS code over ( f ,q) (⊥f ,q) − GF(q). Suppose that f (a) = 0 for some a GF(q) . Then the two columns (0,1)T and ( f (a),a)T ∈ ∗ C in G( f ,q) would be linearly dependent over GF(q) and thus (⊥f ,q) would have a codeword of

Hamming weight 2. This would be contrary to the fact that d⊥ = 3. Hence, Condition 1) must be satisfied. Suppose that bf (a) af (b) = 0 for a pair of distinct elements a and b in GF(q) . Then − ∗ T T the two columns ( f (a),a) and ( f (b),b) in G( f ,q) would be linearly dependent over GF(q) C and thus (⊥f ,q) would have a codeword of Hamming weight 2. This would be contrary to the fact that d⊥ = 3. Hence, Condition 2) must be satisfied. This completes the proof.

DRAFT August 11, 2020 9

C (p) C Theorem IV.2. The trace representation of the p-ary subfield code ( f ,q) of ( f ,q) in Theorem IV.1 is given by

C (p) c (p) Tr af x bx Tr a Tr b : a b GF q ( f ,q) = ( f ,q) = q/p( ( ) + ) x GF(q) , q/p( ), q/p( ) , ( ) . ∈ ∗ ∈ n    Proof. The desired conclusion follows from Equation (1) and Theorem I.1. C (2) If p = 2, the weight distribution of the binary subfield code ( f ,q) can be depicted by the Walsh spectrum of f (x). For a function f (x) from GF(q) to GF(q) with f (0) = 0, its Walsh transform is defined as

Tr (af (x)+bx) Wf (a,b) = ∑ ( 1) q/2 , a,b GF(q). x GF(q) − ∈ ∈ Corollary IV.3. Let p = 2 and f (x) is a function from GF(q) to GF(q) with f (0) = 0. For any codeword c (2) C (2) in Theorem IV.2, its Hamming weight ( f ,q) ∈ ( f ,q) q 1 Wf (a,b) if Tr (a) = Tr (b) = 0, 2 − 2 q/2 q/2 (2) q 1 if Trq/2(a)=0,Trq/2(b)=0 or wt c  W a b 1 6 ( ( f ,q) ) = 2 2 f ( , ) + Tr (a)=0,Tr (b)=0,  − q/2 6 q/2  q 1 Wf (a,b) + 2 if Tr (a) = 0,Tr (b) = 0. 2 − 2 q/2 6 q/2 6  Proof. By the orthogonality relation of additive characters,

♯ x GF(q)∗ : Tr (af (x) + bx) = 0 { ∈ q/2 6 } 1 y(Trq/2(af (x)+bx)) = q 1 2 ∑x GF(q) ∑y GF(2)( 1) − − ∈ ∗ ∈ − q 1 1 Trq/2(af (x)+bx) = q 1 −2 + 2 ∑x GF(q) ( 1) − − ∈ ∗ −  q 1  = Wf (a,b). 2 − 2 For any codeword c (2) = Tr (af (x) + bx) ,Tr (a),Tr (b) C (2) by The- ( f ,q) q/p x GF(q) q/2 q/2 ( f ,q) ∈ ∗ ∈ orem IV.2, we directly obtain its Hamming weight  q 1 Wf (a,b) if Tr (a) = Tr (b) = 0, 2 − 2 q/2 q/2 (2) q 1 if Trq/2(a)=0,Trq/2(b)=0 or wt c  W a b 1 6 ( ( f ,q) ) = 2 2 f ( , ) + Tr (a)=0,Tr (b)=0,  − q/2 6 q/2  q 1 Wf (a,b) + 2 if Tr (a) = 0,Tr (b) = 0. 2 − 2 q/2 6 q/2 6   C (p) In order to obtain p-ary subfield code ( f ,q) with good parameters, one should properly select f . C (p) In the following sections, we investigate the parameters of ( f ,q) with some special polynomials f satisfying the two conditions in Theorem IV.1. As will be seen, there exist many infinite families of polynomials f satisfying the conditions.

August 11, 2020 DRAFT 10

V. THE SUBFIELD CODE OF C( f ,q) WHEN f (x) = 1

Let f (x) = 1. It is easily checked that the two conditions in Theorem IV.1 are satisfied. Hence the code C(1,q) is a [q+1,2,q] MDS code by Theorem IV.1. By Theorem IV.2, the p-ary subfield code of C(1,q) is given by

(p) (p) a GF(p) C c a Tr bx a Tr b : ∈ (1,q) = (1,q) = + q/p( ) x GF(q) , , q/p( ) b GF(q) . ∈ ∗ ∈ n   o p  Theorem .1. Let m 2. Then C ( ) is a nearly optimal [pm +1,m+1,(p 1)pm 1] code with ≥ (1,q) − − respect to the Griesmer bound, and has weight enumerator

m 1 (p 1)pm 1 m (p 1)pm 1+1 pm 1 + p(p − 1)z − − + p (p 1)z − − +(p 1)z . − − −

p The dual code (C ( ) ) has parameters [pm +1, pm m,3] and is dimension-optimal with respect (1,q) ⊥ − to the sphere-packing bound.

p p Proof. Let c( ) = a + Tr (bx) ,a,Tr (b) be any codeword in C ( ) . By the (1,q) q/p x GF(q) q/p (1,q) ∈ ∗ orthogonality relation of additive characters, 

♯ x GF(q)∗ : a + Tr (bx) = 0 { ∈ q/p 6 }

= q 1 ♯ x GF(q)∗ : a + Tr (bx) = 0 − − { ∈ q/p } 1 y(a+Tr (bx)) = q 1 ζ q/p p ∑ ∑ p − − x GF(q) y GF(p) ∈ ∗ ∈ (p 1)(q 1) 1 = − − ζya χ(ybx) p p ∑ p ∑ − y GF(p) x GF(q) ∈ ∗ ∈ ∗ (p 1)(q 1) q 1 ya − p − −p ∑y GF(p) ζp if b = 0 = − ∈ ∗  (p 1)(q 1) 1 ya − p − + p ∑y GF(p) ζp if b = 0  ∈ ∗ 6  0 if a = b = 0,  pm 1 if a = 0,b = 0, =  − 6  (p 1)pm 1 if a = 0,b = 0,  − − 6 m 1 (p 1)p − 1 if a = 0,b = 0.  − − 6 6   DRAFT August 11, 2020 11

By definition, we then have

0 if a = b = 0,  pm if a = 0,b = 0,  6  (p 1)pm 1 if a = 0,b = 0,Tr (b) = 0, wt c(p)  − − 6 q/p ( (1,q)) =   (p 1)pm 1 + 1 if a = 0,Tr (b) = 0,  − − q/p 6 m 1 (p 1)p − if a = 0,b = 0,Trq/p(b) = 0,  − 6 6  m 1  (p 1)p − + 1 if a = 0,Trq/p(b) = 0.  − 6 6   C (p) wt (p) Then the weight distribution of (1,q) follows. The dimension is m + 1 as (c(1,q)) = 0 if and p only if a = b = 0. Then C ( ) has parameters [pm + 1,m + 1,(p 1)pm 1]. Note that (1,q) − −

m (p 1)pm 1 − − = pm. ∑ pi i=0   C (p) Hence (1,q) is nearly optimal with respect to the Griesmer bound. p (p) p By Theorem I.2, the minimal distance d( ) of C ⊥ satisfies d( ) 3 as the dual of C ⊥ (1,q) ⊥ ≥ (1,q) C (p) has minimal distance 3. From the weight distribution of (1,q) and the first four Pless power (p) (p) moments in [10, Page 131], we can prove that A3 ⊥ > 0, where A3 ⊥ denotes the number of the C (p) C (p) codewords with weight 3 in (1,q⊥) . Then the parameters of (1,q⊥) follow. By the sphere-packing C (p) bound, one can deduce that the dual of (1,q) is dimension-optimal.

C (p) The following example shows that (1,q) is very attractive.

C (p) Example 1. Let (1,q) be the code in Theorem V.1. C (p) 1) Let p = 2 and m = 2. Then the set (1,q) is a [5,3,2] binary code and its dual is a [5,2,3] binary code. Both codes have the best known parameters according to the Code Tables at C (p) http://www.codetables.de/. Note that (1,q) is a near MDS code in this case. C (p) 2) Let p = 2 and m = 3. Then the set (1,q) is a [9,4,4] binary code and its dual is a [9,5,3] binary code. Both codes have best known parameters according to the Code Tables at http://www.codetables.de/. C (p) 3) Let p = 3 and m = 2. Then the set (1,q) is a [10,3,6] ternary code and its dual is a [10,7,3] almost MDS ternary code. Both codes have the best known parameters according to the Code Tables at http://www.codetables.de/.

August 11, 2020 DRAFT 12

VI. THE SUBFIELD CODE OF C( f ,q) WHEN f IS A MONOMIAL In this section, let f be a monomial over GF(q) with q = pm, i.. f (x) = xt with t a positive integer.

t Lemma VI.1. Let f (x) = x with t a positive integer. Then C( f ,q) is a [q + 1,2,q] MDS code if and only if gcd(q 1,t 1) = 1. − − Proof. Due to Theorem IV.1, the code C is a [q + 1,2,q] MDS code if and only if zt 1 = 1 ( f ,q) − 6 for all z in GF(q) 1 , which is true if and only if gcd(q 1,t 1) = 1. This completes the ∗ \{ } − − proof.

There obviously exist infinitely many monomials satisfying the condition in Lemma VI.1. In C (p) the following, we select some special monomials f and investigate the parameters of ( f ,q) and its dual.

C (p) pl +1 A. The subfield code ( f ,q) for f (x) = x and m = 2l Let f (x) = xp +1 and m = 2l. Since gcd(q 1,t 1) = gcd(pm 1, pl) = 1, C is a [q+1,2,q] − − − ( f ,q) MDS code by Lemma VI.1. By Theorem IV.2, the p-ary subfield code of C( f ,q) is given by

(p) (p) pl+1 a GF(pl) C c Tr l ax Tr bx Tr l a Tr b : ( f ,q) = ( f ,q) = p /p( ) + q/p( ) , p /p( ), q/p( ) b∈ GF(q) . x GF(q)∗ ∈    ∈   Before investigating the weight distribution of C( f ,q), we present a few lemmas.

Lemma VI.2. Let m = 2l with l 2. Denote by ≥ pl+1 l b N1 = ♯ (a,b) GF(p )∗ GF(q) : Trpl/p = 0,Trpl /p(a) = 0 and Trq/p(b) = 0 . ( ∈ × a ! ) Then l 1 2l 2 l l 1 N1 =(p − 1)(p − p + p − ). − − Proof. By definition,

pl+1 l b N1 = ♯ (a,b) GF(p )∗ GF(q) : Trpl /p = 0,Trpl/p(a) = 0 and Trq/p(b) = 0 ( ∈ × a ! ) pl+1 l b = ♯ (a,b) GF(p )∗ GF(q)∗ : Trpl/p = 0,Trpl/p(a) = 0 and Trq/p(b) = 0 ( ∈ × a ! ) l 1 +(p − 1). (2) −

DRAFT August 11, 2020 13

Denote by χ and φ the canonical additive characters of GF(pl) and GF(q), respectively. For l fixed a GF(p ) satisfying Tr l (a) = 0, ∈ ∗ p /p l bp +1 ♯ b GF(q)∗ : Trpl/p = 0 and Trq/p(b) = 0 ( ∈ a ! ) l bp +1 yTr l a 1 p /p zTrq p(b) = ζ   ζ / p2 ∑ ∑ p ∑ p b GF(q) y GF(p) z GF(p) ∈ ∗ ∈ ∈ l 1 ybp +1 = χ φ(bz) p2 ∑ ∑ a ∑ b GF(q) y GF(p) ! z GF(p) ∈ ∗ ∈ ∈ l q 1 1 ybp +1 1 = − + χ + φ(bz) p2 p2 ∑ ∑ a p2 ∑ ∑ b GF(q) y GF(p) ! b GF(q) z GF(p) ∈ ∗ ∈ ∗ ∈ ∗ ∈ ∗ l 1 ybp +1 + χ φ(bz). (3) p2 ∑ ∑ a ∑ b GF(q) y GF(p) ! z GF(p) ∈ ∗ ∈ ∗ ∈ ∗ pl +1 l Since Norm(b) = b is the norm function from GF(q)∗ onto GF(p )∗, l l ybp +1 ybp +1 χ = χ ∑ ∑ a ∑ ∑ a b GF(q) y GF(p) ! y GF(p) b GF(q) ! ∈ ∗ ∈ ∗ ∈ ∗ ∈ ∗ yb = (pl + 1) χ ′ ∑ ∑ a y GF(p) b GF(pl) ∈ ∗ ′∈ ∗   = (pl + 1)(p 1). − − By the orthogonality relation of additive characters,

∑ ∑ φ(bz) = ∑ ∑ φ(bz) = (p 1). b GF(q) z GF(p) z GF(p) b GF(q) − − ∈ ∗ ∈ ∗ ∈ ∗ ∈ ∗ Therefore, Equation (3) yields

l bp +1 ♯ b GF(q)∗ : Trpl /p = 0 and Trq/p(b) = 0 ( ∈ a ! ) l q 1 (p 1)(pl + 2) 1 ybp +1 = − − − + χ φ(bz). (4) p2 p2 ∑ ∑ a ∑ b GF(q) y GF(p) ! z GF(p) ∈ ∗ ∈ ∗ ∈ ∗ Note that l ybp +1 χ φ(bz) ∑ ∑ a ∑ b GF(q) y GF(p) ! z GF(p) ∈ ∗ ∈ ∗ ∈ ∗ l ybp +1 = χ φ(bz) ∑ ∑ a y,z GF(p) b GF(q) ! ∈ ∗ ∈ ∗

August 11, 2020 DRAFT 14

pl+1 yb l = χ + bz + bp z ∑ ∑ a y,z GF(p) b GF(q) ! ∈ ∗ ∈ ∗ l az2 y az p +1 = χ χ b + ∑ y ∑ a y y,z GF(p) − b GF(q) ! ∈ ∗   ∈ ∗   l y az p +1 az2 = χ b + χ ∑ ∑ a y ∑ y y,z GF(p) b GF(q) ! − y,z GF(p) ∈ ∗ ∈   ∈ ∗   y l = (p 1)2 + χ b p +1 ∑ ∑ a ′ − − y,z GF(p) b GF(q) ∈ ∗ ′∈   y l = χ b p +1 ∑ ∑ a ′ y,z GF(p) b GF(q) ∈ ∗ ′∈ ∗   l y l 2 = (p + 1) χ b′′ = (p + 1)(p 1) , ∑ ∑ a − − y,z GF(p) b GF(pl) ∈ ∗ ′′∈ ∗   where 2 az2 z2 az Tr l Tr l (a) p /p − y − y p /p χ = ζp = ζp = 1 as Tr l (a) = 0, − y   p /p   and we made the substitution b + az b in the fifth equality. By Equation (4), we then have y 7→ ′ pl+1 b 2l 2 l l 1 ♯ b GF(q)∗ : Trpl /p = 0 and Trq/p(b) = 0 = p − p + p − 1. (5) ( ∈ a ! ) − −

l Note that Equation (5) holds for any a GF(p ) such that Tr l (a) = 0. Combining Equations ∈ ∗ p /p (2) and (5) yields

l 1 2l 2 l l 1 l 1 l 1 2l 2 l l 1 N1 =(p − 1)(p − p + p − 1)+(p − 1)=(p − 1)(p − p + p − ). − − − − − − The proof is now completed.

Lemma VI.3. Let m = 2l with l 2. Denote by ≥ l l bp +1 1) N2 = ♯ (a,b) GF(p ) GF(q) : Tr l = 0,Tr l (a) = 0 and Tr (b) = 0 , ∈ ∗ × p /p a 6 p /p q/p  pl+1   Tr b 0 l pl /p a = and exactly one of 2) N3 = ♯ (a,b) GF(p )∗ GF(q) :   , ∈ × Tr a Tr b 0 ( pl /p( ) and q/p( ) equals ) pl+1 Tr b =0 and exactly one of l pl /p a 6 3) N4 = ♯ (a,b) GF(p )∗ GF(q) :   , ∈ × Tr a Tr b 0 ( pl /p( ) and q/p( ) equals ) l l bp +1 4) N5 = ♯ (a,b) GF(p ) GF(q) : Tr l = 0,Tr l (a) = 0 and Tr (b) = 0 , ∈ ∗ × p /p a p /p 6 q/p 6   l   l bp +1 5) N6 = ♯ (a,b) GF(p ) GF(q) : Tr l = 0,Tr l (a) = 0 and Tr (b) = 0 . ∈ ∗ × p /p a 6 p /p 6 q/p 6    

DRAFT August 11, 2020 15

Then l 1 2l 2 l 1 N2 =(p 1)(p 1)(p + p ), − − − − − 2l 2 l 1  N3 = p − (p 1)(2p − 1),  − −  2l 2 2 l 1  N4 = p − (p 1) (2p − 1),  − −  2l 2 2 l 1  N5 = p (p 1) (p 1), − − − −  2l 2 2 l l 1  N6 = p − (p 1) (p p − + 1).  − −  Proof. Let N1 be defined as that in Lemma VI.2. By definition, we have

l 2l 1 l 1 N1 + N2 = ♯ (a,b) GF(p )∗ GF(q) : Tr l (a) = 0 and Tr (b) = 0 = p − (p − 1) ∈ × p /p q/p − n l 1 2l 2 l 1 o N2 =(p 1)(p − 1)(p − + p − ). ⇒ − − (1) (2) Denote by N3 = N3 + N3 , where pl+1 (1) l b N3 = ♯ (a,b) GF(p )∗ GF(q) : Trpl/p = 0,Trpl /p(a) = 0 and Trq/p(b) = 0 , ( ∈ × a ! 6 ) and pl+1 (2) l b N3 = ♯ (a,b) GF(p )∗ GF(q) : Trpl/p = 0,Trpl /p(a) = 0 and Trq/p(b) = 0 . ( ∈ × a ! 6 ) Similarly to the proof of Lemma VI.2, we can derive that

(1) 2l 2 l l 1 N = p − (p p − ). 3 − Observe that

(2) N3 + N1 pl+1 l b = ♯ (a,b) GF(p )∗ GF(q) : Trpl/p = 0 and Trpl/p(a) = 0 ( ∈ × a ! ) pl+1 l b = ♯ (a,b) GF(p )∗ GF(q)∗ : Trpl/p = 0 and Trpl/p(a) = 0 ( ∈ × a ! ) l 1 +(p − 1). (6) − l For fixed a GF(p ) such that Tr l (a) = 0, ∈ ∗ p /p pl+1 b pl+1 Trpl/p = 0 b aker(Trpl/p) 0 . a ! ⇔ ∈ \{ } Since the norm function is a surjective homomorphism, pl+1 l b l l 1 2 ♯ (a,b) GF(p )∗ GF(q)∗ : Trpl/p = 0 and Trpl/p(a) = 0 =(p + 1)(p − 1) . ( ∈ × a ! ) −

August 11, 2020 DRAFT 16

(2) l l 1 2 l 1 By Equation (6), we have N + N1 =(p + 1)(p 1) +(p 1). Then 3 − − − − (2) l l 1 2 l 1 l 1 2l 1 2l 2 N =(p + 1)(p − 1) +(p − 1) N1 =(p − 1)(p − p − ) 3 − − − − − by Lemma VI.2. We then have

(1) (2) 2l 2 l 1 N3 = N + N = p − (p 1)(2p − 1). 3 3 − − l 1 2l 2l 1 2l 1 l l 1 It is easy to deduce that N3 + N4 =(p 1)(p p ) + p (p p ). We directly have − − − − − − − 2l 2 2 l 1 N4 = p − (p 1) (2p − 1). − − It is observed that pl +1 l b N1 + N3 + N5 = ♯ (a,b) GF(p )∗ GF(q) : Trpl/p = 0 ( ∈ × a ! ) pl+1 l l b = (p 1) + ♯ (a,b) GF(p )∗ GF(q)∗ : Trpl/p = 0 − ( ∈ × a ! ) l l l l 1 = (p 1)+(p 1)(p + 1)(p − 1), − − − which implies

l l l l 1 2l 2 2 l 1 N5 =(p 1)+(p 1)(p + 1)(p − 1) (N1 + N3) = p − (p 1) (p − 1). − − − − − − Note that

l N5 + N6 = ♯ (a,b) GF(p )∗ GF(q) : Tr l (a) = 0 and Tr (b) = 0 ∈ × p /p 6 q/p 6 n3l 2 2 o = p − (p 1) . − 3l 2 2 2l 2 2 l l 1 Then N6 = p (p 1) N5 = p (p 1) (p p + 1). The proof is completed. − − − − − − − l p Theorem VI.4. Let m = 2l and f (x) = xp +1 with l 2. Then the p-ary subfield code C ( ) has ≥ ( f ,q) parameters [p2l + 1,3l, pl 1(pl+1 pl 1)] and weight enumerator − − − l 1 2l 2 l 1 pl 1(pl+1 pl 1) 1 +(p 1)(p − 1)(p − + p − )z − − − + − − 2l 2 2 l 1 pl 1(pl+1 pl 1)+1 p − (p 1) (2p − 1)z − − − + − − 2l 2 2 l l 1 pl 1(pl+1 pl 1)+2 p − (p 1) (p p − + 1)z − − − + − − 2l 1 p2l 1(p 1) 2l 2l 1 p2l 1(p 1)+1 (p − 1)z − − +(p p − )z − − + − − l 1 2l 2 l l 1 (p 1)(p2l 1+pl 1) (p − 1)(p − p + p − )z − − − + − − 2l 2 l 1 (p 1)(p2l 1+pl 1)+1 p − (p 1)(2p − 1)z − − − + − −

DRAFT August 11, 2020 17

2l 2 2 l 1 (p 1)(p2l 1+pl 1)+2 p − (p 1) (p − 1)z − − − . − − Its dual is nearly optimal with respect to the sphere-packing bound, and has parameters [p2l + 1, p2l + 1 3l,3]. − (p) pl+1 Proof. Let c( f ,q) = Trpl/p(ax ) + Trq/p(bx) ,Trpl /p(a),Trq/p(b) be any code- x GF(q)∗ C (p)   ∈  word in ( f ,q). By the orthogonality relation of additive characters, pl +1 ♯ x GF(q)∗ : Tr l (ax ) + Tr (bx) = 0 { ∈ p /p q/p 6 } pl +1 = ♯ x GF(q) : Tr l (ax ) + Tr (bx) = 0 { ∈ p /p q/p 6 } pl +1 1 y Tr l (ax )+Trq/p(bx) = q ζ p /p p ∑ ∑ p  − x GF(q) y GF(p) ∈ ∈ pl +1 pl pl 1 y Tr l (ax +bx+b x ) = q ζ p /p p ∑ ∑ p  − x GF(q) y GF(p) ∈ ∈ (p 1)q 1 l l l = − χ(yaxp +1 + ybx + ybp xp ), (7) p p ∑ ∑ − y GF(p) x GF(q) ∈ ∗ ∈ where χ denotes the canonical additive character of GF(pl). If a = 0, then 6 pl+1 pl pl pl pl+1 pl +1 pl pl pl +1 b b x b b yax + ybx + yb x = ya x + x + = ya x + 2 a a !  a ! − a  for y GF(p) . By Equation (7),   ∈ ∗ pl+1 ♯ x GF(q)∗ : Tr l (ax ) + Tr (bx) = 0 { ∈ p /p q/p 6 } l l p +1 l (p 1)q 1 bp bp +1 = − χ ya x + p p ∑ ∑ a a2 − y GF(p) x GF(q)   ! −  ∈ ∗ ∈ l l   l p +1 (p 1)q 1 bp +1 bp = − χ y χ ya x + p p ∑ a ∑ a − y GF(p) − ! x GF(q)  !  ∈ ∗ ∈ pl +1   (p 1)q 1 b l = − χ y χ yax p +1 , p p ∑ a ∑ ′ − y GF(p) − ! x GF(q) ∈ ∗ ′∈   pl l where we made the substitution x + b x in the last equality. Note that Norm(x ) = x p +1 is a 7→ ′ ′ ′ l the norm function from GF(q)∗ onto GF(p )∗. Therefore,

pl+1 pl +1 l l χ yax′ = 1 + χ yax′ = 1 +(p + 1) χ(yaz) = p . ∑ ∑ ∑ − x GF(q) x GF(q) z GF(pl) ′∈   ′∈ ∗   ∈ ∗

August 11, 2020 DRAFT 18

Then we have

pl +1 ♯ x GF(q)∗ : Tr l (ax ) + Tr (bx) = 0 { ∈ p /p q/p 6 } l (p 1)q bp +1 = − + pl 1 χ y p − ∑ a y GF(p) − ! ∈ ∗ l bp +1 yTr l 2l 1 l 1 − p /p a = (p 1)p − + p − ∑ ζp   − y GF(p) ∈ ∗ l 2l 1 l 1 bp +1 (p 1)(p + p ) if Tr l = 0, − − − p /p a =   l  l 1 l+1 l bp +1  p (p p 1) if Tr l = 0,  − − − p /p a 6   by the orthogonality relation of additive characters. By definition, we have  pl+1 if Tr b =0 and Tr (a)=0, (p 1)(p2l 1 + pl 1) pl /p a pl/p − −    − Trq/p(b)=0, l  bp +1  l 1 l 1 l if Tr l =0 and Tr l (a)=0,  p (p + p 1) p /p a 6 p /p  −    − − Trq/p(b)=0,  l  bp +1  if Tr l a =0 and exactly one of  (p 1)(p2l 1 + pl 1) + 1 p /p  − − −   (p)  Trpl /p(a) and Trq/p(b) equals 0, wt(c ) =  l (8) ( f ,q)  bp +1  if Tr l =0 and exactly one of  l 1 l+1 l p /p a 6  p − (p p 1) + 1   − − Tr a Tr b 0 pl /p( ) and q/p( ) equals , l  bp +1  2l 1 l 1 if Tr l =0 and Tr l (a)=0,  (p 1)(p + p ) + 2 p /p a p /p 6  − −    − Trq/p(b)=0,  l 6  bp +1  l 1 l 1 l if Tr l =0 and Tr l (a)=0,  p (p + p 1) + 2 p /p a 6 p /p 6  −    − − Trq/p(b)=0.  6  If a 0, then the codeword c (p) Tr bx 0 Tr b . It is easy to deduce =  ( f ,q) = q/p( ) x GF(q) , , q/p( ) ∈ ∗ that    0 if a = b = 0, (p) wt(c ) =  p2l 1(p 1) if a = 0,b = 0,Tr (b) = 0, (9) ( f ,q)  − q/p  − 6  p2l 1(p 1) + 1 if a = 0,Tr (b) = 0. − − q/p 6   (p) C (p) Due to Equations (8) and (9), we deduce that the minimal distance d of ( f ,q) satisfies d(p) pl 1(pl+1 pl 1). By Lemma VI.3 and Equation (8), ≥ − − − l 1 2l 2 l 1 Apl 1(pl+1 pl 1) = N2 =(p 1)(p − 1)(p − + p − ) > 0 for l 2. − − − − − ≥ p Therefore, the minimal distance d(p) = pl 1(pl+1 pl 1). The dimension of C ( ) is 3l as − − − ( f ,q) p wt(c( ) ) = 0 if and only if a = b = 0 for l 2 by Equations (8) and (9). The parameters of ( f ,q) ≥

DRAFT August 11, 2020 19

C (p) ( f ,q) follow. Note that the frequency of each weight in Equation (9) is easy to derive. Then the C (p) weight distribution of ( f ,q) follows from Lemmas VI.2 and VI.3. p (p) p By Theorem I.2, the minimal distance d( ) of C ⊥ satisfies d( ) 3 as the dual of C ⊥ ( f ,q) ⊥ ≥ ( f ,q) C (p) has minimal distance 3. From the weight distribution of ( f ,q) and the first four Pless power (p) (p) moments in [10, Page 131], we can prove that A3 ⊥ > 0, where A3 ⊥ denotes the number of the (p) (p) C ⊥ C ⊥ codewords with weight 3 in ( f ,q) . Then the parameters of ( f ,q) follow. By the sphere-packing bound, one can deduce that d(p) 4. Hence the dual of C (p) is nearly optimal with respect ⊥ ≤ ( f ,q) to the sphere-packing bound. C (p) Theorem VI.4 shows that the code ( f ,q) is projective as its dual has minimal distance 3. The C (p) following example shows that ( f ,q) has very good parameters.

l Example 2. Let m = 2l and f (x) = xp +1 with l 2. ≥ C (p) 1) Let p = 2 and l = 2. Then the set ( f ,q) in Theorem VI.4 is a [17,6,6] binary code whose dual is a [17,11,3] binary code, while the corresponding best known parameters are [17,6,7] and [17,11,4] according to the Code Tables at http://www.codetables.de/. C (p) 2) Let p = 2 and l = 3. Then the set ( f ,q) in Theorem VI.4 is a [65,9,28] binary code whose dual is a [65,56,3] binary code, while the corresponding best known parameters are [65,9,28] and [65,56,4] according to the Code Tables at http://www.codetables.de/. C (p) 3) Let p = 3 and l = 2. Then the set ( f ,q) in Theorem VI.4 is a [82,6,51] ternary code, while the corresponding best known parameters are [82,6,52] according to the Code Tables at http://www.codetables.de/. Its dual is a [82,76,3] ternary code which has the best known parameters according to the Code Tables at http://www.codetables.de/.

C (p) 2 B. The subfield code ( f ,q) for f (x) = x and odd p Let f (x) = x2 and p be odd. Then gcd(q 1,2 1) = 1 and C is a [q + 1,2,q] MDS code − − ( f ,q) by Lemma VI.1. It is known that f (x) = x2 is a planar function over GF(q). By Theorem IV.2, the p-ary subfield code of C( f ,q) is given by

(p) (p) 2 a GF(q) C c Tr ax bx Tr a Tr b : ∈ ( f ,q) = ( f ,q) = q/p( + ) x GF(q) , q/p( ), q/p( ) b GF(q) . ∈ ∗ ∈ n    o Lemma VI.5. Let m be odd. The followings hold. 1)

b2 N1 := ♯ (a,b) GF(q) GF(q) : a = 0,Tr ( ) = 0,Tr (a) = 0,Tr (b) = 0 ∈ × 6 q/p 4a q/p q/p n o

August 11, 2020 DRAFT 20

=(pm 1 1)pm 2. − − − 2)

b2 N2 := ♯ (a,b) GF(q) GF(q) : a = 0,Tr ( ) = 0,Tr (a) = 0,Tr (b) = 0 ∈ × 6 q/p 4a q/p q/p 6 n o =(pm 1 1)(pm 1 pm 2). − − − − − 3)

b2 N3 := ♯ (a,b) GF(q) GF(q) : a = 0,Tr ( ) = 0,Tr (a) = 0,Tr (b) = 0 ∈ × 6 q/p 4a q/p 6 q/p n o = pm 2(p 1)(pm 1 + p 1). − − − − 4)

b2 N4 := ♯ (a,b) GF(q) GF(q) : a = 0,Tr ( ) = 0,Tr (a) = 0,Tr (b) = 0 ∈ × 6 q/p 4a q/p 6 q/p 6 n o = pm 2(p 1)2(pm 1 1). − − − − Proof. Firstly, we compute b2 N1 = ♯ (a,b) GF(q) GF(q) : a = 0,Tr ( ) = 0,Tr (a) = 0,Tr (b) = 0 . ∈ × 6 q/p 4a q/p q/p   For fixed nonzero a satisfying Trq/p(a) = 0, we have b2 ♯ b GF(q) : Tr ( ) = 0 and Tr (b) = 0 ∈ q/p 4a q/p   1 yb2 = χ( ) χ(zb) p2 ∑ ∑ 4a ∑ b GF(q) y GF(p) z GF(p) ∈ ∈ ∈ 1 1 yb2 = pm 2 + χ(zb) + χ( ) − p2 ∑ ∑ p2 ∑ ∑ 4a z GF(p) b GF(q) b GF(q) y GF(p) ∈ ∗ ∈ ∈ ∈ ∗ 1 yb2 + χ( ) χ(zb) p2 ∑ ∑ 4a ∑ b GF(q) y GF(p) z GF(p) ∈ ∈ ∗ ∈ ∗ 1 yb2 1 yb2 = pm 2 + 0 + χ( ) + χ( + zb), − p2 ∑ ∑ 4a p2 ∑ ∑ ∑ 4a y GF(p) b GF(q) y GF(p) z GF(p) b GF(q) ∈ ∗ ∈ ∈ ∗ ∈ ∗ ∈ where χ denotes the canonical additive character of GF(q). Let η,η′ be the quadratic multiplica-

tive character of GF(q)∗ and GF(p)∗, respectively. By Lemma II.2 and the orthogonality relation of multiplicative characters, yb2 y χ( ) = G(η,χ) η( ) = G(η,χ)η(a 1) η (y) = 0, (10) ∑ ∑ 4a ∑ a − ∑ ′ y GF(p) b GF(q) y GF(p) y GF(p) ∈ ∗ ∈ ∈ ∗ ∈ ∗

DRAFT August 11, 2020 21

yb2 y a χ( + zb) = G(η,χ) η( ) χ( z2) ∑ ∑ ∑ 4a ∑ a ∑ y y GF(p) z GF(p) b GF(q) y GF(p) z GF(p) − ∈ ∗ ∈ ∗ ∈ ∈ ∗ ∈ ∗ z2 1 y Trq/p(a) = G(η,χ)η(a− ) ∑ η(y) ∑ ζ−p y GF(p) z GF(p) ∈ ∗ ∈ ∗ 1 = (p 1)G(η,χ)η(a− ) ∑ η′(y) = 0 − y GF(p) ∈ ∗ as η(y) = η (y) for y GF(p) and Tr (a) = 0. Hence ′ ∈ ∗ q/p 2 b m 2 b GF(q) : Tr ( ) = 0 and Tr (b) = 0 = p − ∈ q/p 4a q/p   for any fixed nonzero a satisfying Trq/p(a) = 0 and

m 1 m 2 N1 =(p − 1)p − . − Secondly, we compute b2 N3 = ♯ (a,b) GF(q) GF(q) : a = 0,Tr ( ) = 0,Tr (a) = 0,Tr (b) = 0 . ∈ × 6 q/p 4a q/p 6 q/p   By definition, b2 N1 + N3 = ♯ (a,b) GF(q) GF(q) : a = 0,Tr ( ) = 0,Tr (b) = 0 ∈ × 6 q/p 4a q/p   1 b2y = χ( ) χ(bz) p2 ∑ ∑ ∑ 4a ∑ a GF(q) b GF(q) y GF(p) z GF(p) ∈ ∗ ∈ ∈ ∈ 1 1 yb2 = pm 2(pm 1) + χ(zb) + χ( ) − p2 ∑ ∑ ∑ p2 ∑ ∑ ∑ 4a − a GF(q) z GF(p) b GF(q) a GF(q) b GF(q) y GF(p) ∈ ∗ ∈ ∗ ∈ ∈ ∗ ∈ ∈ ∗ 1 yb2 + χ( ) χ(zb) p2 ∑ ∑ ∑ 4a ∑ a GF(q) b GF(q) y GF(p) z GF(p) ∈ ∗ ∈ ∈ ∗ ∈ ∗ 1 yb2 = pm 2(pm 1) + 0 + χ( ) − p2 ∑ ∑ ∑ 4a − a GF(q) y GF(p) b GF(q) ∈ ∗ ∈ ∗ ∈ 1 yb2 + χ( + zb). p2 ∑ ∑ ∑ ∑ 4a y GF(p) z GF(p) a GF(q) b GF(q) ∈ ∗ ∈ ∗ ∈ ∗ ∈ By Equation (10), we have yb2 χ( ) = 0. ∑ ∑ ∑ 4a a GF(q) y GF(p) b GF(q) ∈ ∗ ∈ ∗ ∈ By the orthogonality relation of additive characters, yb2 χ( + zb) ∑ ∑ ∑ ∑ 4a y GF(p) z GF(p) a GF(q) b GF(q) ∈ ∗ ∈ ∗ ∈ ∗ ∈

August 11, 2020 DRAFT 22

yb2 = (p 1)2(q 1) + χ( + zb) ∑ ∑ ∑ ∑ 4a − − y GF(p) z GF(p) a GF(q) b GF(q) ∈ ∗ ∈ ∗ ∈ ∗ ∈ ∗ yb2 = (p 1)2(q 1) + χ(zb) χ( ) ∑ ∑ ∑ ∑ 4a − − y GF(p) z GF(p) b GF(q) a GF(q) ∈ ∗ ∈ ∗ ∈ ∗ ∈ ∗ = (p 1)2(q 1) ∑ ∑ ∑ χ(zb) − − − y GF(p) z GF(p) b GF(q) ∈ ∗ ∈ ∗ ∈ ∗ = pm(p 1)2. − m 2 m 2 m 2 m 1 Hence N1 + N3 = p (p + p 2p) and then N3 = p (p 1)(p + p 1). − − − − − − The values of N2 and N4 can be easily determined by their connections with N1 and N3.

Lemma VI.6. Let m be an odd positive integer and q = pm.

1) Denote by N5 the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6  b2 Trq/p( ) = 0,  4a 6  b2  η(a)η′ Trq/p( 4a ) = 1,  −    Trq/p(a) = 0,  Tr (b) = 0,  q/p   (p 1)(m+1) m 1 m 1 m 2  − − (p 1)(p − 1)(p − +(1) 4 p 2 ) then N5 = − − 2 − .

2) Denote by N6 the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6  b2 Trq/p( ) = 0,  4a 6  b2  η(a)η′ Trq/p(4a ) = 1,  − −    Trq/p(a) = 0,  Tr (b) = 0,  q/p   (p 1)(m+1)+4 m 1 m 1 m 2  − − (p 1)(p − 1)(p − +( 1) 4 p 2 ) then N6 = − − 2− .

3) Denote by N7 the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6  b2 Trq/p( ) = 0,  4a 6  b2  η(a)η′ Trq/p( 4a ) = 1,  −    Trq/p(a) = 0,  Tr (b) = 0,  q/p 6    DRAFT August 11, 2020 23

m 2 2 m 1 p − (p 1) (p − 1) then N7 = − 2 − .

4) Denote by N8 the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2  η(a)η Tr ( b ) = 1,  ′ − q/p 4a   Tr (a) = 0,  q/p 6   Trq/p(b) = 0,  m 2 2 m 1  p − (p 1) (p − 1)  then N8 = − 2 − . 

5) Denote by N9 the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2  η(a)η Tr ( b ) = 1,  ′ − q/p 4a   Tr (a) = 0,  q/p 6  Tr (b) = 0,  q/p 6   (p 1)(m+1) 3(m 1) m 2 2 m m 1  − − 2 p − (p 1) (p p − +1)+( 1) 4 p 2 (p 1) then N9 = − − 2− − .

6) Denote by N10 the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6  b2 Trq/p( ) = 0,  4a 6  b2  η(a)η′ Trq/p(4a ) = 1,  − −    Trq/p(a) = 0,   Trq/p(b) = 0,  6 m 2 2 m 1  p − (p 1) (p − 1) then N10 = − 2 − .

7) Denote by N11 the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2  η(a)η Tr ( b ) = 1,  ′ − q/p 4a −   Tr (a) = 0,  q/p 6   Trq/p(b) = 0,  m 2 2 m 1  p − (p 1) (p − 1) then N11 = − 2 − .

August 11, 2020 DRAFT 24

8) Denote by N12 the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2  η(a)η Tr ( b ) = 1,  ′ − q/p 4a −   Tr (a) = 0,  q/p 6  Tr (b) = 0,  q/p 6   (p 1)(m+1)+4 3(m 1) m 2 2 m m 1 − − 2 p − (p 1) (p p −+1)+( 1) 4 p 2 (p 1) then N12 = − − −2 − .

Proof. Suppose that GF(q) = α and GF(p) = β . Let C0,C be the cyclic groups generated ∗ h i ∗ h i 0′ 2 2 by α and β , respectively. Denote by χ and χ′ the canonical additive characters of GF(q) and

GF(p), respectively. Let η,η′ be the quadratic multiplicative characters of GF(q) and GF(p), respectively.

Firstly, we determine N5. b2 b2 1) If η(a) = η Tr ( ) = 1, then a C0 and Tr ( ) C . Now fix nonzero a such ′ − q/p 4a ∈ q/p 4a ∈ − 0′ b2 2t p 3 that Tr (a) = 0 and η(a) = 1. Let Tr ( ) + β = 0 for some 0 t − . Then q/p q/p 4a ≤ ≤ 2 b2 ♯ b GF(q) : Tr ( ) + β2t = 0 and Tr (b) = 0 { ∈ q/p 4a q/p } 2 1 yTr ( b )+yβ2t = ζ q/p 4a χ(zb) p2 ∑ ∑ p ∑ b GF(q) y GF(p) z GF(p) ∈ ∈ ∈ 1 yb2 = pm 2 + 0 + χ (yβ2t) χ( ) − p2 ∑ ′ ∑ 4a y GF(p) b GF(q) ∈ ∗ ∈ 1 yb2 + χ (yβ2t) χ( + zb). p2 ∑ ′ ∑ ∑ 4a y GF(p) z GF(p) b GF(q) ∈ ∗ ∈ ∗ ∈ By Lemmas II.2 and II.1, yb2 χ (yβ2t) χ( ) ∑ ′ ∑ 4a y GF(p) b GF(q) ∈ ∗ ∈ 2t 2t = G(η,χ) ∑ χ′(yβ )η′(yβ ) y GF(p) ∈ ∗ = G(η,χ)G(η′,χ′)

(p 1)(m+1) m+1 = ( 1) − 4 p 2 , − yb2 χ (yβ2t) χ( + zb) ∑ ′ ∑ ∑ 4a y GF(p) z GF(p) b GF(q) ∈ ∗ ∈ ∗ ∈

DRAFT August 11, 2020 25

z2 2t 2t y Trq/p(a) = G(η,χ) ∑ χ′(yβ )η′(yβ ) ∑ ζ−p y GF(p) z GF(p) ∈ ∗ ∈ ∗ (p 1)(m+1) m+1 − = (p 1)G(η,χ)G(η′,χ′)=( 1) 4 p 2 (p 1), − − −

due to Trq/p(a) = 0 and η(a) = 1. Then 2 b (p 1)(m+1) m 1 2t m 2 − − ♯ b GF(q) : Tr ( ) + β = 0 and Tr (b) = 0 = p − +( 1) 4 p 2 { ∈ q/p 4a q/p } − p 3 for all 0 t − and any fixed nonzero a such that Tr (a) = 0 and η(a) = 1. ≤ ≤ 2 q/p b2 b2 2) If η(a) = η Tr ( ) = 1, then a αC0 and Tr ( ) βC . Now fix nonzero ′ − q/p 4a − ∈ q/p 4a ∈ − 0′ b2 2t+1 p 3 a such that Tr (a) = 0 and η(a) = 1. Let Tr ( ) + β = 0 for some 0 t − . q/p − q/p 4a ≤ ≤ 2 Similarly to 1), we can obtain that 2 (p 1)(m+1) m 1 b 2t m 2 − ♯ b GF(q) : Tr ( ) + β = 0 and Tr (b) = 0 = p − +( 1) 4 p −2 { ∈ q/p 4a q/p } − p 3 for all 0 t − and any fixed nonzero a such that Tr (a) = 0 and η(a) = 1. ≤ ≤ 2 q/p − By [7, Lemma 14],

♯ a GF(q ) : η(a) = 1 and Tr (a) = 0 = ♯ a GF(q ) : η(a) = 1 and Tr (a) = 0 { ∈ ∗ q/p } { ∈ ∗ − q/p } m 1 p − 1 = 2 − . Therefore, m 1 m 2 (p 1)(m+1) m 1 (p 1)(p 1)(p +( 1) − 4 p −2 ) N = − − − − − . 5 2 Similarly, it can be proved that m 1 m 2 (p 1)(m+1)+4 m 1 (p 1)(p 1)(p +( 1) − 4 p −2 ) N = − − − − − . 6 2

Secondly, we compute N7. Note that N5 + N7 equals the number of the solutions (a,b) ∈ GF(q) GF(q) of × a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2  η(a)η Tr ( b ) = 1,  ′ − q/p 4a Tr (a) = 0.   q/p  b2  b2 1) If η(a) = η′ Trq/p( ) = 1, then Trq/p( ) C′ . Now fix nonzero a such that − 4a 4a ∈ − 0 b2 2t p 3 Tr (a) = 0 and η(a) = 1. Let Tr ( )+β = 0 for some 0 t − . By Lemmas II.2 q/p q/p 4a ≤ ≤ 2 and II.1, b2 ♯ b GF(q) : Tr ( ) + β2t = 0 { ∈ q/p 4a }

August 11, 2020 DRAFT 26

2 1 yTr ( b )+yβ2t = ζ q/p 4a p ∑ ∑ p b GF(q) y GF(p) ∈ ∈ 1 yb2 = pm 1 + χ (yβ2t) χ( ) − p ∑ ′ ∑ 4a y GF(p) b GF(q) ∈ ∗ ∈ 1 = pm 1 + G(η,χ)G(η ,χ ) − p ′ ′ (p 1)(m+1) m 1 m 1 − − = p − +( 1) 4 p 2 − p 3 for all 0 t −2 and any fixed nonzero a such that Trq/p(a) = 0 and η(a) = 1. ≤ ≤ 2 2 2) If η(a) = η Tr ( b ) = 1, then Tr ( b ) βC . Now fix nonzero a such that ′ − q/p 4a − q/p 4a ∈ − 0′ b2 2t+1 p 3 Tr (a) = 0 and η(a) = 1. Let Tr ( )+β = 0 for some 0 t − . By Lemmas q/p − q/p 4a ≤ ≤ 2 II.2 and II.1, b2 ♯ b GF(q) : Tr ( ) + β2t+1 = 0 { ∈ q/p 4a } 2 1 yTr ( b )+yβ2t+1 = ζ q/p 4a p ∑ ∑ p b GF(q) y GF(p) ∈ ∈ 1 yb2 = pm 1 + χ (yβ2t+1) χ( ) − p ∑ ′ ∑ 4a y GF(p) b GF(q) ∈ ∗ ∈ 1 = pm 1 + G(η,χ)G(η ,χ ) − p ′ ′ (p 1)(m+1) m 1 m 1 − = p − +( 1) 4 p −2 − p 3 for all 0 t − and any fixed nonzero a such that Tr (a) = 0 and η(a) = 1. ≤ ≤ 2 q/p − By [7, Lemma 14] and the preceding discussions, we then deduce that

m 1 m 1 (p 1)(m+1) m 1 (p 1)(p 1)(p +( 1) − 4 p −2 ) N + N = − − − − − 5 7 2 and pm 2(p 1)2(pm 1 1) N = − − − − . 7 2

Thirdly, we compute N8. Note that N5 +N8 equals the number of the solutions (a,b) GF(q) ∈ × GF(q) of a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2  η(a)η Tr ( b ) = 1,  ′ − q/p 4a Tr (b) = 0.   q/p    DRAFT August 11, 2020 27

b2 b2 b2 2t 1) If η(a) = η Tr ( ) = 1, then a C0 and Tr ( ) C . Let Tr ( ) + β = 0 ′ − q/p 4a ∈ q/p 4a ∈ − 0′ q/p 4a p 3 for some 0 t − . Then ≤ ≤ 2 2 b 2t ♯ (a,b) C0 GF(q) : Tr ( ) + β = 0 and Tr (b) = 0 { ∈ × q/p 4a q/p } 2 1 yTr ( b )+yβ2t = ζ q/p 4a χ(zb) p2 ∑ ∑ ∑ p ∑ a C0 b GF(q) y GF(p) z GF(p) ∈ ∈ ∈ ∈ pm 2(pm 1) 1 yb2 = − − + 0 + χ (yβ2t) χ( ) 2 p2 ∑ ′ ∑ ∑ 4a y GF(p) a C0 b GF(q) ∈ ∗ ∈ ∈ 1 yb2 + χ (yβ2t) χ( + zb). p2 ∑ ′ ∑ ∑ ∑ 4a y GF(p) z GF(p) a C0 b GF(q) ∈ ∗ ∈ ∗ ∈ ∈ By Lemmas II.2 and II.1, yb2 χ (yβ2t) χ( ) ∑ ′ ∑ ∑ 4a y GF(p) a C0 b GF(q) ∈ ∗ ∈ ∈ (pm 1)G(η,χ) = − χ (yβ2t)η (yβ2t) 2 ∑ ′ ′ y GF(p) ∈ ∗ m (p 1)(m+1) m+1 m G(η,χ)G(η ,χ )(p 1) ( 1) − 4 p 2 (p 1) = ′ ′ − = − − , 2 2

yb2 χ (yβ2t) χ( + zb) ∑ ′ ∑ ∑ ∑ 4a y GF(p) z GF(p) a C0 b GF(q) ∈ ∗ ∈ ∗ ∈ ∈ 2 2t 2t z = G(η,χ) χ′(yβ )η′(yβ ) χ( a) ∑ ∑ ∑ − y y GF(p) z GF(p) a C0 ∈ ∗ ∈ ∗ ∈ 1 z2 = G(η,χ) χ (yβ2t)η (yβ2t) χ( a2) 2 ∑ ′ ′ ∑ ∑ y y GF(p) z GF(p) a GF(q) − ∈ ∗ ∈ ∗ ∈ ∗ 1 p+1 2 1 = ( 1) 2 G(η,χ) (p 1) (p 1)G(η,χ)G(η′,χ′) 2 − − − 2 − m (p 1)(m+1) m+1 p (p 1) ( 1) − 4 (p 1)p 2 = − − − , − 2 − 2 due to η(a) = 1. Then

2 b 2t ♯ (a,b) C0 GF(q) : Tr ( ) + β = 0 and Tr (b) = 0 { ∈ × q/p 4a q/p } m 1 m 1 (p 1)(m+1) m 1 m 1 p (p 1) ( 1) − 4 p −2 (p 1) = − − − + − − − , 2 2 p 3 for all 0 t − . ≤ ≤ 2

August 11, 2020 DRAFT 28

b2 b2 b2 2) If η(a) = η Tr ( ) = 1, then a αC0 and Tr ( ) βC . Let Tr ( ) + ′ − q/p 4a − ∈ q/p 4a ∈ − 0′ q/p 4a 2t+1 p 3 β = 0 for some 0 t  − . Similarly, we can prove that ≤ ≤ 2 2 b 2t+1 ♯ (a,b) C0 GF(q) : Tr ( ) + β = 0 and Tr (b) = 0 { ∈ × q/p 4a q/p } m 1 m 1 (p 1)(m+1) m 1 m 1 p (p 1) ( 1) − 4 p −2 (p 1) = − − − + − − − , 2 2 p 3 for all 0 t − . ≤ ≤ 2 Hence (p 1)(m+1) m 1 m 1 m 1 − − m 1 (p 1) p − (p − 1)+( 1) 4 p 2 (p − 1) N + N = − − − − 5 8  2  and pm 2(p 1)2(pm 1 1) N = − − − − . 8 2

Fourthly, we determine N9. Note that N5 +N7 +N8 +N9 is equal to the number of the solutions (a,b) GF(q) GF(q) of ∈ × a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2  η(a)η Tr ( b ) = 1. ′ − q/p 4a Similarly to the proof of N + N, we can prove that  5 7 m m 1 (p 1)(m+1) m 1 (p 1)(p 1)(p +( 1) − 4 p −2 ) N + N + N + N = − − − − 5 7 8 9 2 implying m 2 2 m m 1 (p 1)(m+1) 3(m 1) 2 p (p 1) (p p + 1)+( 1) − 4 p 2− (p 1) N = − − − − − − . 9 2

The determinations of N10,N11,N12 are similar to those of N7,N8,N9 and are omitted here. The proof is completed.

Theorem VI.7. Let m be an odd positive integer, p an odd prime and q = pm. The subfield code (p) m m 1 m 1 C is a [p + 1,2m, p (p 1) p −2 ] p-ary code, and has weight enumerator (x2,q) − − − m 1 m 2 pm 1(p 1) 1 +(p − 1)(p − + 1)z − − + − m 2 m 1 pm 1(p 1)+1 m 2 2 m 1 pm 1(p 1)+2 p − (p 1)(2p − + 2p 2)z − − + p − (p 1) (p − 1)z − − + − − − − (p 1)(m+1) m 1 m 1 m 2 − − m 1 (p 1)(m+1) (p 1)(p 1)(p +( 1) 4 p 2 ) m 1 − − − − − − − zp − (p 1) p 2 ( 1) 4 + 2 − − − m 1 (p 1)(m+1) m 2 2 m 1 pm 1(p 1) p −2 ( 1) − 4 +1 p − (p 1) (p − 1)z − − − − + − −

DRAFT August 11, 2020 29

(p 1)(m+1) 3(m 1) m 2 2 m m 1 − − 2 m 1 (p 1)(m+1) p (p 1) (p p + 1)+( 1) 4 p 2 (p 1) m 1 − − − − − − − − zp − (p 1) p 2 ( 1) 4 +2 + 2 − − − (p 1)(m+1)+4 m 1 m 1 m 2 − − m 1 (p 1)(m+1) (p 1)(p 1)(p +( 1) 4 p 2 ) m 1 − − − − − − − zp − (p 1)+p 2 ( 1) 4 + 2 − − m 1 (p 1)(m+1) m 2 2 m 1 pm 1(p 1)+p −2 ( 1) − 4 +1 p − (p 1) (p − 1)z − − − + − − (p 1)(m+1)+4 3(m 1) m 2 2 m m 1 − − 2 m 1 (p 1)(m+1) p (p 1) (p p + 1)+( 1) 4 p 2 (p 1) m 1 − − − − − − − − zp − (p 1)+p 2 ( 1) 4 +2. 2 − − Its dual is nearly optimal with respect to the sphere-packing bound, and has parameters [pm + 1, pm + 1 2m,3]. −

Proof. Let χ and χ′ be the canonical additive characters of GF(q) and GF(p), respectively.

Let η,η′ be the quadratic multiplicative characters of GF(q)∗ and GF(p)∗, respectively. Let (p) 2 (p) c( f ,q) = Trq/p(ax + bx) ,Trq/p(a),Trq/p(b) be any codeword in C . x GF(q)∗ ( f ,q) ∈ 2 Denote by N0(a,b,c) = ♯ x GF(q) : Trq/p(ax + bx) = 0 . By the orthogonality relation of { ∈ } additive characters,

1 yTr (ax2+bx) N (a,b) = ζ q/p 0 p ∑ ∑ p x GF(q) y GF(p) ∈ ∈ q 1 = + χ(yax2 + ybx) p p ∑ ∑ y GF(p) x GF(q) ∈ ∗ ∈ 1 = pm 1 + ∆(a,b), (11) − p 2 where ∆(a,b) := ∑y GF(p) ∑x GF(q) χ(yax +ybx). We discuss the value of ∆(a,b) in the follow- ∈ ∗ ∈ ing cases. 1) Let (a,b,c)=(0,0). Then ∆(a,b) = q(p 1). − 2) Let a = 0 and b = 0. Then 6 ∆(a,b) = ∑ ∑ χ(ybx) = 0. y GF(p) x GF(q) ∈ ∗ ∈ 3) Let a = 0. By Lemma II.2 we have 6 2 2 1 ∆(a,b) = ∑ χ( y b (4ya)− )η(ya)G(η,χ) y GF(p) − ∈ ∗ b2 = G(η,χ)η(a) η(y)χ y ∑ 4a y GF(p) − ∈ ∗   2 Tr b y − q/p 4a = G(η,χ)η(a) ∑ ζp   η(y) y GF(p) ∈ ∗

August 11, 2020 DRAFT 30

b2 = G(η,χ)η(a) χ Tr y η(y). ∑ ′ q/p 4a y GF(p) − ∈ ∗     Since m is odd, we have η(y) = η (y) for y GF(p) . Then by Lemma II.1 we have ′ ∈ ∗ 2 G(η,χ)η(a) η (y) if Tr ( b ) = 0 ∑y GF(p)∗ ′ q/p 4a ∈ 2  G η χ η a η Tr b ∆(a,b) = ( , ) ( ) ′ q/p( 4a ) 2  − × if Tr ( b ) = 0  b2  b2 q/p 4a 6  ∑ χ′ Trq/p( 4a )y η′ Trq/p( 4a )y y GF(p) − − ∈ ∗      2  b  0 if Trq/p( 4a ) = 0 = 2 2  G(η,χ)G(η ,χ )η(a)η Tr ( b if Tr ( b ) = 0  ′ ′ ′ − q/p 4a q/p 4a 6  b2   0 if Trq/p( 4a ) = 0, m+1 (p 1)(m+1) 2 2  2 − 4 b b = p ( 1) if Trq/p( 4a ) = 0, η(a)η′ Trq/p(4a ) = 1,  − 6 −  m+1 (p 1)(m+1)+4 b2 b2  p 2 ( 1) − 4 if Tr ( ) = 0, η(a)η  Tr ( ) = 1. − q/p 4a 6 ′ − q/p 4a −     Equation (11) and the preceding discussions yield

pm for (a,b)=(0,0), 2  pm 1 for a = 0, b = 0, or a = 0, Tr ( b ) = 0,  − q/p 4a N0(a,b) =  m 1 (p 1)(m+1) 6 2 6 2 (12)  m 1 − − b b  p − + p 2 ( 1) 4 if a = 0, Trq p( ) = 0, η(a)η′ Trq p( ) = 1,  − 6 / 4a 6 − / 4a m 1 m 1 (p 1)(m+1)+4 b2 b2 p + p −2 ( 1) − 4 if a = 0, Tr ( ) = 0, η(a)η  Tr ( ) = 1.  − − 6 q/p 4a 6 ′ − q/p 4a −   2   For any codeword c(a,b) = (Trq/p(ax + bx))x GF(q),Trq/p(a),Trq/p(b) , by Equation (12) ∈ we deduce the following:  1) If (a,b)=(0,0), then wt(c(a,b)) = 0. a = 0, a = 0, 6 2  Tr ( b ) = 0,  q/p 4a wt m 1 2) If b = 0, or  then (c(a,b)) = p − (p 1). Its frequency  6  Tr (a) = 0, −   q/p Trq/p(b) = 0, Trq/p(b) = 0, m 1 m 1  m 2 is p− 1 + N1 =(p − 1)(p − + 1) by Lemma VI.5. − − a = 0, a = 0, a = 0, 6 2 6 2  Tr ( b ) = 0,  Tr ( b ) = 0,  q/p 4a q/p 4a wt 3) If b = 0, or  or  then (c(a,b)) =  6  Tr (a) = 0,  Tr (a) = 0,   q/p  q/p Trq/p(b) = 0, 6 6 Trq/p(b) = 0, Trq/p(b) = 0, m 1  m 16  m 2 m 1 p −(p 1) + 1. Its frequency is p − (p 1) + N2 + N3 = p − (p 1)(2p − + 2p 2) −  −  − − by Lemma VI.5.

DRAFT August 11, 2020 31

a = 0, 6 2  Tr ( b ) = 0, q/p 4a wt m 1 m 2 4) If  then (c(a,b)) = p − (p 1)+2. Its frequency is N4 = p − (p  Tr (a) = 0, − −  q/p 6 Trq/p(b) = 0, 2 m 1 6 1) (p − 1) by Lemma VI.5.  − a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2 m 1 (p 1)(m+1)  b wt m 1 −2 − 4 5) If  η(a)η′ Trq/p(4a ) = 1, then (c(a,b)) = p − (p 1) p ( 1) . Its  − − − −    Trq/p(a) = 0,  Tr (b) = 0,  q/p  (p 1)(m+1) m 1  m 1 m 2 − −  (p 1)(p − 1)(p − +( 1) 4 p 2 ) frequency is N5 = − − 2 − by Lemma VI.6. a = 0, a = 0, 6 2 6 2  Tr ( b ) = 0,  Tr ( b ) = 0,  q/p 4a 6  q/p 4a 6  2  2 6) If  η(a)η Tr ( b ) = 1, or  η(a)η Tr ( b ) = 1, then wt(c(a,b)) =  ′ − q/p 4a  ′ − q/p 4a    Tr (a) = 0,   Tr (a) = 0,  q/p q/p 6  Tr (b) = 0,  Tr (b) = 0,  q/p 6  q/p  m 1 (p 1)(m+1)  m 1 −  m 2 2 m 1 p (p 1) p −2 ( 1) 4 + 1. Its frequency is N7 + N8 = p (p 1) (p 1) − − − −  − − − − by Lemma VI.6. a = 0, 6 2  Tr ( b ) = 0,  q/p 4a  6 2 m 1 (p 1)(m+1)  b m 1 − − 7) If  η(a)η Tr ( ) = 1, then wt(c(a,b)) = p − (p 1) p 2 ( 1) 4 +2.  ′ − q/p 4a − − −   Tr (a) = 0,  q/p 6  Tr (b) = 0,  q/p  6 (p 1)(m+1) 3(m 1)  m 2 2 m m 1 − − 2  p − (p 1) (p p − +1)+( 1) 4 p 2 (p 1) Its frequency is N9 = − − 2− − by Lemma VI.6. a = 0, 6 2  Tr ( b ) = 0,  q/p 4a 6  2 m 1 (p 1)(m+1)  b wt m 1 −2 − 4 8) If  η(a)η′ Trq/p(4a ) = 1, then (c(a,b)) = p − (p 1) + p ( 1) .  − − − −    Trq/p(a) = 0,  Tr (b) = 0,  q/p  (p 1)(m+1)+4 m 1  m 1 m 2 − −  (p 1)(p − 1)(p − +( 1) 4 p 2 ) Its frequency is N6 = − − 2− by Lemma VI.6.

August 11, 2020 DRAFT 32

a = 0, a = 0, 6 2 6 2  Tr ( b ) = 0,  Tr ( b ) = 0,  q/p 4a 6  q/p 4a 6  2  2 9) If  η(a)η Tr ( b ) = 1, or  η(a)η Tr ( b ) = 1, then wt(c(a,b)) =  ′ − q/p 4a −  ′ − q/p 4a −    Tr (a) = 0,   Tr (a) = 0,  q/p q/p 6  Tr (b) = 0,  Tr (b) = 0,  q/p  q/p  6 m 1 (p 1)(m+1)  m 1 −  m 2 2 m 1 p (p 1)+ p −2 ( 1) 4 +1. Its frequency is N10 +N11 = p (p 1) (p 1) − − −  − − − − by Lemma VI.6. a = 0, 6 2  Tr ( b ) = 0,  q/p 4a  6 2 m 1 (p 1)(m+1)  b m 1 − − 10) If  η(a)η Tr ( ) = 1, then wt(c(a,b)) = p − (p 1)+ p 2 ( 1) 4 +  ′ − q/p 4a − − −   Tr (a) = 0,  q/p 6  Tr (b) = 0,  q/p  6 (p 1)(m+1)+4 3(m 1)  m 2 2 m m 1 − − 2  p − (p 1) (p p − +1)+( 1) 4 p 2 (p 1) 2. Its frequency is N12 = − − −2 − . C (p) Then the weight enumerator of ( f ,q) follows. (p) p (p) C ( ) C ⊥ The dimension of ( f ,q) is 2m as A0 = 1. By Theorem I.2, the minimal distance d ⊥ of ( f ,q) satisfies d(p) 3 as the dual of C has minimal distance 3. From the weight distribution of ⊥ ≥ ( f ,q) (p) (p) C ⊥ ( f ,q) and the first four Pless power moments in [10, Page 131], we can prove that A3 > 0, (p) (p) ⊥ C ⊥ where A3 denotes the frequency of the codewords with weight 3 in ( f ,q) . Then the parameters (p) p of C ⊥ follow. By the sphere-packing bound, one can deduce that d( ) 4. Hence the dual ( f ,q) ⊥ ≤ C (p) of ( f ,q) is nearly optimal with respect to the sphere-packing bound.

C (p) m If m is even, we can similarly prove that the subfield code ( f ,q) has parameters [p + m 1 m 2 1,2m,(p 1)(p p −2 )]. We omit the proof here. − − −

Example 3. Let f (x) = x2 with q = pm and m odd. C (p) 1) Let p = 3 and m = 3. Then the set ( f ,q) in Theorem VI.7 is a [28,6,15] ternary code which has the best known parameters, and its dual a [28,22,3] code, while the corresponding best known parameters are [28,22,4] according to the Code Tables at http://www.codetables.de/. C (p) 2) Let p = 5 and m = 3. Then the set ( f ,q) in Theorem VI.7 is a [126,6,95] code whose dual is a [126,120,3] code, while the corresponding best known parameters are [126,6,95] and [126,120,4] according to the Code Tables at http://www.codetables.de/.

DRAFT August 11, 2020 33

C (p) 3 C. The subfield code ( f ,q) for f (x) = x and p = 2 3 Let f (x) = x and p = 2. Then gcd(q 1,3 1) = 1 and C 3 is a [q+1,2,q] MDS code by − − (x ,q) Lemma VI.1. By Theorem IV.2, the binary subfield code of C(x3,q) is given by

(2) (2) 3 a GF(q) C c 3 Tr ax bx Tr a Tr b : ∈ (x3,q) = (x ,q) = q/p( + ) x GF(q) , q/p( ), q/p( ) b GF(q) . ∈ ∗ ∈ n    o In the following, we only investigate the parameters of C (2) for odd m. For even m, the (x3,q) parameters of C (2) can be discussed in a similar way. (x3,q) Let χ be the canonical additive character of GF(q). Define a class of exponential sums as

S(a,b) = ∑ χ(ax3 + bx), a,b GF(q). x GF(q) ∈ ∈ Since m is odd, gcd(3,q 1) = 1. If a = 0, then there exists exactly one element c GF(q) − 6 ∈ ∗ such that a = c3. Hence

3 3 3 1 S(a,b) = ∑ χ(c x + bx) = ∑ χ(x + bc− x), b GF(q),c GF(q∗). x GF(q) x GF(q) ∈ ∈ ∈ ∈ As a direct consequence of [2, Theorem 2], the following lemma can be derived.

Lemma VI.8. Let q = 2m with m odd and a,b GF(q) . Then ∈ ∗ 1 0 if Trq/2(bc− ) = 0, m2 1 m+1  − 1 4 3 S(a,b) = ( 1) 8 2 2 if bc− = t +t + 1 and Trq/2(t +t) = 0,  − 2  m 1 m+1 1 4 3  ( 1) 8− 2 2 if bc = t +t + 1 and Tr (t +t) = 1, − − − q/2    2 3 m 1 m+1 where a = c . Specially, S(1,1)=( 1) 8− 2 2 . − 2 Theorem VI.9. Let p = 2 and m 5 be odd. Then the binary subfield code C ( ) has parameters ≥ (x3,q) m m 1 (m 1)/2 m2 1 m (2) m 1 (m 1)/2 m2 1 [2 + 1,2m,2 2 ] if − is odd, and [2 + 1,2m,d 2 2 ] if − is − − − 8 ≥ − − − 8 even.

Proof. Let χ be the canonical additive character of GF(q). Denote N0(a,b) = ♯ x GF(q) : { ∈ Tr (ax3 + bx) = 0 . By the orthogonality relation of additive characters, we have q/2 } 1 3 N (a,b) = ( 1)zTrq/2(ax +bx) 0 2 ∑ ∑ z GF(2) x GF(q) − ∈ ∈ 1 = 2m 1 + χ(ax3 + bx) − 2 ∑ x GF(q) ∈

August 11, 2020 DRAFT 34

1 = 2m 1 + S(a,b). (13) − 2

We discuss the value of S(a,b) in the cases below.

1) Let a = b = 0. Then S(a,b) = q.

2) Let a = 0,b = 0. Then S(0,b) = ∑x GF(q) χ(bx) = 0. 6 ∈ 3 3) Let a = 0,b = 0. Then S(a,0) = ∑x GF(q) χ(ax ). By Lemma II.4 we have 6 ∈

2 3 3 S(a,0) = ∑ χ(ax ) ∑ χ(ax1) x GF(q) x1 GF(q) ∈ ∈ = ∑ χ(ax3) ∑ χ(a(x + y)3) x GF(q) y GF(q) ∈ ∈ = ∑ χ a(x2 + y2)(x + y) + ax3 x,y GF(q) ∈  = ∑ χ(ay3) ∑ χ(ayx2 + ay2x) y GF(q) x GF(q) ∈ ∈ = q + q ∑ χ(ay3) y GF(q) ∈ ∗ ay(1+ay3)=0 = q + q ∑ χ(1) = q q = 0, ay3=1 −

where we used the variable transformation x1 = x+y in the second equality. Then S(a,0) = 0. 4) Let a,b = 0. The value of S(a,b) is given in Lemma VI.8. 6 By Equation (13) and the discussions above, we have

2m if a = b = 0, 1  m 1 if Trq/2(bc− ) = 0,a = 0, 2 − 6 N (a,b) =  or a = 0,b = 0, (14) 0  2  m 1 m 1 m 1 1 4 6 3  2 +( 1) 8− 2 −2 if bc = t +t + 1 and Tr (t +t) = 0,  − − − q/2 m2 1 m 1 m 1 − − 1 4 3  2 − ( 1) 8 2 2 if bc− = t +t + 1 and Trq/2(t +t) = 1,  − −   where a = c3 if a = 0. 6 (2) 3 (2) For any codeword c 3 = (Trq/2(ax + bx))x GF(q) ,Trq/2(a),Trq/2(b) C 3 , by Equation (x ,q) ∈ ∗ ∈ (x ,q) (14) we deduce that 

wt(c(a,b))

DRAFT August 11, 2020 35

0 if a = b = 0,  2m 1 if a = 0, b = 0, Tr (b) = 0,  − 6 q/2  m 1  2 − + 1 if a = 0, b = 0, Trq/2(b) = 0,  6 6  m 1 1  2 − if Trq/2(bc− ) = 0, a = 0, Trq/2(a) = Trq/2(b) = 0,  6  m 1 1  2 − + 1 if Trq/2(bc− ) = 0, a = 0, Trq/2(a) = 1, Trq/2(b) = 0,  6  m 1 1  2 − + 1 if Trq/2(bc− ) = 0, a = 0, Trq/2(a) = 0, Trq/2(b) = 1,  6  m 1 1  2 − + 2 if Trq/2(bc− ) = 0, a = 0, Trq/2(a) = 1, Trq/2(b) = 1,  1 4 6 3  m2 1 m 1 if bc t t 1 Tr t t 0  m 1 − − − = + + , q/2( + ) = , =  2 − +( 1) 8 2 2  − and Trq/2(a) = Trq/2(b) = 0,  1 4 3  m2 1 m 1 if bc t t 1 Tr t t 1 m 1 − − − = + + , q/2( + ) = , 2 − ( 1) 8 2 2  − − and Trq/2(a) = Trq/2(b) = 0,  1 4 3  m2 1 m 1 if bc = t +t + 1,Tr (t +t) = 0 and exactly  m 1 − − − q/2  2 − +( 1) 8 2 2 + 1  − one of Trq/2(a),Trq/2(b) equals 0,  2 1 4 3  m 1 m 1 m 1 if bc− = t +t + 1,Trq/2(t +t) = 1 and exactly  2 ( 1) 8− 2 −2 + 1  − one of Tr (a),Tr (b) equals 0,  − − q/2 q/2  2 1 4 3  m 1 m 1 if bc− = t +t + 1,Trq 2(t +t) = 0,  m 1 8− −2 /  2 − +( 1) 2 + 2  − and Trq/2(a) = Trq/2(b) = 1,  1 4 3  m2 1 m 1 if bc = t +t + 1,Tr (t +t) = 1,  m 1 − − − q/2  2 − ( 1) 8 2 2 + 2  − − and Trq/2(a) = Trq/2(b) = 1,    where a = c3 if a = 0. The dimension is 2m as wt(c(a,b)) = 0 if and only if a = b = 0. The 6 minimal distance

2 2 (2) m 1 m 1 m 1 m 1 m 1 m 1 m 1 m 1 d min 2 − +( 1) 8− 2 −2 ,2 − ( 1) 8− 2 −2 = 2 − 2 −2 . ≥ − − − −   Observe that 1 4 3 bc− = t +t + 1,Trq/2(t +t) = 0, A m2 1 m 1 = ♯ (a,b) GF(q)∗ GF(q)∗ : . 2m 1+( 1) 8− 2 −2 ∈ × and Trq/2(a) = Trq/2(b) = 0 − −   3 3 If a = b , then b = c and t = 0,1 implying Trq/2(t +t) = 0. Hence

3 A m2 1 m 1 ♯ b GF(q)∗ : Trq/2(b ) = Trq/2(b) = 0 2m 1+( 1) 8− 2 −2 ≥ { ∈ } − − 1 3 = ( 1)yTrq/2(b ) ( 1)zTrq/2(b) 4 ∑ ∑ ∑ b GF(q) y GF(2) − z GF(2) − ∈ ∗ ∈ ∈ q 1 1 1 1 = − + χ(b3) + χ(b) + χ(b3 + b) 4 4 ∑ 4 ∑ 4 ∑ b GF(q) b GF(q) b GF(q) ∈ ∗ ∈ ∗ ∈ ∗ q 1 1 1 1 = − + (S(1,0) 1) + (S(1,1) 1) 4 4 − − 4 4 − 2 m 2 m 1 m 3 = 2 − 1 +( 1) 8− 2 −2 − −

August 11, 2020 DRAFT 36

> 0

by Lemma VI.8, where m 5. Then the desired conclusion follows. ≥ 2 In Theorem VI.9, we were unable to obtain the minimal distance of C (2) if m 1 is even. (x3,q) 8− The weight distribution of C (2) is even more difficult to compute. Our Magma experiments (x3,q) lead to the following conjecture.

Conjecture VI.10. Let m 5 be odd. Then the set C (2) in Theorem VI.9 is a nine-weight code ≥ (x3,q) with parameters [2m + 1,2m,2m 1 2(m 1)/2]. Its dual has parameters [2m + 1,2m + 1 2m,3]. − − − − Example 4. Let f (x) = x3 with q = 2m and m odd. 1) Let m 3. Then the set C (2) in Theorem VI.9 is a 9 6 2 binary code which has the = (x3,q) [ , , ] best known parameters according to the Code Tables at http://www.codetables.de/. 2) Let m 5. Then the set C (2) in Theorem VI.9 is a 33 10 12 binary code which has the = (x3,q) [ , , ] best known parameters according to the Code Tables at http://www.codetables.de/. 3) Let m 7. Then the set C (2) in Theorem VI.9 is a 129 14 56 binary code with the best = (x3,q) [ , , ] parameters known according to the Code Tables at http://www.codetables.de/.

VII. FAMILIES OF [2m + 1,2,2m] MDS CODES FROM OVAL POLYNOMIALS AND THEIR

SUBFIELD CODES

Let p = 2 and q = 2m throughout this subsection. We first define oval polynomials f (x) on C C (2) GF(q), and then investigate their codes ( f ,q) and ( f ,q). An oval polynomial f over GF(q) is a polynomial such that 1) f is a permutation polynomial of GF(q) with deg( f ) < q and f (0) = 0, f (1) = 1; and q 2 2) for each a GF(q), ga(x) :=( f (x + a) + f (a))x is also a permutation polynomial of ∈ − GF(q). The following is a list of known infinite families of oval polynomials in the literature.

Theorem VII.1. Let m 2 be an integer. The following are oval polynomials of GF(q), where ≥ q = 2m.

h The translation polynomial f (x) = x2 , where gcd(h,m) = 1. • The Segre polynomial f (x) = x6, where m is odd. • (m+1)/2 The Glynn oval polynomial f (x) = x3 2 +4, where m is odd. • ×

DRAFT August 11, 2020 37

(m+1)/2 (m+1)/4 The Glynn oval polynomial f (x) = x2 +2 for m 3 (mod 4). • (m+1)/2 (3m+1)/4 ≡ The Glynn oval polynomial f (x) = x2 +2 for m 1 (mod 4). • e e e≡ The Cherowitzo oval polynomial f (x) = x2 + x2 +2 + x3 2 +4, where e =(m + 1)/2 and m • × is odd. m 1 m 1 2 − +2 m 1 3 2 − 2 The Payne oval polynomial f (x) = x 3 + x2 − + x × 3 − , where m is odd. • The Subiaco polynomial •

2 4 2 2 3 2 4 2 2 2m 2 2m 1 fa(x)=((a (x + x) + a (1 + a + a )(x + x ))(x + a x + 1) − + x − ,

where Tr (1/a) = 1 and d GF(4) if m 2 mod 4. q/2 6∈ ≡ The Adelaide oval polynomial • m q m T (β )(x + 1) T ((βx + β ) ) m 1 f (x) = + + x2 − , 2m 1 m 1 T (β) T (β)(x + T (β)x − + 1) − where m 4 is even, β GF(q2) 1 with βq+1 = 1, m (q 1)/3 (mod q + 1), and ≥ ∈ \{ } ≡ ± − T (x) = x + xq.

The next theorem gives a characterisation of oval polynomials, where the conditions are called the slope condition, and will be needed later.

Theorem VII.2. f is an oval polynomial over GF(q) if and only if

1) f is a permutation of GF(q); and 2) f (x) + f (y) f (x) + f (z) = x + y 6 x + z

for all pairwise-distinct x,y,z in GF(q).

All oval polynomials on GF(q) can be used to construct [q + 1,2,q] MDS code over GF(q) in the framework of this paper. Specifically, we have the following result.

Theorem VII.3. Let f be an oval polynomial over GF(q). Then C( f ,q) is a [q + 1,2,q] MDS code over GF(q).

Proof. By definition, f (a) = 0 for all a GF(q) . So Condition 1) in Theorem IV.1 is satisfied. 6 ∈ ∗ Condition 2) in Theorem IV.1 follows from Theorem VII.2. The desired conclusion then follows from Theorem IV.1.

August 11, 2020 DRAFT 38

C (2) The subfield code ( f ,q) differs from oval polynomial to oval polynomial. We are able to settle C (2) the parameters of subfield code ( f ,q) for a few oval polynomials. C (2) By Equation (1) and Theorem I.1, the trace representation of ( f ,q) is given as

C (2) c(2) Tr af x bx Tr a Tr b : a b GF q (15) ( f ,q) = ( f ,q) = q/2( ( ) + ) x GF(q) , q/2( ), q/2( ) , ( ) . ∈ ∗ ∈ n    o

C (2) 2 A. The subfield code ( f ,q) for f (x) = x

In this subsection, let f (x) = x2 which is an oval polynomial over GF(q). Then

C (2) = c(2) = Tr (ax2 + bx) ,Tr (a),Tr (b) : a,b GF(q) (x2,q) (x2,q) q/2 x GF(q) q/2 q/2 ∈ ∗ ∈ n    o by Equation (15).

2 Theorem VII.4. Let m 2. Then C ( ) has parameters [2m +1,m+1,2] and weight enumerator ≥ (x2,q)

2 m 1 2m 1 m 2m 1+1 m 1 2m 1+2 1 + z +(2 − 1)z − + 2 z − +(2 − 1)z − . − −

(C (2) ) has parameters [2m +1,2m m,3] and is dimension-optimal with respect to the sphere- (x2,q) ⊥ − packing bound.

Proof. Let χ be the canonical additive character of GF(q). Denote

2 N0(a,b) = ♯ x GF(q) : Tr (ax + bx) = 0 . { ∈ q/2 }

By the orthogonality relation of additive characters and Lemma II.3, we have

zTr (ax2+bx) 2N0(a,b) = ∑ ∑ ( 1) q/2 z GF(2) x GF(q) − ∈ ∈ = q + ∑ χ(ax2 + bx) x GF(q) ∈ 2q if a = b2, =  q otherwise.  2  Note that Trq/2(b ) = Trq/2(b). For any codeword

(2) 2 (2) c 2 = (Trq/2(ax + bx))x GF(q),Trq/2(a),Trq/2(b) C 2 , (x ,q) ∈ ∈ (x ,q)  DRAFT August 11, 2020 39

Then we have 2 q N0(a,b) for a = b , Tr (a) = Tr (b) = 0 − q/2 q/2 2  q N0(a,b) + 2 for a = b , Tr (a) = Tr (b) = 0  − q/2 q/2 6  2 wt  q N0(a,b) for a = b , Trq (a) = Trq (b) = 0 (c(a,b)) =  − 6 /2 /2  for a = b2, Tr (a) = 0, Tr (b) = 0,  q/2 q/2 q N0(a,b) + 1 6 2 6 − or a = b , Trq/2(a) = 0, Trq/2(b) = 0  6 6  q N (a,b) + 2 for a = b2, Tr (a) = 0, Tr (b) = 0  0 q/2 q/2  − 6 6 6  2  0 for a = b , Trq/2(a) = Trq/2(b) = 0,  2 for a = b2, Tr (a) = Tr (b) = 0,  q/2 q/2 6  m 1 2  2 − for a = b , Tr (a) = Tr (b) = 0, =  6 q/2 q/2  for a = b2, Tr (a) = 0, Tr (b) = 0,  m 1 q/2 q/2 2 − + 1 6 2 6 or a = b , Trq/2(a) = 0, Trq/2(b) = 0,  6 6  2m 1 + 2 for a = b2, Tr (a) = 0, Tr (b) = 0.  − q/2 q/2  6 6 6   Observe that the Hamming weight 0 occurs 2m 1 times if (a,b) runs through GF(q) GF(q). − × Thus every codeword in C (2) repeats 2m 1 times. Based on the discussions above, we easily (x2,q) − deduce the weight enumerator of C (2) . (x2,q) (p) (2) (2) By Theorem I.2, the minimal distance d of C ⊥ satisfies d 3 as the dual of C 2 ⊥ (x2,q) ⊥ ≥ (x ,q) has minimal distance 3. From the weight distribution of C (2) and the first four Pless power (x2,q) (2) (2) moments in [10, Page 131], we can prove that A3 ⊥ > 0, where A3 ⊥ denotes the number of (2) (2) the codewords with weight 3 in C ⊥ . Then the parameters of C ⊥ follow. It is easily verified (x2,q) (x2,q) (2) that C ⊥ is dimension-optimal with respect to the sphere-packing bound. (x2,q) Although the code C (2) in Theorem VII.4 has bad parameters, its dual code C (2) is (x2,q) ( (x2,q))⊥ dimension-optimal. Hence, it is still valuable to study the subfield code C (2) . (x2,q)

Example 5. Let m 2. Then the set C (2) in Theorem VII.4 is a 5 3 2 binary linear code and = (x2,q) [ , , ] its dual has parameters 5 2 3 . Hence C (2) is a near MDS code in this case. Both of C (2) and [ , , ] (x2,q) (x2,q) its dual has the best known parameters according to the Code Tables at http://www.codetables.de.

i j B. The subfield code C (2) for f (x) = x2 +2 (i > j 0) ( f ,q) ≥ i j Let f (x) = x2 +2 (i > j 0). By Theorem VII.1, f (x) is an oval polynomial in the following ≥ cases: 1) (i, j)=(2,1) and m is odd;

August 11, 2020 DRAFT 40

2) (i, j)=((m + 1)/2,(m + 1)/4) and m 3 (mod 4); ≡ 3) (i, j)=((3m + 1)/4,(m + 1)/2) and m 1 (mod 4). ≡ C (2) The trace representation of ( f ,q) is given as

C (2) (2) 2i+2 j ( f ,q) = c( f ,q) = Trq/2(ax + bx) ,Trq/2(a),Trq/2(b) : a,b GF(q) . x GF(q)∗ ∈    ∈   2 By [13, Lemma 5], it is easy to deduce that C ( ) is a [2m + 1,2m,d(2) 2m 1 2(m 1)/2] code ( f ,q) ≥ − − − if f (x) is one of the above three oval polynomials. However, we were unable to determine its minimal distance and weight distribution. We have the following conjectures according to our Magma experiments.

2 Conjecture VII.5. Let m 5 be odd. Then C ( ) has parameters [2m + 1,2m,2m 1 2(m 1)/2] ≥ (x6,q) − − − and nine nonzero weights. (C (2) ) has parameters [2m + 1,2m 2m + 1,3]. (x6,q) ⊥ − (m+1)/2 (m+1)/4 2 Conjecture VII.6. Let m 3 (mod 4) with m 5 and f (x) = x2 +2 . Then C ( ) has ≡ ≥ ( f ,q) parameters [2m + 1,2m,2m 1 2(m 1)/2] and nine nonzero weights. (C (2) ) has parameters − − − ( f ,q) ⊥ [2m + 1,2m 2m + 1,3]. − (m+1)/2 (3m+1)/4 2 Conjecture VII.7. Let m 1 (mod 4) with m 5 and f (x) = x2 +2 . Then C ( ) has ≡ ≥ ( f ,q) 2 parameters [2m + 1,2m,2m 1 2(m 1)/2] and nine nonzero weights. (C ( ) ) has parameters − − − ( f ,q) ⊥ [2m + 1,2m 2m + 1,3]. − By Theorem VII.1, there exist oval polynomials f which are not monomials. It will be very C (2) interesting if the parameters of ( f ,q) can be determined with these polynomials.

VIII. SUMMARY AND CONCLUDING REMARKS

In this paper, we first presented a general construction of [q + 1,2,q] MDS codes C( f ,q) over GF(q) from functions f under certain conditions. Then we studied the p-ary subfield codes of some of the [q + 1,2,q] MDS codes over GF(q) by selecting some special f . These subfield codes and their duals are summarised as follows:

1) A family of three-weight nearly optimal [pm +1,m+1,(p 1)pm 1] codes with respect to − − the Griesmer bound whose duals have parameters [pm + 1, pm m,3] and are dimension- − optimal with respect to the sphere-packing bound for m 2 and any prime p (see Theorem ≥ V.1).

DRAFT August 11, 2020 41

2) A family of eight-weight [p2l + 1,3l, pl 1(pl+1 pl 1)] codes whose duals have param- − − − eters [p2l + 1, p2l + 1 3l,3] and are nearly optimal with respect to the sphere-packing − bound for l 2 and any prime p (see Theorem VI.4). ≥ m m 1 m 1 3) A family of nine-weight [p + 1,2m, p (p 1) p −2 ] codes whose duals have param- − − − eters [pm + 1, pm + 1 2m,3] and are nearly optimal with respect to the sphere-packing − bound for odd m 3 and odd prime p (see Theorem VI.7). ≥ m m 1 (m 1)/2 m2 1 4) A family of binary [2 + 1,2m,2 2 ] code for odd − and odd m 3, and − − − 8 ≥ m (2) m 1 (m 1)/2 m2 1 [2 +1,2m,d 2 2 ] code for even − and odd m 3 (see Theorem VI.9). ≥ − − − 8 ≥ 5) A family of four-weight binary [2m +1,m+1,2] codes whose duals have parameters [2m + 1,2m m,3] and are dimension-optimal with respect to the sphere-packing bound for m 2 − ≥ (see Theorem VII.4).

Two families of these codes over GF(p) are dimension-optimal and some families are nearly optimal. Examples in this paper showed that these codes over GF(p) are optimal in some cases. As pointed out earlier, it is even very hard to determine the parameters of the subfield code of the Simplex code which is a one-weight code over GF(pm) and very simple. It is in general very difficult to determine the parameters of subfield codes of linear codes. In this paper, we presented several conjectures about the parameters of some subfield codes. The reader is cordially invited to settle them. Finally, we point out that the subfield codes presented in this paper have various parameters and weight distributions, though all of them are constructed from [q + 1,2,q] MDS codes over GF(q). Although all [q+1,2,q] MDS codes over GF(q) are monomially equivalent and may not be interesting in many senses, they are very attractive for constructing very good linear codes over small fields. A contribution of this paper is the proof of the fact that [q+1,2,q] MDS codes over GF(q) are very useful and interesting in coding theory.

REFERENCES

[1] L. D. Baumert, R. J. McEliece, “Weights of irreducible cyclic codes,” Information and Control, vol. 20, 158–175, 1972. [2] L. Carlitz, “Explicit evaluation of certain exponential sums,” Math. Scand., vol. 44, pp. 5–16, 1979. [3] P. Delsarte, “On subfield subcodes of modified Reed-Solomon codes,” IEEE Trans. Inf. Theory, vol. 21, pp. 575–576, 1975. [4] C. Ding, Designs from Linear Codes, World Scientific, Singapore, 2019. [5] C. Ding, Z. Heng, “The subfield codes of ovoid codes,” IEEE Trans. Inf. Theory, vol. 65, no. 8, pp. 4715–4729, August 2019.

August 11, 2020 DRAFT 42

[6] C. Ding, J. Yang, “Hamming weights in irreducible cyclic codes,” Discrete Mathematics, vol. 313, 434–446, 2013. [7] Z. Heng, C. Ding, “The subfield codes of hyperoval and conic codes,” Finite Fields and Their Applications, vol. 56, pp. 308–331, 2019. [8] Z. Heng, C. Ding, W. Wang, “Optimal binary linear codes from maximal arcs,” IEEE Trans. Inf. Theory, DOI: 10.1109/TIT.2020.2970405. [9] Z. Heng, Q. Wang, C. Ding, “Two families of optimal linear codes and their subfield codes,” IEEE Trans. Inf. Theory, DOI: 10.1109/TIT.2020.3006846. [10] W. C. Huffman and V. Pless, Fundamentals of Error-Correcting Codes. Cambridge, U.K.: Cambridge Univ. Press (2003). [11] R. Lidl and H. Niederreiter, Finite Fields, Cambridge University Press, Cambridge, 1997 [12] F. J. MacWilliams, N. J. A. Sloane, The Theory of Error-Correcting Codes, North-Holland, Amsterdam, 1977. [13] X. Wang and D. Zheng, “The subfield codes of several classes of linear codes,” Cryptography and Communications, https://doi.org/10.1007/s12095-020-00432-4.

DRAFT August 11, 2020