Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Update note quantum30/Quantum Logic Gates.md
Browse files Browse the repository at this point in the history
  • Loading branch information
opheliagame committed Feb 12, 2024
1 parent 481038b commit 668969e
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/site/notes/quantum30/Quantum Logic Gates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
{"dg-publish":true,"permalink":"/quantum30/quantum-logic-gates/"}
---

## Not gate / X gate

$$
{NOT|0\rangle = |1\rangle}
$$
$$
{NOT|1\rangle = |0\rangle}
$$
$$
{NOT( a|0\rangle + b|1\rangle ) = b|0\rangle + a|1\rangle}
$$
$$
{X} =\begin{bmatrix} 0 & 1 \\ 1 & 0\end{bmatrix}
$$

## Hadamard gate / H gate

by expanding the range of states that we can access, beyond what is possible on a classical computer, it becomes possible to take shortcuts in our computation

$$
H|0\rangle = \dfrac{|0\rangle + |1\rangle}{\sqrt2}
$$
$$
H|1\rangle = \dfrac{|0\rangle - |1\rangle}{\sqrt2}
$$
$$
H(\alpha|0\rangle + \beta|1\rangle) = \alpha(\dfrac{|0\rangle + |1\rangle}{\sqrt2}) + \beta(\dfrac{|0\rangle - |1\rangle}{\sqrt2})
= \dfrac{\alpha + \beta}{\sqrt2}|0\rangle + \dfrac{\alpha - \beta}{\sqrt2}|1\rangle
$$
$$
{H} = \dfrac{1}{\sqrt2}\begin{bmatrix} 1 & 1 \\ 1 & -1\end{bmatrix}
$$

### cancellation of $|1\rangle$ and reinforcement of $|0\rangle$
$$
\begin{aligned}
&H(H|0\rangle) = H(\dfrac{|0\rangle + |1\rangle}{\sqrt2}) \\
& = \dfrac{1}{\sqrt2}(\dfrac{|0\rangle + |1\rangle}{\sqrt2}) + \dfrac{1}{\sqrt2}(\dfrac{|0\rangle - |1\rangle}{\sqrt2}) \\
& = \dfrac{1}{\sqrt2}(\dfrac{|0\rangle}{\sqrt2} + \dfrac{|0\rangle}{\sqrt2}) \\
& = |0\rangle
\end{aligned}
$$

0 comments on commit 668969e

Please sign in to comment.