New Non-Equivalent (Self-Dual) MDS Codes From Elliptic Curves

It is well known that MDS codes can be constructed as algebraic geometric (AG) codes from elliptic curves. It is always interesting to construct new non-equivalent MDS codes and self-dual MDS codes. In recent years several constructions of new self-dual MDS codes from the generalized twisted Reed-Solomon codes were proposed. In this paper we construct new non-equivalent MDS and almost MDS codes from elliptic curve codes. 1) We show that there are many MDS AG codes from elliptic curves defined over ${\bf F}_q$ for any given small consecutive lengths $n$, which are not equivalent to Reed-Solomon codes and twisted Reed-Solomon codes. 2) New self-dual MDS AG codes over ${\bf F}_{{2^s}}$ from elliptic curves are constructed, which are not equivalent to Reed-Solomon codes and twisted Reed-Solomon codes. 3) Twisted versions of some elliptic curve codes are introduced such that new non-equivalent almost MDS codes are constructed. Moreover there are some non-equivalent MDS elliptic curve codes with the same length and the same dimension. The application to MDS entanglement-assisted quantum codes is given.


Introduction
The Hamming weight wt(a) of a vector a ∈ F n q is the number of non-zero coordinate positions. The Hamming distance d(a, b) between two vectors a and b is defined to be the Hamming weight of wt(a−b). For a code C ⊂ F n q , its minimum Hamming distance is the minimum of Hamming distances d(a, b) between any two different codewords a and b in C. For a linear code C ⊂ F n q , its minimum Hamming distance is its minimum Hamming weight. For a linear [n, k, d] q code, the Singleton bound asserts d ≤ n − k + 1. When the equality holds, this code is an MDS code. We refer to [29] for the theory of Hamming error-correcting codes.
The main conjecture of linear MDS codes proposed in [45] claims that the length of a linear MDS code over F q is at most q + 1, except some exceptional cases. In [3] the main conjecture was proved for linear MDS codes over prime fields. Some classification results about general MDS codes over small fields were given in [35]. An (n, M = q n−d , d) q code is called almost MDS. A linear almost MDS code C satisfying that the dual C ⊥ is also almost MDS is called near MDS code. It is well-known that AG codes from elliptic curves are near MDS codes. The main conjecture of near MDS codes was proposed in [36]. Some upper bounds on the lengths of general MDS and almost MDS codes were given in our paper [17]. For counting the number of MDS linear codes, we refer to [24,34].
We say that two codes C 1 and C 2 in F n q are equivalent if C 2 can be obtained from C 1 by a permutation of coordinates and the multiplication of a Hamming weight n vector v = (v 1 , v 2 , . . . , v n ) ∈ F n q on coordinates, where v i = 0 for i = 1, . . . , n. That is C 2 = {c = (c 1 , . . . c n ) : (c 1 , . . . , c n ) = (v 1 x 1 , . . . , v n x n ), x ∈ P erm(C 1 )}, where P erm(C 1 ) is the code obtained from C 1 by a coordinate permutation. Equivalent codes have the same code length, dimension and the minimum Hamming distance. It is always interesting to construct non-equivalent MDS codes, we refer to [7,9,10,38,39,43].
The (Euclid) dual of a linear code C ⊂ F n q is C ⊥ = {c = (c 1 , . . . , c n ) : Σ n i=1 c i x i = 0, ∀x = (x 1 , . . . , x n ) ∈ C}. A linear code is called self dual if C = C ⊥ . In general the linear code C C ⊥ is called the hull of C. The Hermitian dual of a linear code C ⊂ F n q 2 is It is clear . . , c q n ) : (c 1 . . . , c n ) ∈ C}.
The minimum distance of the Euclid dual is called the dual distance and is denoted by d ⊥ . The minimum distance of the Hermitian dual is the same as d ⊥ . A linear code C ⊂ F n q 2 is called Hermitian self-dual if C = C ⊥ h . The intersection C C ⊥ h is called the Hermitian hull of this code C. We refer to [18,19] and [29] Chapter 9 for earlier results about self-dual and Hermitian self-dual codes over small fields.
Quantum error correction code (QECC) is fundamentally important for quantum information processing and quantum computation. For constructions of quantum error correction codes we refer to [13,47,49] and [4-6, 15, 27, 31, 33]. Entanglement-assisted quantum error correction (EAQEC) codes were proposed in [12]. Comparing to a QECC an EAQEC code has one more parameter c measuring the consumption of c pre-shared copies of maximally entangled states. From the basic results in [12] [12,41]. An EAQEC code attaining this quantum Singleton bound and satisfying d ≤ n+2 2 is called an MDS EAQEC code. The construction of MDS QAECC code with large ranges of four parameters has been addressed in [16,23,37], or see the references in [16].
The key point to construct EAQEC codes is to determine the dimensions of Hermitian hulls of linear codes in F n q 2 . In our previous paper [16] MDS entanglement-assisted quantum codes with arbitrary lengths and arbitrary distances were constructed from generalized Reed-Solomon codes.
The construction of new self-dual (and Hermitian self-dual) MDS codes or near MDS codes has been a long active topic in coding theory, see [8,22,25,26,28,30,32,40,53]. On the other hand the construction of Hermitian self-orthogonal (or dual-containing) MDS codes had been active for the purpose to construct MDS quantum codes, see [4-6, 27, 31, 33] and references therein. Since the introduction of twisted Reed-Solomon codes in [9], also see [10], the construction of non-equivalent self-dual MDS codes from twisted Reed-Solomon codes has been given in [28,50]. These codes are not equivalent to the Reed-Solomon codes and can be thought as new self-dual MDS codes. From the view of coding theory, it is always interesting to construct more non-equivalent MDS codes and non-equivalent self-dual or Hermitian self-orthogonal MDS codes.
It is well-known that AG codes from elliptic curves are best examples of linear codes with the Singleton defect n + 1 − d − k = 1. However it is also well-known that MDS codes can be obtained from elliptic curve codes if the evaluation points are carefully chosen. This is similar to many works on Reed-Solomon codes in which evaluation points have to be determined in a complicated pattern. The main conjecture for MDS codes from curves of genus 1 (elliptic) and 2 was proved in old papers [38,39], also see [52]. The main conjecture for MDS AG codes arising from hyper-elliptic curves was proved independently in [14] and [11]. The self-dual near MDS codes from elliptic curves were constructed in [32] and some non-extendable near MDS codes from elliptic curves were constructed in a recent paper [1]. We also refer to [21] for the earlier work on near MDS codes. No MDS codes from elliptic curves has been constructed explicitly. In [7] some MDS [n, k, n − k + 1] q codes with the covering radius n − k − 1 were constructed as extended codes of MDS codes from elliptic curves. Notice that it is well-known that the covering radius of the Reed-Solomon [n, k, n − k + 1] q code is n − k.
In this paper we construct many new non-equivalent MDS codes over F q for lengths n ≤ q−1. In the range of lengths n ≤ q 1/4 satisfying gcd(n, q) = 1, non-equivalent MDS elliptic curve codes can be constructed for consecutive lengths. These codes can be constructed as AG codes from elliptic curves de-fined over F q . They are not equivalent to Reed-Solomon codes and not equivalent to the twisted Reed-Solomon codes. Moreover there are non-equivalent MDS elliptic curve codes with the same length and the dimension. Many new self-dual and self-orthogonal non-equivalent MDS codes with various lengths are also constructed. Twisted versions of elliptic curve codes are introduced such that the dimensions of their Schur squares are larger than the dimensions of Schur squares of elliptic curve codes. Therefore these twisted elliptic curve codes provide new linear almost MDS codes. Finally we give the application to the construction of MDS entanglement-assisted quantum codes. It is always good to understand the ampleness of AG codes from elliptic curves.

