Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

block_matrix

I'm having trouble making use of the block_matrix function. I can't even recreate simple examples from the block_matrix documentation, for example

sage: A = matrix(QQ, 2, 2, [3,9,6,10])
sage: X=block_matrix([ [A, -A], [~A, 100*A] ])

I receive the error "Must specify rows or cols for non-square block matrix." When I attempt to set those dimensions I continue to get errors.

(My actual application of this is a bit more complicated, but the dimensions all work out. And I have used block_matrix in another program with symbolic entries. I must have gotten lucky.)

I did not import numpy, I did not believe it was necessary. But there's no difference when I do.

Thanks in advance to this magnificent community of sage-masters.

click to hide/show revision 2
Changing the title - this was a version issue that was my mistake

block_matrixblock_matrix confusion (matrix constructor rewrite in new versions of Sage)

I'm having trouble making use of the block_matrix function. I can't even recreate simple examples from the block_matrix documentation, for example

sage: A = matrix(QQ, 2, 2, [3,9,6,10])
sage: X=block_matrix([ [A, -A], [~A, 100*A] ])

I receive the error "Must specify rows or cols for non-square block matrix." When I attempt to set those dimensions I continue to get errors.

(My actual application of this is a bit more complicated, but the dimensions all work out. And I have used block_matrix in another program with symbolic entries. I must have gotten lucky.)

I did not import numpy, I did not believe it was necessary. But there's no difference when I do.

Thanks in advance to this magnificent community of sage-masters.

Edit: I have an old version of Sage (4.4). I should have run block_matrix? to read my specific help file rather than the online documentation.

block_matrix confusion (matrix constructor rewrite in new versions of Sage)

Solved - My mistake - I was running an older version of Sage

I'm having trouble making use of the block_matrix function. I can't even recreate simple examples from the block_matrix documentation, for example

sage: A = matrix(QQ, 2, 2, [3,9,6,10])
sage: X=block_matrix([ [A, -A], [~A, 100*A] ])

I receive the error "Must specify rows or cols for non-square block matrix." When I attempt to set those dimensions I continue to get errors.

(My actual application of this is a bit more complicated, but the dimensions all work out. And I have used block_matrix in another program with symbolic entries. I must have gotten lucky.)

I did not import numpy, I did not believe it was necessary. But there's no difference when I do.

Thanks in advance to this magnificent community of sage-masters.

Edit: I have an old version of Sage (4.4). I should have run block_matrix? to read my specific help file rather than the online documentation.documentation. It's working fine, I was simply using the wrong syntax for my version.