ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 23 Mar 2015 15:54:25 +0100Computing minimum_distance of a code on non-prime fields fails ... sometimes.https://ask.sagemath.org/question/26283/computing-minimum_distance-of-a-code-on-non-prime-fields-fails-sometimes/ Consider the following piece of code:
C=codes.RandomLinearCode(4,2,GF(16,'b'))
C.minimum_distance()
About half of the time, it fails with error
TypeError: unable to coerce from a finite field other than the prime subfield
I'd understand if SAGE could only compute the minimum distance for codes over primes fields, what has me confused is the fact that sometimes it can, sometimes it can't. Any clues as to what is going on here?KojiMon, 23 Mar 2015 15:54:25 +0100https://ask.sagemath.org/question/26283/a bug in computing minimum distance, coding theoryhttps://ask.sagemath.org/question/24504/a-bug-in-computing-minimum-distance-coding-theory/ For anyone who is familiar with coding theory, we build codes as a subspace of the vector space F_q^n from generating matrices, with all linear combinations of rows of this matrix. For any generating matrix defined over a Finite Field, SAGE has spesific attributes "C =LinearCode(G)" which constructs the code from generating matrix and "C.minimum_distance()" which computes the minimum distance of the code.
However, there is probably a bug or something which I couldn't find out.
For example see this:
This code is a [7,3] linear code over the field GF(4,"a"), which has min. distance 3,(as computed with MAGMA), but SAGE computes its min. distance as 5, which is above upper bound!
This is the SAGE input-output:
K = GF(4,"a"); a = K.gen(); G = Matrix([[a, a + 1, 1, a + 1, 1, 0, 0], [0, a, a + 1, 1, a + 1, 1, 0], [0, 0, a, a + 1, 1, a + 1, 1], [a + 1, 0, 1, 0, a + 1, 1, a + 1], [a, a + 1, a + 1, 0, 0, a + 1, 1], [a + 1, a, a, 1, 0, 0, a + 1], [a, a + 1, 1, a + 1, 1, 0, 0]]); C=LinearCode(G); C; C.minimum_distance();
gives the output:
︡"Linear code of length 7, dimension 3 over Finite Field in a of size 2^2" "5"
However for the same conditions MAGMA says this:
︡> G6 := LinearCode <F,7|[[a, a + 1, 1, a + 1, 1, 0, 0], [0, a, a + 1, 1, a + 1, 1, 0], [0, 0, a, a + 1, 1, a + 1, 1], [a + 1, 0, 1, 0, a + 1, 1, a + 1], [a, a + 1, a + 1, 0, 0, a + 1, 1], [a + 1, a, a, 1, 0, 0, a + 1], [a, a + 1, 1, a + 1, 1, 0, 0]]>; G6;
[7, 3, 3] Linear Code over GF(2^2)
I don't understand where SAGE fails..
Do you have any idea?
algebraicallyclosedThu, 16 Oct 2014 19:14:26 +0200https://ask.sagemath.org/question/24504/