Preliminaries
Reed-Solomon codes proposed in the 1960 paper [42] are well-known MDS codes. Let F q be an arbitrary finite field, P 1 , . . . , P n be n ≤ q elements in F q . A Reed-Solomon code RS(n, k) is defined by This is a [n, k, n − k + 1] q linear MDS codes from the fact that a degree deg(f ) ≤ k − 1 polynomial has at most k − 1 roots. Reed-Solomon codes are algebraic geometric (AG) codes from the genus zero curve.
Motivated by the construction of twisted Gabidulin codes in [46], twisted Reed-Solomon codes were introduced in [9,10]. Some of these twisted Reed-Solomon codes are MDS code, see Section 4 of [10]. However it seems that there are strong restrictions on the lengths of these MDS twisted Reed-Solomon codes. The componentwise product (star product) of t vectors x j = (x j,1 , . . . , x j,n ) ∈ F n q , j = 1, . . . , t, is x 1 ⋆· · ·⋆x t = (x 1,1 · · · x t,1 , . . . , x 1,n · · · x t,n ) ∈ F n q . The componentwise product (star product) of linear codes C 1 , . . . , C t in F n q is defined by When C 1 = C 2 = C, the star product C ⋆ C is called the Schur square of the linear code C. It is clear that Schur squares of equivalent linear codes are equivalent. Hence the dimensions and the minimum Hamming distances of Schur squares are invariants of equivalent linear codes. The dimension of the Schur square of the Reed-Solomon [n, k, n − k + 1] q code is 2k − 1. This is used in [10] to show that many twisted Reed-Solomon codes are not equivalent to the Reed-Solomon code. Twisted Hermitian codes from Hermitian curves were introduced in a recent paper [2].
Let X be an absolutely irreducible, smooth and genus g curve defined over F q . Let P = {P 1 , . . . , P n } be the set of n distinct rational points of X over F q . Let G be a rational divisor over F q of degree deg(G) satisfying 2g − 2 < deg(G) < n and support(G) P = ∅.
Let L(G) be the function space associated with the divisor G, that is, L(G) is the space of all rational functions f satisfying (f ) + G ≥ 0. The algebraic geometry code (functional code) associated with G, P = {P 1 , . . . , P n } is defined by The dimension of this code is An divisor G = Σm i G i where m i ≥ 0 is called an effective divisor. Algebraicgeometric residual code C Ω (P 1 , . . . , P n , G, X) with the dimension k = n − m + g − 1 and minimum Hamming distance d ≥ m − 2g + 2 can be defined, we refer to [29,51] for the detail. It is the dual code of the functional code of the dimension m − g + 1. The AG codes from elliptic curves satisfy Hence these elliptic curve codes are near MDS codes.
It is clear that for two linear equivalent divisors G 1 and G 2 , the AG codes C(P 1 , . . . , P n , G 1 , X) and C(P 1 , . . . , P n , G 2 , X) are equivalent linear codes.

