It's well known that the problem of complete decoding for a linear code is a NP-hard computational, so for codes of long length or over finite fields with big cardinality the time for decoding is big.(grows exponentially)
Still I'm working in the optimization of the code to reduce as much as possible the time of decoding.
One problem I'm facing is how to generate (in the wisest way) all vectors over the finite field of given weight and certain length. Permutations and combinations in general are operations that take long times plus the fact that the number of vectors grows exponentially with the length of the code.
Here the code. Still missing documentation and details for presentation: Code
Here an example:
sage: C = RandomLinearCode(6,3,GF(4,'a')
sage: v = random_vector(GF(4,'a'),C.
(0, a, a, a + 1, a, a + 1)
#time it takes with syndrome algorithm vs fglm algorithm
sage: %timeit C.decode(v) #syndrome algorithm
1000 loops, best of 3: 709 us per loop
sage: %timeit C.decode_fq(v) #using my implemented fglm
1 loops, best of 3: 609 ms per loop
#solutions of syndrome and fglm algorithm are different
sage: d = C.decode(v)
(0, 1, 0, a + 1, a, a + 1)
sage: d1 = C.decode_fq(v)
(0, 1, a + 1, a + 1, a + 1, a + 1)
#check that both d and d1 belong to the same coset
sage: y1 = v-d
sage: y2 = v-d1
sage: H = C.check_mat()
(0, a + 1, a)
(0, a + 1, a)