\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{physics}
\usepackage{yquant}


\begin{document}

\section{SWAP}

\begin{tikzpicture}
	\begin{yquant}[operator/separation=5mm]
		qubit {$\ket{\psi_1}$} a;
		qubit {$\ket{\psi_2}$} b;

		swap (a, b);
	\end{yquant}
\end{tikzpicture}

\section{CNOT}

\begin{tikzpicture}
	\begin{yquant}[operator/separation=5mm]
		qubit {$\ket{\psi_1}$} a;
		qubit {$\ket{\psi_2}$} b;

		cnot b | a;
	\end{yquant}
\end{tikzpicture}

\section{CU}

\begin{tikzpicture}
	\begin{yquant}[operator/separation=5mm]
		qubit {$\ket{\psi_1}$} a;
		qubit {$\ket{\psi_2}$} b;

		box {$U$} b | a;
	\end{yquant}
\end{tikzpicture}

\end{document}
