microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
amcasey/ArrayWrap

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

katas/content/linear_algebra/tensor_product/solution.md

19lines · modepreview

$$\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \otimes \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} =
\begin{bmatrix}
    1 \cdot \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} & 2 \cdot \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} \\
    3 \cdot \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} & 4 \cdot \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}
\end{bmatrix} =$$
$$=\begin{bmatrix}
    1 \cdot 5 & 1 \cdot 6 & 2 \cdot 5 & 2 \cdot 6 \\
    1 \cdot 7 & 1 \cdot 8 & 2 \cdot 7 & 2 \cdot 8 \\
    3 \cdot 5 & 3 \cdot 6 & 4 \cdot 5 & 4 \cdot 6 \\
    3 \cdot 7 & 3 \cdot 8 & 4 \cdot 7 & 4 \cdot 8
\end{bmatrix} =
\begin{bmatrix}
    5 & 6 & 10 & 12 \\
    7 & 8 & 14 & 16 \\
    15 & 18 & 20 & 24 \\
    21 & 24 & 28 & 32
\end{bmatrix}$$

@[solution]({"id": "linear_algebra__tensor_product_solution", "codePath": "Solution.qs"})