microsoft/qdk

Public

mirrored from https://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/multi_qubit_systems/prepare_basis_state/solution.md

12lines · modepreview

The starting state can be represented as follows:
$$ \begin{bmatrix} 1 \\\ 0 \\\ 0 \\\ 0 \end{bmatrix} = |0\rangle \otimes |0\rangle $$

The goal state can be represented as follows:
$$ \begin{bmatrix} 0 \\\ 0 \\\ 0 \\\ 1 \end{bmatrix} = |1\rangle \otimes |1\rangle $$

Applying an **X** gate to a qubit in the $|0\rangle$ state transforms the qubit state into the $|1\rangle$ state. So, if we apply the **X** gate on the first qubit and the second qubit, we get the desired state.

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