Elliptic curves over finite fields
In this subsection, we recall basic facts about elliptic curves defined over a finite field, which are mainly from the paper [44].
Let E be an elliptic curve defined over F q . It is well-known that when q is not a power of 2 or 3, then elliptic curves over F q can be realized as a non-singular plane cubic curve. Let E(F q ) be the set of all F q -rational points of E. The number |E(F q )| of its rational points over F q satisfies the Hasse bound |q For any positive real number x we set If q = p is a prime number it follows from the result in [20,44] that for any positive integer N satisfying p − < N < p + , there is an elliptic curve E defined over F p such that the number of F p -rational points of E satisfying It is well-known there is an Abelian group structure on E(F q ). As a group E(F q ) ≃ Z/mZ × Z/mkZ for some positive integers m and k. We refer to [44,48] for the detail. More accurately the following two results were proved in [44].
Theorem 3.1 (Theorem 1a in [44]). All the possible orders |E(F q )| of an elliptic curve E defined over F q , where q = p n is a prime power, are given by where β is an integer with |β| ≤ 2 √ q satisfying one of the following conditions: (c) If n is even and p = 1 mod 3: β = ± √ q; (d) If n is odd and p = 2 or 3: β = ±p n+1 2 ; (e) If either (i) n is odd or (ii) n is even, and p = 1 mod 4: β = 0.
All possible group structures of elliptic curves over F q were also determined in [44].
Theorem 3.2 (Theorem 3 in [44]). Let E be an elliptic curve over a finite field F q with q = p n elements. Let |E(F q )| = l l h l be the prime factoring. Then all the possible groups E(F q ) with the order |E(F q )| are the following, where v l (q − 1) is the order of prime factor l in q − 1.
From Theorem 3.1 and 3.2 there are a lot of elliptic curves with different orders |E(F q )| and different Abelian group structures. Therefore it seems there are many MDS codes from the following Theorem 3.3.

