Minimum Distance and Weight Enumerator of a Linear Codes over arbitrary fields

This program computes  the minimum distance and the weight enumerator of linear codes over arbitrary fields GF(q). There is a faster  program for the computation of the minimum distance of binary or ternary linear codes. 

Please, enter some generator matrix in one of the following forms. In the case of a prime field GF(p) the field elements are entered as integers modulo p.

Example: The quadratic residue code C(11,6) over GF(3): n=11, k=6, q=3.
2 2 1 2 0 1 0 0 0 0 0
0 2 2 1 2 0 1 0 0 0 0
0 0 2 2 1 2 0 1 0 0 0
0 0 0 2 2 1 2 0 1 0 0
0 0 0 0 2 2 1 2 0 1 0
0 0 0 0 0 2 2 1 2 0 1

In the case of a nonprime field GF(q) the zero is entered as 0 and the nonzero elements are entered as exponents of a primitive element. This means that the one is entered as q-1.

Example: n=11, k=6, q=4.
3 0 0 0 0 0 0 0 0 3 0
0 3 0 0 0 0 1 0 0 3 0
0 0 3 0 0 0 0 1 0 0 0
0 0 0 3 0 0 2 0 1 0 0
0 0 0 0 3 0 1 2 0 1 0
0 0 0 0 0 3 2 1 2 0 1

n:
k:
q:
generator matrix: