# convert a cyclic code $C$ of length $n$ over a field $\mathbb{F}_{q^m}$ to a code $D$ of length $mn$ over $\mathbb{F_q}$

say i have a cyclic code $C$ of length $n$ over a field $\mathbb{F}_{q^m}$ . is it possible to have construct a code $D$ of length $mn$ over $\mathbb{F_q}$

it's mathematically possible since $\mathbb{F}_{q^m}$ is a vector space of degree $m$ over $\mathbb{F}_q$

but i didn't find how to-do it in sage

edit retag close merge delete

Please give an example of an explicit $C$.

( 2018-05-09 03:16:37 -0500 )edit

thank for your respond . this is the smallest non trivial example i cam with C is a BCH code over GF(4) K.= GF(4);

R.<x>=K[]; V=x^3+x^2+a*x+a+1; V.is_primitive(); #yes L. = K.extension(V); g=1 #juse inisialzation for i in [1..28]: #the biggest delta(=28 here) the biggest g ==> the smallest our code c=b^(i) g=lcm(g,c.minpoly()) C = codes.CyclicCode(generator_pol = g, length = 63) C;
( 2018-05-09 05:35:02 -0500 )edit

Sort by ยป oldest newest most voted

If i correctly understood the task, than the following is a possibility.

First of all, let us generate the given code in sage, and print some information on its basis. Adapted sage code:

S.<A> = PolynomialRing( GF(2) )
K.<a> = GF(2^2, modulus=A^2+A+1)
R.<x> = PolynomialRing( K )

V = x^3 + x^2 + a*x + a + 1;
L.<b> = K.extension( V )

delta = 28
# the bigger this delta (=28 here), the bigger g, so the smaller our code
g = lcm( [ (b^k).minpoly() for k in [1..28] ] )
# note that g divides x^63-1 since each minimal poly in the list above does it
C = codes.CyclicCode( generator_pol = g, length = 2^6-1 )

print "The code C is:\n%s\n" % C
print "The basis of C is...\n"
for v in C.basis():
print v


Results:

The code C is:
[63, 14] Cyclic Code over GF(4)

The basis of C is...

(1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, a + 1, 0, 1, 1, a + 1, a,  ...
(0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, a + 1, 0, 1, 1, a + 1,  ...
(0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, a + 1, 0, 1, 1,      ...
(0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, a + 1, 0, 1, 1,   ...
(0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, a + 1, 0, 1,   ...
(0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, a + 1, 0,   ...
(0, 0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, a + 1,   ...
(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1,       ...
(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, a  ...
(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, 1, ...
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, 1, ...
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, 0, ...
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, a, ...
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, a + 1, a + 1, a, a, a, 0, 1, ...


The results for the basis vectors were manually truncated.

Now, if i understand the construction of the new code from this one, we build a new basis, replacing the above entries as follows:

• $0$ by $(0,0)$
• $1$ by $(1,0)$
• $a$ by $(0,1)$
• $a+1$ by $(1,1)$.

For this, we construct the matrix $E$ from the above list of vectors, as rows, using the natural lift. Code:

def get_lift(c):
"""
for an element c in K, lift it to GF(2)^2
"""
lift = S(c).coefficients(sparse=False)
return lift + (2-len(lift))*[ GF(2)(0) ]

MS = MatrixSpace( GF(2), 14, 2*63 )
E  = []    # and we append
for v in C.basis():
w = []    # and we append
for entry in v:
w += get_lift( entry )
E.append( w )

D = LinearCode( MS( E ) )
print D


I think, D is the needed code.

more

thank you sir although i still trying to understand what the last loop dose , i have tow observation

the lifted of the generator matrix of a code isn't always the generator matrix of the lifted code. for example the code $C=(0,0)(1,\alpha)(\alpha,\alpha+1)(\alpha+1,1)$ is generated by $(1,\alpha)$ " a 1*1 matrix by the lifted code $D=(0,0,0,0)(1,0,0,1)(0,1,1,1)(1,1,1,0)$ is not generated by $(1,0,0,1)$ the lift of $(1,\alpha)$

my second observation is that $C$ and $D$ should have the same cardinal since we are replacing every codeword by a codeword with twice it length

however, i believe i can use the function get_lift() that you defined and apply it t every codeword in $C$ and store the result somehow in $D$ .

i again ...(more)

( 2018-05-10 06:31:13 -0500 )edit