microsoft/qdk

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
billt/revert-mimalloc

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 · modepreview

**Inputs:**

1. A complex number $x = a + bi$.
2. A complex number $y = c + di$.

**Goal:**
Return the sum of $x$ and $y$ as a complex number.

<details>
  <summary><b>Need a hint?</b></summary>
  
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.

A video explanation of adding complex numbers can be found [here](https://www.youtube.com/watch?v=SfbjqVyQljk).
</details>

> Q# function `PlusC` from `Microsoft.Quantum.Math` namespace adds two complex numbers. For educational purposes, try to do this task by hand.