MDS codes from elliptic cuvres
The following basic facts about AG codes from elliptic curves are well-known. Let E be an elliptic curve defined over the finite field F q . Let P 0 , P 1 , . . . , P n be n+1 rational points. We take the divisor G = mP 0 , where 0 < m ≤ n−1.
Then an AG code C(P 1 , . . . , P n , G, E) from this elliptic curve E is constructed. This is a linear [n, m, ≥ n − m] q code. Theorem 3.3. 1) The minimum Hamming distance of C(P 1 , . . . , P n , G, E) is n − m if and only if there are m distinct points P i 1 , . . . , P im in the set {P 1 , . . . , P n } such that the effective divisor P i 1 + · · · + P im is linear equivalent to the divisor mP 0 . 2) If the effective rational divisor G 1 satisfies that G 1 + G is linearly equivalent to the effective divisor P 1 +· · ·+P n . The the dual code of C(P 1 , . . . , P n , G, E is equivalent to the AG code C(P 1 , . . . , P n , G 1 , E).
Proof. 1) is direct from the definition of AG code. 2) is direct from the definition of residual code, see [51].
Notice that the Jacobian of the elliptic curve E is itself, so the condition in Theorem 3.3 1) is equivalent to if P i 1 + · · · + P im = mP 0 is valid in the group E(F q ).

The Schur squares of elliptic curve codes
Let E be an elliptic curve defined over F q and P 0 is a rational point. We now discuss some properties of the linear space L(mP 0 ) of rational functions f satisfying (f ) + mP 0 ≥ 0. The following property is well-known. Proof. If there is a non-constant rational function f in the space L(P 0 ), then (f ) = Q − P for some rational point Q ∈ E(F q ). That is, P 0 is linearly equivalent to another rational point Q ∈ E(F q ). This is a contradiction to the fact that E(F q ) is the Jacobian On the other hand from the Riemann-Roch theorem, dim(L(mP 0 )) = m when m ≥ 2g − 1 = 1. The second conclusion follows immediately.
Theorem 3.4. The dimension of the Schur square of an one-point AG code C(P 1 , . . . , P n , mP 0 , E) from an elliptic curve E is 2m if 6 ≤ 2m ≤ n.
Proof. Let f 1 be the constant function in L(mP 0 ), f i , i = 2, . . . , m be the rational function with the i-th order pole at the point P 0 . It is clear that C(P 1 , . . . , P n , mP 0 , E) = {(f (P 1 ), . . . , f (P n )) : f = Σa i f I , a i ∈ F q }. It is clear that the Schur square of C(P 1 , . . . , P n , mP 0 , E) is in the AG code C(P 1 , . . . , P n , 2mP 0 , E). On the other hand it is easy to verify that the evaluation codewords of f 1 , f 2 , . . . , f m are in the Schur square. The rational function f i f j , where i ≥ 2, j ≥ 2 satisfying m + 1 ≤ i + j ≤ 2m, can have w-th order pole at the point P 0 for w = m + 1, . . . , 2m. Then the Schur square of C(P 1 , . . . , P n , mP 0 , E) is C(P 1 , . . . , P n , 2mP 0 , E). The conclusion is proved.
It is obvious that the minimum Hamming distance of the Schur squares of an elliptic curve [n, k, ≥ n − k] q code is at least n − 2k. Theorem 3.4 can be generalized to one point AG codes from higher genus curves.

