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/normalized_vector/solution.md

9lines · modepreview

You start by calculating the norm of the vector

$$||V|| = \sqrt{\langle V , V \rangle} = \sqrt{-6 \cdot (-6) + (-8i) \cdot 8i} = \sqrt{6^2 + 8^2} = 10$$

Then the normalized vector can be obtained by dividing each element of the original vector by its norm:
 
$$\frac{V}{||V||} = \begin{bmatrix} -0.6 \\ 0.8i \end{bmatrix}$$

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