Following the definition, the sum of two matrices is a matrix of element-wise sums of matrix elements:
$$\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = $$
$$= \begin{bmatrix} 1 + 5 & 2 + 6 \\ 3 + 7 & 4 + 8 \end{bmatrix} = \begin{bmatrix} 6 & 8 \\ 10 & 12 \end{bmatrix}$$
@[solution]({"id": "linear_algebra__addition_solution", "codePath": "Solution.qs"})microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
katas/content/linear_algebra/addition/solution.md
6lines · modepreview