Twisted AG codes from elliptic curves
In this section we construct twisted versions of elliptic curve codes such that their Schur squares have larger dimensions. Some of them are almost MDS codes. We consider the twisted version of the AG code C(P 1 , . . . , P n , mP 0 , E) as in the previous section, where m is a positive integer satisfying m ≤ n−1 2 . The C twisted,i is a linear [n, m] q code Proof. First of all we can find two i 1 , i 2 such that f then evaluation codeword of f 2m+1 is in the Schur square. The conclusion follows immediately.
If there is no m + 1 points P i 1 , . . . , P i m+1 in the set P = {P 1 , . . . , P n } such that (m + 1)P 0 is linear equivalent to the divisor P i 1 + · · · + P i m+1 , the minimum Hamming distance of C twisted,i is at least n − m. Then this twisted version code is a linear almost MDS code.
Proof. The conclusion follows from a similar argument as the proof of Theorem 3.3 1).
Example 4.1. From the classical results in [44], there are many different elliptic curves over F q . We consider an elliptic curve with |E(F q )| rational points such that |E(F q )| is of the form p l 1 1 · · · p lt t where t ≥ 2, l 1 , . . . , l t are positive integers, p 1 < p 2 < · · · < p t are prime numbers. It is obvious from Theorem 4.2 that there are many such elliptic curves. For example, when q = p is a prime number, any positive integer satisfying p − ≤ N ≤ p + can be the order of an elliptic curve defined over F p .
Let p t−1 be a prime such that gcd(p t−1 , q) = 1. From Theorem 4.2 let E 1 ⊂ E(F q ) be an order p l t−1 subgroup of E(F q ) for some positive integer l. Then there are a lot of choices of this positive integer l. Let b ∈ E(F q ) be a rational point such that the cyclic subgroup generated by b has only the zero element in its intersection with E 1 . Let m b be the order of the cyclic subgroup generated by b.
Let P be the coset b + E 1 , P 0 be the zero element of the group E(Fq), and m be a positive integer satisfying m ≤ p l t−1 2 . Then the elliptic curve code C(P 1 , . . . , P p l t−1 , mP 0 , E) is a linear near MDS code. The dimension of its Schur square is 2m. We assume that m + 1 ≤ m b . Then from Theorem 4.2, C twisted,i is a linear almost MDS code, since for any m + 1 points in P, the effective divisor P i 1 + · · · + P i m+1 is of the form (m + 1)b + P where P is an element in the subgroup E 1 . This element (m + 1)b + P can not be zero (linear equivalent to (m + 1)P 0 ), since the cyclic subgroup generated by b intersects with E 1 at the zero element. Then we have a linear almost MDS code C such that the dimension of its Schur square is of the dimension 2 dim(C) + 1. From Theorem 3.4, this twisted version of an elliptic curve code is not equivalent to any elliptic curve code.
From the classical results due to Rück, there are many such twisted elliptic curve codes. Then many new almost MDS codes, which are not equivalent to elliptic curve codes, are constructed.

