1 | LIB "tst.lib"; tst_init(); |
---|
2 | LIB "brnoeth.lib"; |
---|
3 | ring s=2,(x,y),lp; // characteristic 2 |
---|
4 | poly f=x3y+y3+x; // the Klein quartic |
---|
5 | list KLEIN=Adj_div(f); // compute the conductor |
---|
6 | KLEIN=NSplaces(1..3,KLEIN); // computes places up to degree 3 |
---|
7 | KLEIN=extcurve(3,KLEIN); // construct Klein quartic over F_8 |
---|
8 | KLEIN[3]; // display places (degree, number) |
---|
9 | // We define a divisor G of degree 14=6*1+4*2: |
---|
10 | intvec G=6,0,0,4,0,0,0,0,0,0,0; // 6 * place #1 + 4 * place #4 |
---|
11 | // We compute an evaluation code which evaluates at all rational places |
---|
12 | // outside the support of G (place #4 is not rational) |
---|
13 | intvec D=2..24; |
---|
14 | // in D, the number i refers to the i-th element of the list POINTS in |
---|
15 | // the ring KLEIN[1][5]. |
---|
16 | def RR=KLEIN[1][5]; |
---|
17 | setring RR; POINTS[1]; // the place in the support of G (not in supp(D)) |
---|
18 | setring s; |
---|
19 | def RR=KLEIN[1][4]; |
---|
20 | setring RR; |
---|
21 | matrix C=AGcode_L(G,D,KLEIN); // generator matrix for the evaluation AG code |
---|
22 | nrows(C); |
---|
23 | ncols(C); |
---|
24 | // |
---|
25 | // We can also compute a generator matrix for the residual AG code |
---|
26 | matrix CO=AGcode_Omega(G,D,KLEIN); |
---|
27 | // |
---|
28 | // Preparation for decoding: |
---|
29 | // We need a divisor of degree at least 6 whose support is disjoint with the |
---|
30 | // support of D: |
---|
31 | intvec F=6; // F = 6*point #1 |
---|
32 | // in F, the i-th entry refers to the i-th element of the list POINTS in |
---|
33 | // the ring KLEIN[1][5] |
---|
34 | list K=prepSV(G,D,F,KLEIN); |
---|
35 | K[size(K)][1]; // error-correcting capacity |
---|
36 | // |
---|
37 | // Encoding and Decoding: |
---|
38 | matrix word[1][11]; // a word of length 11 is encoded |
---|
39 | word = 1,1,1,1,1,1,1,1,1,1,1; |
---|
40 | def y=word*CO; // the code word (length: 23) |
---|
41 | matrix disturb[1][23]; |
---|
42 | disturb[1,1]=1; |
---|
43 | disturb[1,10]=a; |
---|
44 | disturb[1,12]=1+a; |
---|
45 | y=y+disturb; // disturb the code word (3 errors) |
---|
46 | def yy=decodeSV(y,K); // error correction |
---|
47 | yy-y; // display the error |
---|
48 | tst_status(1);$ |
---|