Processing math: 100%
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to obtain a linear space from the direct sum of two spaces?

Dear all,

Given a linear space V of dimension m over a finite field. W1 is t1-dimensional space of V. W2 is t2-dimensional space of V . W1 and W2 are in direct sum. If W=W1+W2 and W1 are known, then how to solve W2 by Sage?


def random_small_space_gen(t,m):
    B = matrix(GF(q),t,m,0)
    while B.rank() != t:
        B = random_matrix(GF(q),t,m)
    return B.row_space()

(q,m,t1,t2) = (2,30,3,4)
Fqm = GF(q)

V = random_small_space_gen(m,m)
W1 = random_small_space_gen(t1,m)
W2 = random_small_space_gen(t2,m)
W = W1 + W2
print("W :", W)
print()
print("W1 :", W1)

Thanks all very much!