New non-equivalent MDS codes
Let q be a prime power. In this section the set P = {P 1 , . . . , P n } is the disjoint union of several cosets of a subgroup of E(F q ). We show that there are many new non-equivalent MDS AG codes of consecutive lengths from this elliptic curve E defined over F q . These MDS codes are not equivalent to the Reed-Solomon codes from the dimensions of their Schur squares. On the other hand the twisted Reed-Solomon MDS codes have been only constructed for some special lengths n satisfying that n is a divisor of q − 1 or gcd(n, q − 1) = n 2 , or n is a divisor of q, see [?, 10]. Therefore it is obvious that there are more non-equivalent MDS AG codes from elliptic curves than twisted Reed-Solomon codes. In the following part P 0 is the zero element in the group E(F q ).
Theorem 5.1. 1) Let E 1 ⊂ E(F q ) be a subgroup of the order n 1 and b ∈ E(F q ) be a nonzero element such that the n 2 order cyclic subgroup generated by b intersects E 1 at the zero element. Then for any positive integer m ≤ n 2 − 1, the elliptic curve code C(b + E 1 , mP 0 , E) is an MDS code. 2) Let E 1 ⊂ E(F q ) be a subgroup of the order n 1 and b i ∈ E(F q ), i = 1, . . . , t, be t nonzero elements in E(F q ) such that the set {m 1 b 1 +· · ·+m t b t : m 1 +· · ·+ m t = m} intersects the subgroup E 1 at the zero element. Set P be the union of t cosets b 1 + E 1 , . . . , b t + E 1 . Then the elliptic curve code C(P, mP 0 , E) is an MDS code.
Proof. The P i 1 + · · · + P im of m rational points in the coset b + E 1 is of the form mb + P , where P ∈ E 1 , from the condition that the the order n 2 cyclic subgroup < b >⊂ E(F q ) intersects E 1 only at zero element, this sum is not zero element in E(F q ) since m ≤ n 2 − 1. The conclusion follows directly. The second conclusion can be proved similarly.
Example 5.1. Let q = p be a prime number, from the classical result in [20] for any given positive integer satisfying p − ≤ N ≤ p + , there is an elliptic curve E defined over F p such that N = |E(F p )|. Suppose that N = p 1 p 2 be the product of two different prime numbers, where gcd(p, p i ) = 1 for i = 1, 2. There is an elliptic curve defined over F p such that the group structure of E(F p ) is Z/p 1 Z ⊕ Z/p 2 Z from Theorem 3.2. Let E 1 be the cyclic subgroup Z/p 1 Z × 0 of the order p 1 . Then for each element of the form (0, x) ∈ 0 × Z/p 2 Z, the elliptic curve code C(b + E 1 , mP 0 , E) is an MDS code for 1 ≤ m ≤ p 1 .
Let b 1 < · · · < b t be t ≤ p 2 −1 distinct nonzero elements in 0×Z/p 2 Z and m be a positive integer satisfying mb t ≤ p 2 . Then m 1 b 1 + · · · + m t b t ≤ mb t < p 2 , where m 1 +· · ·+m t = m. Let P be the union of t cosets b 1 +E 1 , . . . , b t +E 1 . The elliptic curve code C(P, mP 0 , E) is an MDS codes.
It is obvious when t ≥ p 2 +1 2 , then m cannot bigger than or equal to two. Hence if we want to construct a dimension 2 MDS elliptic curve code in this example, the length is smaller than p 1 p 2 2 ≤ q + 1.
On the other hand we can take E 1 be the subgroup 0 × Z/p 2 Z, then for 1 × 0 = b, the elliptic curve code C(P, mP 0 , E) is an MDS code when m ≤ p 1 − 1.
Corollary 5.1. Let E be an elliptic curve with the order |E(F q )| = l 1 l 2 where l 1 < l 2 are two positive integers satisfying gcd(l i , q) = 1, i = 1, 2, and gcd(l 1 , l 2 ) = 1. Then there exists an elliptic curve of the order l 1 l 2 such that for an order l 1 subgroup E 1 of E(F q ) and one coset P of E 1 , the elliptic curve code C(P, mP 0 , E) is an MDS codes for 2 ≤ m ≤ l 1 − 1.
Proof. We have an elliptic curve E defined over F q such that E(F q ) has a subgroup of the form Z/l 1 l 2 Z from Theorem 3.2 and the condition gcd(l 1 , q) = gcd(l 2 , q) = 1. From the condition gcd(l 1 , l 2 ) = 1, the group E(F q ) is of the form Z/l 1 Z ⊕ Z/l 2 Z. In this case by letting E 1 be the cyclic subgroup Z/l 1 Z × 0 of the order l 1 and b be the for 0 × x where x is the generator of Z/l 2 Z. The conclusion follows from Theorem 5.1.
Corollary 5.2. Let n be a positive integer satisfying 6 ≤ n ≤ q 1/4 , gcd(n, q) = 1, and m be any positive integer satisfying 2 ≤ m ≤ n 2 . Then there is an MDS elliptic curve code over F q with the length n and dimension m. This MDS code is not equivalent to the Reed-Solomon [n, m, n − m + 1] q code when m ≥ 3.
Proof. First of all we can find an elliptic curve of the order nl where l is a positive integer satisfying gcd(n, l) = 1. Then the conclusion follows from Theorem 5.1 and Theorem 3.4 immediately.
Since the general MDS conditions about twisted Reed-Solomon codes are restricted to subfields or subgroups as in [10], certainly many MDS codes constructed in Corollary 5.2 are not equivalent to these MDS twisted Reed-Solomon codes, or there is no MDS twisted Reed-Solomon code of the corresponding length. Actually many new non-equivalent MDS codes from elliptic curves are constructed for consecutive lengths. On the other hand we can observe the following example of MDS twisted Reed-Solomon codes as in [10].
Let n and k be two positive integers satisfying n ≤ q − 1 and k ≤ n − 1. Let α 1 , . . . , α n be n distinct elements in the finite field F q such that α = {α 1 , . . . , α n } is a n element subset F q . Let η be a nonzero element of F q . Set g 0 = 1 + ηx k , g 1 = x, . . . , g k−1 = x k−1 . Let P(η, k) be the linear span over F q by g 0 , . . . , g k−1 . The linear [n, k] q code C α,η,k is the evaluation code of these polynomials in P(η, k) at the above n elements in the subset α. The dimension of the Schur square of C α,η,k is at least 2k. Thus this code is not equivalent to a Reed-Solomon code when 2k ≤ n. It is not hard to verify that if η can not be represented as the product of any k elements in α, that is, for any k distinct α i 1 , . . . , α i k ∈ α, this code C α,η,k is an MDS code.
The above condition about the set α is strong if we want MDS twisted Reed-Solomon codes for large dimensions k. From the construction in Theorem 5.1, the MDS condition is not so strong. Hence there are many MDS elliptic curve codes, which are not equivalent to MDS twisted Reed-Solomon codes, or there is no MDS twisted Reed-Solomon code of the corresponding length. Proof. Set n = ⌊ √ p⌋, it is clear that gcd(n, p) = gcd(n + 1, p) = 1. Then there is an elliptic curve E defined over F p with n(n + 1) rational points from Theorem 3.1 and 3.2, with the group structure |E(F p ) = Z/nZ ⊕ Z/(n + 1)Z. The conclusion follows from Theorem 5.1.
Now we can use supersingular elliptic curves to construct non-equivalent MDS codes. Let us recall some basic facts about supersingular elliptic curves. From [48] page 152, the elliptic curve E defined over F p by y 2 = x 3 + 1 is supersingular when p ≡ 2 mod 3, and the elliptic curve E defined over F p by y 2 = x 3 + x is supersingular when p ≡ 3 mod 4. For a supersinglular elliptic curve E defined over E p it is known that if n is an odd positive integer, or if n is an even positive integer, see page 155 of [48]. We have the following result.
Corollary 5.4. Let p be an odd prime satisfying p ≡ 2 mod 3 or p ≡ 3 mod 4. Let N be a factor of p n + 1 satisfying N < √ p n + 1, when n is odd, and N be a factor of (p Proof. There is no factor p l in |E(F p n )|, then we can take a(l) = 0 for any prime factor l of |E(F p n )| in Theorem 3.2. The conclusion follows from Theorem 5.1 1) directly.
Some MDS codes were introduced in [43], it is not hard to verify that the minimum Hamming distances of the Schur square of Roth-Lemple MDS codes are very small. Hence our MDS elliptic curve codes are not equivalent to Roth-Lempel codes.
Moreover from Theorem 3.3 we can construct some MDS elliptic curve codes such that the Schur squares are not MDS codes. Therefore some nonequivalent MDS elliptic curve codes with the same length and the same dimension are constructed.
6 Self-dual MDS codes from elliptic curves over finite fields F 2 s.
In this section we restrict to the elliptic curves E defined over a finite field F 2 s of the characteristic 2. The set P = {P 1 , . . . , P n } is one coset of a subgroup E 1 ⊂ E(F 2 s ). We show that there are many self-dual MDS AG codes from this elliptic curve E defined over F 2 s . In this section we always are in the case a) of Theorem 3.1, that is, β is an odd positive integer satisfying that gcd(2 − β, 2 s − 1) > 1 has an odd divisor. Then the group order |E(F 2 s )| = 2 s + 1 − β is an even number, and 2 s + 1 − β = 2 s − 1 + 2 − β, gcd(|E(F 2 s )|, 2 s − 1) > 1 has an odd divisor. Actually since β can be any odd number in the case a) of Theorem 3.1 when q = 2 s , if s is a composite number s = s 1 s 2 it is obvious we can take 2 − β ≡ 0 mod (2 s 1 − 1). Hence there are many such elliptic curves with the desired group orders.
Therefore we need the following conditions to construct self-dual MDS elliptic curve codes.

