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_addition/index.md

17lines · modecode

1**Inputs:**
2
31. A complex number $x = a + bi$.
42. A complex number $y = c + di$.
5
6**Goal:**
7Return the sum of $x$ and $y$ as a complex number.
8
9<details>
10 <summary><b>Need a hint?</b></summary>
11
12Adding complex numbers is just like adding polynomials. Add components of the same type - add the real part to the real part, add the imaginary part to the imaginary part.
13
14A video explanation of adding complex numbers can be found [here](https://www.youtube.com/watch?v=SfbjqVyQljk).
15</details>
16
17> Q# function `PlusC` from `Microsoft.Quantum.Math` namespace adds two complex numbers. For educational purposes, try to do this task by hand.
18