Hello everybody,

I think that I may have uncovered a bug in the weight distributions 
(spectrum) code for binary codes, though it may just be me misusing the 
function. 

Problem:

When a binary code is constructed using a matrix that doesn't have full rank 
then the spectrum calculation is incorrect. (maybe other computation are 
incorrect also) 


Example: (sage 4.7) 

sage: F
Finite Field of size 2
sage: G
[0 0 0 1 1]
[1 0 1 0 1]
[1 0 1 1 0]
[1 1 1 0 0]
sage: G.rank()
3
sage: C = LinearCode(G)
sage: C.weight_distribution()
[2, 0, 6, 6, 0, 2]
sage: C.list()
[(0, 0, 0, 0, 0), (1, 0, 1, 0, 1), (0, 1, 0, 0, 1), (1, 1, 1, 0, 0), (0, 0, 
0, 1, 1), (1, 0, 1, 1, 0), (0, 1, 0, 1, 0), (1, 1, 1, 1, 1)]


The assumption that the generating matrix is of full rank seems to lie in 
binary_code.pyx on line: 113 in Sage 4.7. 

binary_code.pyx:

L113:    cdef int i,j,k, dim=M.nrows(), deg=M.ncols()

where the dimension is calculated as the number of rows.

I don't know enough about the algorithm to submit a patch (if this is 
determined to actually be a bug) but if somebody can point me to some 
literature on this I could  fix this.

If G is assumed to be of full rank then maybe a warning can be put into 
either the documentation or printed out on the display. 

Thanks for making such a nice system.

David Monarres

2

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to