4)
The above elliptic curve is of the group structure Z/2 h 2 Z ⊕ Z/LZ, where h 2 ≥ 3 and L is an odd positive integer.
From Theorem 3.1 and 3.2 there are many such an elliptic curve. Then the group order of the elliptic curve is where h 2 ≥ 3 and L is an odd positive integer. Theorem 6.1. Let q = 2 s 1 s 2 as above and L ′ be an odd divisor of L, n = 2 t L ′ where t ≤ h 2 − 1. There exists a self-dual [n, n 2 , n 2 + 1] 2 s 1 s 2 MDS code equivalent to an elliptic curve code from E, which is not equivalent to the Reed-Solomon code.
Proof. From Theorem 3.2 we can find elliptic curve such that for any odd divisor L ′ |L, there is an order L ′ subgroup E 2 ⊂ E(f 2 s 1 s 2 ). Therefore we have an order 2 t L ′ subgroup E 1 of the form (2 h 2 −t θ) × E 2 where θ is the generator of the cyclic subgroup Z/2 h 2 Z ⊂ E(F 2 s 1 s 2 ).
This is not zero. Therefore the elliptic curve code C(P, 2 t L ′ P 0 , E) is an MDS code from Theorem 3.3. Here P 0 is the zero element of the group E(F 2 s 1 s 2 ).
The sum of all elements in the coset E 1 is of the form −2 h 2 −1 L ′ θ × 0, since the sum of all elements in an order L ′ , L ′ odd, is zero, and the sum of all elements in Z/2 u Z is −2 u−1 . Then the sum of all elements in P is 2 h 2 −1 L ′ θ × 0 − 2 h 2 −1 L ′ θ × 0 is zero element P 0 . Therefore from Theorem 3.3. 2), the dual code of C(P, 2 t−1 L ′ P 0 , E) is equivalent to a linear code C(P, 2 t−1 L ′ P 0 , E). Suppose that the dual code is of the form where v = (v 1 , . . . , v n ) ∈ F n 2 s 1 s 2 is a Hamming weight n vector.
Since this field is of characteristic 2, each element v i is a square, The dimension of the Schur square of this self-dual code is exactly n. It is equivalent to a Reed-Solomon [n, n 2 , n 2 + 1] 2 s 1 s 2 code, this dimension is n − 1. The conclusion is proved.
Notice that L ′ can be any odd divisor of the group order |E(F 2 s 1 s 2 )|, there are indeed many self-dual MDS codes which are equivalent to elliptic curve codes. Actually self-dual MDS elliptic curve codes over F 2 s of the length 4L, where L is any odd positive number in the range [1, 2 s +1+⌊2 ], can be constructed. Hence there are many new self-dual MDS elliptic curve codes over the finite field F 2 s , which are not equivalent to self-dual Reed-Solomon codes or self-dual twisted Reed-Solomon codes.
It is obvious the subcodes are equivalent self-orthogonal MDS codes from elliptic curves. From the result in [16] it is easy to construct equivalent LCD MDS codes from self-dual MDS elliptic curve codes. From Theorem 6.1 and the CSS construction of entanglement-assisted quantum codes in [12] the following results follows immediately. Corollary 6.1. Let q = 2 s 1 s 2 as in above, n be a positive integer of the form 2 t L ′ where L ′ is an odd divisor of the group order E(F 2 s 1 s 2 ) and t ≤ h 2 − 1, and k be a positive integer satisfying n 2 ≤ k ≤ n − 1, and h be a nonnegative integer satisfying 0 ≤ h ≤ n 2 , there exists an MDS EAQEC [[n, k − h, n − k + 1, n − k − h]] 2 s 1 s 2 code.
Proof. From Theorem 6.1 we have an equivalent MDS self-dual elliptic curve [n, n 2 , n 2 + 1] 2 s 1 s 2 code. From the result in [16] we have a linear MDS [n, n 2 , n 2 + 1] 2 s 1 s 2 code with the h-dimension hull, where 0 ≤ h ≤ n 2 . Then the conclusion follows from the CSS construction of entanglement-assisted quantum codes immediately.
Notice that the MDS elliptic curve codes in Theorem 6.1 are not equivalent to Reed-Solomon code, then these EAQEC codes in Corollary 6.1 are new MDS entanglement-assisted quantum codes comparing to previous constructed MDS EAQEC codes in [16] and references therein.

