microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
katas/content/complex_arithmetic/complex_addition/index.md
17lines · modecode
| 1 | **Inputs:** |
| 2 | |
| 3 | 1. A complex number $x = a + bi$. |
| 4 | 2. A complex number $y = c + di$. |
| 5 | |
| 6 | **Goal:** |
| 7 | Return the sum of $x$ and $y$ as a complex number. |
| 8 | |
| 9 | <details> |
| 10 | <summary><b>Need a hint?</b></summary> |
| 11 | |
| 12 | Adding 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 | |
| 14 | A 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 `Std.Math` namespace adds two complex numbers. For educational purposes, try to do this task by hand. |
| 18 | |