From e7cc5b84d54e907c3ad723f0a4c3f2b84a952368 Mon Sep 17 00:00:00 2001 From: micahkepe Date: Wed, 19 Feb 2025 20:47:26 -0600 Subject: [PATCH] fix(diagrams): missing circuit diagrams for lecture 7 --- lectures/phase-i/lecture7.tex | 62 ++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/lectures/phase-i/lecture7.tex b/lectures/phase-i/lecture7.tex index 23143ff..8062387 100644 --- a/lectures/phase-i/lecture7.tex +++ b/lectures/phase-i/lecture7.tex @@ -58,8 +58,7 @@ \subsection*{Review Questions} \subsection*{More Multi-Qubit Gates} -\subsubsection*{More 2-Qubit Gates} - +\subsubsection*{$CX(q_0 \rightarrow q_1)$ Gate} \index{quantum gates!multi-qubit gates!CNOT with swapped target and control} \dfn{$CX(q_0 \rightarrow q_1)$ Gate}{ @@ -194,9 +193,10 @@ \subsubsection*{Derivation of the $CX(q_0 \rightarrow q_1)$ Gate} This matrix corresponds to the CNOT gate with the control and target qubits swapped. +\vspace{0.3cm} \index{quantum gates!multi-qubit gates!SWAP gate} -\subsection*{SWAP Gate} +\subsubsection*{SWAP Gate} \dfn{SWAP Gate}{ The SWAP gate exchanges the states of two qubits. Its matrix representation @@ -218,25 +218,38 @@ \subsection*{SWAP Gate} \] } - \paragraph{Effects of SWAP Gate}\label{par:Effects of SWAP Gate} The SWAP gate interchanges the states of two qubits. For any 2-qubit computational basis state, its action is: \nt{ \[ - \begin{aligned} - SWAP\,\ket{00} &= \ket{00}, \\ - SWAP\,\ket{01} &= \ket{10}, \\ - SWAP\,\ket{10} &= \ket{01}, \\ - SWAP\,\ket{11} &= \ket{11}. - \end{aligned} + \text{SWAP} \ket{00} = \ket{00}, \quad + \text{SWAP} \ket{01} = \ket{10}, \quad + \text{SWAP} \ket{10} = \ket{01}, \quad + \text{SWAP} \ket{11} = \ket{11} \] } Thus, for any superposition of 2-qubit states, the SWAP gate exchanges the amplitudes corresponding to each qubit's position. +\index{Circuit notation!multi-qubit gates} +\subsubsection*{Circuit Representations} + +The standard circuit representations for these 2-qubit gates are: + +\begin{align*} + \begin{quantikz} + % Flipped CNOT + \lstick{$CNOT_{\text{target, control}}$:} & \gate{X} & \qw \\ + & \ctrl{-1} & \qw \\[0.5cm] + % SWAP + \lstick{SWAP:} & \swap{1} & \qw \\ + & \swap{0} & \qw \\[0.5cm] + \end{quantikz} +\end{align*} + \index{quantum gates!$n$-qubit gates} \subsection*{$n$-Qubit Gates} @@ -245,7 +258,7 @@ \subsection*{$n$-Qubit Gates} it extends to $n$-qubits. \index{quantum gates!multi-qubit gates!Toffoli gate} -\subsection*{Toffoli Gate} +\subsubsection*{Toffoli Gate} \dfn{Toffoli Gate}{(CCX) is a three-qubit gate with two control qubits and one target qubit. Its matrix representation is: @@ -267,6 +280,20 @@ \subsection*{Toffoli Gate} qubits are in state $\ket{1}$. } +\index{Circuit notation!multi-qubit gates} +\subsubsection*{Circuit Representation} + +The standard circuit representation for the Toffoli/ $CCX$ gate is as follows: + +\begin{align*} + \begin{quantikz} + % Toffoli + \lstick{CCX:} & \ctrl{1} & \qw \\ + & \ctrl{1} & \qw \\ + & \gate{X} & \qw + \end{quantikz} +\end{align*} + \paragraph{Effects of Toffoli Gate}\label{par:Effects of Toffoli Gate} The Toffoli (CCX) gate acts on a 3-qubit system, where the first two qubits @@ -276,14 +303,10 @@ \subsection*{Toffoli Gate} \nt{ \[ \begin{aligned} - \text{Toffoli}\,\ket{000} &= \ket{000}, \\ - \text{Toffoli}\,\ket{001} &= \ket{001}, \\ - \text{Toffoli}\,\ket{010} &= \ket{010}, \\ - \text{Toffoli}\,\ket{011} &= \ket{011}, \\ - \text{Toffoli}\,\ket{100} &= \ket{100}, \\ - \text{Toffoli}\,\ket{101} &= \ket{101}, \\ - \text{Toffoli}\,\ket{110} &= \ket{111}, \\ - \text{Toffoli}\,\ket{111} &= \ket{110}. + \text{Toffoli}\,\ket{000} &= \ket{000} \quad & \text{Toffoli}\,\ket{100} &= \ket{100} \\ + \text{Toffoli}\,\ket{001} &= \ket{001} \quad & \text{Toffoli}\,\ket{101} &= \ket{101} \\ + \text{Toffoli}\,\ket{010} &= \ket{010} \quad & \text{Toffoli}\,\ket{110} &= \ket{111} \\ + \text{Toffoli}\,\ket{011} &= \ket{011} \quad & \text{Toffoli}\,\ket{111} &= \ket{110} \end{aligned} \] } @@ -291,6 +314,7 @@ \subsection*{Toffoli Gate} In essence, the target qubit is flipped only when both control qubits are in the \(\ket{1}\) state; otherwise, the state remains unchanged. + As you would expect, multi-controlled $X$ gates are Hermitian. \ex{Quantum Circuit Showing Hermitian Property}{