From 6ce0bb9a8f9fd7d169cbb414a9537d68c5290aae Mon Sep 17 00:00:00 2001
From: Prefetch
Date: Fri, 14 Oct 2022 23:25:28 +0200
Subject: Initial commit after migration from Hugo
---
source/know/concept/toffoli-gate/and.png | Bin 0 -> 3137 bytes
source/know/concept/toffoli-gate/index.md | 94 +++++++++++++++++++++++++++
source/know/concept/toffoli-gate/nand.png | Bin 0 -> 3227 bytes
source/know/concept/toffoli-gate/not.png | Bin 0 -> 2425 bytes
source/know/concept/toffoli-gate/or.png | Bin 0 -> 7243 bytes
source/know/concept/toffoli-gate/toffoli.png | Bin 0 -> 1486 bytes
source/know/concept/toffoli-gate/xor.png | Bin 0 -> 3050 bytes
7 files changed, 94 insertions(+)
create mode 100644 source/know/concept/toffoli-gate/and.png
create mode 100644 source/know/concept/toffoli-gate/index.md
create mode 100644 source/know/concept/toffoli-gate/nand.png
create mode 100644 source/know/concept/toffoli-gate/not.png
create mode 100644 source/know/concept/toffoli-gate/or.png
create mode 100644 source/know/concept/toffoli-gate/toffoli.png
create mode 100644 source/know/concept/toffoli-gate/xor.png
(limited to 'source/know/concept/toffoli-gate')
diff --git a/source/know/concept/toffoli-gate/and.png b/source/know/concept/toffoli-gate/and.png
new file mode 100644
index 0000000..2a25dc8
Binary files /dev/null and b/source/know/concept/toffoli-gate/and.png differ
diff --git a/source/know/concept/toffoli-gate/index.md b/source/know/concept/toffoli-gate/index.md
new file mode 100644
index 0000000..590a954
--- /dev/null
+++ b/source/know/concept/toffoli-gate/index.md
@@ -0,0 +1,94 @@
+---
+title: "Toffoli gate"
+date: 2021-04-09
+categories:
+- Quantum information
+layout: "concept"
+---
+
+The **Toffoli gate** or **controlled-controlled-NOT (CCNOT) gate**
+is a logic gate that is *reversible* (no information is lost)
+and *universal* (all reversible logic circuits can be built using Toffoli gates).
+
+It takes three input bits $A$, $B$ and $C$,
+of which it returns $A$ and $B$ unchanged,
+and flips $C$ if both $A$ and $B$ are true.
+In circuit diagrams, its representation is:
+
+
+
+
+
+This gate is reversible, because $A$ and $B$ are preserved,
+and are all you need to reconstruct to $C$.
+Moreover, this gate is universal,
+because we can make a NAND gate from it:
+
+
+
+
+
+A NAND is enough to implement every conceivable circuit.
+That said, we can efficiently implement NOT, AND, and XOR using a single Toffoli gate too.
+Note that NOT is a special case of NAND:
+
+
+
+
+
+
+
+
+
+
+
+
+
+Using these, we can, as an example, make an OR gate
+from three Toffoli gates,
+thanks to the fact that $A \lor B = \neg (\neg A \land \neg B)$,
+i.e. OR is NAND of NOT $A$ and NOT $B$:
+
+
+
+
+
+Thanks to its reversibility and universality,
+the Toffoli gate is interesting for quantum computing.
+Its [quantum gate](/know/concept/quantum-gate/) form is often called **CCNOT**.
+In the basis $\Ket{A} \Ket{B} \Ket{C}$, its matrix is:
+
+$$\begin{aligned}
+ \boxed{
+ \mathrm{CCNOT} =
+ \begin{bmatrix}
+ 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
+ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
+ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
+ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
+ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
+ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
+ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
+ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0
+ \end{bmatrix}
+ }
+\end{aligned}$$
+
+If we apply this gate to an arbitrary three-qubit state $\Ket{\psi}$,
+it swaps the last two coefficients:
+
+$$\begin{aligned}
+ \mathrm{CCNOT} \Ket{\psi}
+ &= \mathrm{CCNOT} \big( c_{000} \Ket{000} + c_{001} \Ket{001} + c_{010} \Ket{010} + c_{011} \Ket{011} \\
+ &\qquad\qquad\quad\:\; c_{100} \Ket{100} + c_{101} \Ket{101} + c_{110} \Ket{110} + c_{111} \Ket{111} \big)
+ \\
+ &= c_{000} \Ket{000} + c_{001} \Ket{001} + c_{010} \Ket{010} + c_{011} \Ket{011} \\
+ &\quad\,\, c_{100} \Ket{100} + c_{101} \Ket{101} + c_{111} \Ket{110} + c_{110} \Ket{111}
+\end{aligned}$$
+
+
+
+## References
+1. J.S. Neergaard-Nielsen,
+ *Quantum information: lectures notes*,
+ 2021, unpublished.
diff --git a/source/know/concept/toffoli-gate/nand.png b/source/know/concept/toffoli-gate/nand.png
new file mode 100644
index 0000000..e9a10ca
Binary files /dev/null and b/source/know/concept/toffoli-gate/nand.png differ
diff --git a/source/know/concept/toffoli-gate/not.png b/source/know/concept/toffoli-gate/not.png
new file mode 100644
index 0000000..5e33f3f
Binary files /dev/null and b/source/know/concept/toffoli-gate/not.png differ
diff --git a/source/know/concept/toffoli-gate/or.png b/source/know/concept/toffoli-gate/or.png
new file mode 100644
index 0000000..147fc00
Binary files /dev/null and b/source/know/concept/toffoli-gate/or.png differ
diff --git a/source/know/concept/toffoli-gate/toffoli.png b/source/know/concept/toffoli-gate/toffoli.png
new file mode 100644
index 0000000..c9ba923
Binary files /dev/null and b/source/know/concept/toffoli-gate/toffoli.png differ
diff --git a/source/know/concept/toffoli-gate/xor.png b/source/know/concept/toffoli-gate/xor.png
new file mode 100644
index 0000000..8295466
Binary files /dev/null and b/source/know/concept/toffoli-gate/xor.png differ
--
cgit v1.2.3