Hi,
I am working on linear codes and I observed a high memory consumption when
constructing codes of large length. I figured out that this problem already
appears in the construction of vector spaces:
sage: F.<a> = GF(4)
sage: M = MatrixSpace(F, 8, 10000).random_element()
sage: V = VectorSpace(F, M.ncols())
sage: V.__dict__.keys()
['__reduce_ex__', '_element_class', '_gram_matrix',
'_FreeModule_generic__rank', '_FreeModule_generic__is_sparse',
'_FreeModule_generic__degree',
'_FreeModule_generic__uses_ambient_inner_product']
sage: V.subspace(M)
Vector space of degree 10000 and dimension 8 over Finite Field in a of size
2^2
Basis matrix:
8 x 10000 dense matrix over Finite Field in a of size 2^2
sage: V.__dict__.keys()
['__reduce_ex__', '_element_class', '_gram_matrix',
'_FreeModule_generic__rank', '_FreeModule_generic__is_sparse',
'_FreeModule_generic__degree', '_FreeModule_ambient__basis',
'_FreeModule_generic__uses_ambient_inner_product']
As you can see, the construction of the subspace adds a basis to V ==> sage
stores 10000 dense vectors of length 10000!
Doing the same construction over other fields, say F=QQ, does not show this
behavior. Is there any
solution in sight for this?