answered 8 years ago
var('a b c d e f g') A = matrix(2,2,[a,b,b,e]) C = matrix(2,2,[c,d,f,g]) B = block_matrix(2,2, [A,C,C.transpose(),A]) M = matrix(SR,10,10) for k in range(4): M.set_block(2*k,2*k,B) M