Zero code, zero vector space and their Sage representation
As I was told to not bring this to any meeting (it might supposedly trigger never ending discussions), I'm posting this here.
I was playing with limit cases of Punctured Codes, and I tried to delete all the positions of the code. In that case, you got the zero code, whose base is empty: {Ø} and (as its a vector space) the set of its elements is reduced to 0.
I checked the Sage implementation: for a vector space of dimension 0, the base is empty, but also is the list of its elements:
sage: V = VectorSpace(GF(7), 0)
sage: V.basis()
[
]
sage: V.list()
[()]
(well, to be more specific, it contains only one elements, which is an empty vector).
Now, mathematically speaking, a vector space of dimension 0 must contain the zero vector, so the Sage implementation is not (imho) mathematically correct.
If we come back to codes, some interesting questions:
- how to implement this? I could add some kind of check which returns 0 if one tries to get a vector of a zero code. Add a line like
if self.dimension() == 0:
return self.ambient_space().zero()
to all methods like random_element
and so on. Or maybe something more clever?
-
what about the distance? Such a code is MDS for sure, but is its distance
n
orn+1
? -
I settled the
unencode
question in #18376
So, what do you think about this?
Comments (1)
-
reporter - Log in to comment
Remark from #18376: a least one method (
__iter__
) does not work for codes of dimension 0.