Large memory consumption by the basis of the ambient space

42 views
Skip to first unread message

Thomas Feulner

unread,
Aug 30, 2012, 3:23:28 AM8/30/12
to sage-...@googlegroups.com
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?


Thomas Feulner

unread,
Aug 30, 2012, 4:38:47 AM8/30/12
to sage-...@googlegroups.com
An update:

The ticket 
http://trac.sagemath.org/sage_trac/ticket/13304
does not solve this problem.
Reply all
Reply to author
Forward
0 new messages