microsoft/qdk

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.3.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

katas/content/complex_arithmetic/complex_powers_real/index.md

13lines · modecode

1**Inputs:**
2
31. A non-negative real number $r$.
42. A complex number $x = a + bi$.
5
6**Goal:** Return the complex number $r^x = r^{a + bi}$.
7
8<details>
9 <summary><b>Need a hint?</b></summary>
10 You can use the fact that $r = e^{\ln r}$ to convert exponent bases. Remember though, $\ln r$ is only defined for positive numbers - make sure to check for $r = 0$ separately!
11
12 Q# namespace `Microsoft.Quantum.Math` includes useful functions `Log()`, `Sin()`, and `Cos()`.
13</details>
14