Five-point Dirichlet Laplacian as a Kronecker sum (source code)

= Five-point Dirichlet Laplacian as a Kronecker sum

If $T$ is the one-dimensional Dirichlet second-difference matrix on $m$ interior points, the two directional parts of the two-dimensional five-point Laplacian are
$$
A_x=T\otimes I_m,
\qquad
A_y=I_m\otimes T.
$$
They commute, and $A_x+A_y$ is the Kronecker-sum discretization of the Laplacian.