Building Block Matrices

Block matrices can be constructed either by listing the blocks, or by joining together smaller matrices horizontally, vertically or diagonally.

BlockMatrix(m, n, blocks) : RngIntElt, RngIntElt, [ Mtrx ] -> Mtrx
The matrix constructed from the given block matrices, which should all have the same dimensions, and should be given as a sequence of m.n block matrices (given in row major order, in other words listed across rows).
BlockMatrix(m, n, rows) : RngIntElt, RngIntElt, [ [ Mtrx ] ] -> Mtrx
BlockMatrix(rows) : [ [ Mtrx ] ] -> Mtrx
The matrix constructed from the given block matrices, which should all have the same dimensions, and should be given as a sequence of m rows, each containing n block matrices.
HorizontalJoin(X, Y) : Mtrx, Mtrx -> Mtrx
Given a matrix X with r rows and c columns, and a matrix Y with r rows and d columns, both over the same coefficient ring R, return the matrix over R with r rows and (c + d) columns obtained by joining X and Y horizontally (placing Y to the right of X).
HorizontalJoin(Q) : [ Mtrx ] -> Mtrx
HorizontalJoin(T) : < Mtrx > -> Mtrx
Given a sequence Q or tuple T of matrices, each having the same number of rows and being over the same coefficient ring R, return the matrix over R obtained by joining the elements of Q or T horizontally in order.
VerticalJoin(X, Y) : Mtrx, Mtrx -> Mtrx
Given a matrix X with r rows and c columns, and a matrix Y with s rows and c columns, both over the same coefficient ring R, return the matrix with (r + s) rows and c columns over R obtained by joining X and Y vertically (placing Y underneath X).
VerticalJoin(Q) : [ Mtrx ] -> Mtrx
VerticalJoin(T) : < Mtrx > -> Mtrx
Given a sequence Q or tuple T of matrices, each having the same number of columns and being over the same coefficient ring R, return the matrix over R obtained by joining the elements of Q or T vertically in order.
DiagonalJoin(X, Y) : Mtrx, Mtrx -> Mtrx
Given matrices X with a rows and b columns and Y with c rows and d columns, both over the same coefficient ring R, return the matrix with (a + c) rows and (b + d) columns over R obtained by joining X and Y diagonally (placing Y diagonally to the right of and underneath X, with zero blocks above and below the diagonal).
DiagonalJoin(Q) : [ Mtrx ] -> Mtrx
DiagonalJoin(T) : < Mtrx > -> Mtrx
Given a sequence Q or tuple T of matrices, each being over the same coefficient ring R, return the matrix over R obtained by joining the elements of Q or T diagonally in order.
KroneckerProduct(A, B) : Mtrx, Mtrx -> Mtrx
Given an m x n matrix A and a p x q matrix B, both over a ring R, return the Kronecker product of A and B, which is the mp x nq matrix C over R such that the ((i - 1)p + r, (j - 1)q + s)-th entry of C is the (i, j)-th entry of A times the (r, s)-th entry of B, for 1≤i≤m, 1≤j≤n, 1≤r≤p and 1≤s≤q.
V2.28, 13 July 2023