How to make the product of two linear spaces?

asked 2021-05-07 05:41:28 +0200

Ycs gravatar image

updated 2021-05-07 09:23:21 +0200

Let $F_{q^m}$ be a finite field that is the extension of degree m of a finite field $F_q$. r<m, d<m.<="" p="">

E1 is an $F_q$-linear space of dimension r of $F_{q^m}$.

E2 is an $F_q$-linear space of dimension d of $F_{q^m}$.

How to fastly obtain the product of E1 and E2?

edit retag flag offensive close merge delete

Comments

How about E1.cartesian_product(E2)?

John Palmieri gravatar imageJohn Palmieri ( 2021-05-07 19:07:21 +0200 )edit

No cartesian_product. I only know this method with poor efficiency. Do you have other efficient methods?

q = 2 ; m = 229; n = 83; r = 8; d= 7

Fqm = GF(q^m)

def gen_vec_space(t): # generate a vector space of dimension t over Fqm

B = matrix(Fqm.base_ring(),t,m,0)

while B.rank() != t:

    B = matrix(Fqm.base_ring(),[vector(Fqm.random_element()) for i in range(t)])

return B.row_space()

E = gen_vec_space(r)

F = gen_vec_space(d)

def two_spaces_product(T1, T2):

T1T2 = []

for e in T1.basis():

    for f in T2.basis():

            T1T2.append(vec_to_Fqm(e) * vec_to_Fqm(f))

ST1T2 = matrix(Fqm.base_ring(),[vector(T1T2[i]) for i in range(len(T1T2))]).row_space()

return ST1T2

EF = two_spaces_product(E,F)

Ycs gravatar imageYcs ( 2021-05-09 04:37:00 +0200 )edit

I don't understand why cartesian_product doesn't do what you want. Can you please explain?

John Palmieri gravatar imageJohn Palmieri ( 2021-05-09 20:02:22 +0200 )edit