summaryrefslogtreecommitdiff
path: root/source/know/concept/toffoli-gate/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'source/know/concept/toffoli-gate/index.md')
-rw-r--r--source/know/concept/toffoli-gate/index.md18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/know/concept/toffoli-gate/index.md b/source/know/concept/toffoli-gate/index.md
index ea546dc..7de7600 100644
--- a/source/know/concept/toffoli-gate/index.md
+++ b/source/know/concept/toffoli-gate/index.md
@@ -11,17 +11,17 @@ 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.
+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:
<a href="toffoli.png">
<img src="toffoli.png" style="width:19%">
</a>
-This gate is reversible, because $A$ and $B$ are preserved,
-and are all you need to reconstruct to $C$.
+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:
@@ -47,8 +47,8 @@ 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 the fact that $$A \lor B = \neg (\neg A \land \neg B)$$,
+i.e. OR is NAND of NOT $$A$$ and NOT $$B$$:
<a href="or.png">
<img src="or.png" style="width:50%">
@@ -57,7 +57,7 @@ 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:
+In the basis $$\Ket{A} \Ket{B} \Ket{C}$$, its matrix is:
$$\begin{aligned}
\boxed{
@@ -75,7 +75,7 @@ $$\begin{aligned}
}
\end{aligned}$$
-If we apply this gate to an arbitrary three-qubit state $\Ket{\psi}$,
+If we apply this gate to an arbitrary three-qubit state $$\Ket{\psi}$$,
it swaps the last two coefficients:
$$\begin{aligned}