People who know linear algebra: if I said "make a block diagonal from these matrices", would you know what I meant?
And is there a term for when you put one matrix on top of another?

· · Web · · ·

@christianp I think the term for putting one matrix on top of another is "stacking". At least in sagemath, you can do that via M1.stack(M2), just like you can put M1 and M2 next to each other using M1.augment(M2)

@asvhl great, thanks!

@christianp Sure! If
$A=\begin{bmatrix}1&2\\3&4\end{bmatrix}$
and
$B=\begin{bmatrix}5&6\\7&8\end{bmatrix},$
then I'd interpret that to mean
$\text{diag}(A, B)=\begin{bmatrix}1&2&0&0\\3&4&0&0\\0&0&5&6\\0&0&7&8\end{bmatrix}.$

The notations $$(A|B)$$, $$[A|B]$$, or $$\begin{bmatrix}A&B\end{bmatrix}$$ would read as an augmented matrix to me. I don't know of a better way to write concatenating rows other than
$\begin{bmatrix}A\\B\end{bmatrix},$
unfortunately!

@christianp I agree with the other responses, but if you said "augmented matrix" to refer to [A B] I would experience some mild dissonance because normally an augmented matrix has b as a column vector. "Stacking" is totally clear for vertical concatenation, but no concise term for the horizontal counterpart comes to mind (Numpy uses hstack and vstack, but Matlab uses horzcat and vertcat).

@narain interesting! In her coding theory notes, my colleagues talks about the augmented matrix $$A|I_n$$ made by putting $$I_n$$ next to some $$n \times n$$ matrix $$A$$.
So that wouldn't be the kind of augmented matrix you're used to?

@christianp Oh right, I'd forgotten about that one. Wikipedia and Mathworld permit arbitrary A and B too. I stand corrected.

@christianp "block diagonal" has a clear meaning to me. I recall from undergrad using "augmented matrix" to mean something like (A|b) when you're trying to solve Ax=b by Gaussian elimination. I guess that generalises naturally to sticking a whole matrix on the right (e.g. when calculating an inverse by the elimination method) by I don't think it's a standard term.

@christianp Yes, I would know what you mean. If your matrices are square matrices you are in the category of matrix algebras and what you are doing is the direct sum of the matrices. So I’d call it that.

@maralorn nice, thanks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!