Ask Your Question
1

How to construct a matrix space ?

asked 2022-02-07 18:10:42 +0200

IHaveNoIdea gravatar image

updated 2022-02-07 18:18:47 +0200

I know we can create a matrix space using "MatrixSpace" but I am looking to create a specific space. I tried :

M = MatrixSpace(ZZ,4)
B = M.basis()
sub = [B[0,0],B[1,3],B[2,2],B[3,1]]
SubM = M.submodule(sub)
SubM.basis()

The program show me : Finite family {0: B[0], 1: B[1], 2: B[2], 3: B[3]}

And when I take a random element of SubM( with SubM.random_element()), it tells me it isn't in M.

I thought the problem came from my generator so I tried with :

sub = [matrix(4,4,{(0,0):1}),matrix(4,4,{(1,3):1}),matrix(4,4,{(2,2):1}),matrix(4,4,{(3,1):1})]

But I have the same result. Do you know what I am doing wrong ?

I also need to do a XOR between matrix space, do you think it is possible ? How ?

Thanks you for your time :D

edit retag flag offensive close merge delete

Comments

What is "XOR between matrix space"?

Max Alekseyev gravatar imageMax Alekseyev ( 2022-02-07 20:43:52 +0200 )edit

it is not really explained but I guess that it is a matrix space which have as element the xor of elements of 2 matrix spaces.

IHaveNoIdea gravatar imageIHaveNoIdea ( 2022-02-08 18:05:40 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-02-07 20:43:10 +0200

Max Alekseyev gravatar image

To see the basis of SubM as elements of M use

[b.lift() for b in SubM.basis()]

Similarly, to get a random element of SubM lifted to M run:

SubM.random_element().lift()
edit flag offensive delete link more

Comments

Thank you for your answer ! By chance, do you know how can I "reverse" .lift() ? When I create a matrix and try to check if it is in SubM, it always return false.

IHaveNoIdea gravatar imageIHaveNoIdea ( 2022-02-08 18:08:12 +0200 )edit

I assume you need to use .retract() method. See details in the docs.

Max Alekseyev gravatar imageMax Alekseyev ( 2022-02-08 19:47:38 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-02-07 18:10:42 +0200

Seen: 21 times

Last updated: Feb 07