Ask Your Question
0

How do I get the result of right_kernel into a matrix?

asked 2019-03-29 02:00:40 +0100

caucher gravatar image

updated 2024-08-26 11:21:50 +0100

FrédéricC gravatar image

Hello, I have a simple program I am running where I define a matrix C, then define

B=C.right_kernel()

I would then like to create another matrix, D, that is a block matrix with C and B as blocks, C on top of B. So far my code for that is

Dlist = []

for i in range(len(rowsofmatrix)):

Dlist.append(C[i,:])

for i in range(20-len(rowsofmatrix)):

Dlist.append(B[i,:])

where rowsofmatrix is a list I used to define the matrix C. The Dlist.append(C[I,:]) works just fine, but the second one involving B does not, and I imagine this has something to do with the form of B. Is there a way I can express B as a regular matrix? Or, alternatively, is there a better way to do this altogether?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-03-29 10:11:33 +0100

rburing gravatar image

Yes, you can do this:

sage: B = C.right_kernel().matrix()
sage: D = block_matrix([[C],[B]], subdivide=True)
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2019-03-29 02:00:40 +0100

Seen: 837 times

Last updated: Mar 29 '19