Conclusion and unsolved problems
In this paper we constructed many new MDS AG codes and new self-dual MDS AG codes from elliptic curves, which are not equivalent to Reed-Solomon codes and not equivalent to twisted Reed-Solomon codes. This indicated that nice elliptic curve codes can be obtained from the carefully chosen evaluation points. A class of twisted elliptic curve codes was introduced with higher dimension Schur squares. These twisted elliptic curve codes are new almost MDS codes. Though many non-equivalent MDS elliptic curve codes and self-dual MDS elliptic curve codes are constructed, and moreover there are many non-equivalent MDS codes from elliptic curves for small consecutive lengths, the following several problems seem interesting and necessary. It seems that the answers to these problems are possible. 1) What is the range of lengths such that there are non-equivalent MDS elliptic curves codes. The ranges in Corollary 5.2 and Corollary 5.4 are obviously not optimal. Are there non-equivalent MDS elliptic curve codes over prime field F p of any given length n ≤ p 3 ?
2) Can MDS [n, k, n − k + 1] q codes be constructed as one point AG codes from genus g ≥ 2 curves (for example, Hermitian curves) defined over F q by carefully chosen evaluation points, with a higher dimension ≥ 2k + 1 Schur square? We refer to the remark after Theorem 3.4. It seems that the existence of MDS AG codes from higher genus curves over large fields can be proved by a counting argument.
3) Can self-dual MDS elliptic curve codes over F q be constructed for finite fields F q where q is an odd prime power? 4) Can large dimension Hermitian self-orthogonal MDS elliptic curve codes over F q 2 be constructed?