\documentclass[a4paper]{article}
\pagestyle{empty}

\usepackage{tikz}

\usepackage{dynkin-diagrams}

\usetikzlibrary{quantikz}
\usepackage{yquant}
\useyquantlanguage{qasm,groups}
%\usetikzlibrary{quotes,fit,shapes.symbols,backgrounds,quantikz}

\begin{document}

\pgfkeys{/Dynkin diagram,
edge length=.75cm,
edge/.style={draw=gray,double=black, very thick}}
\begin{tikzpicture}
\foreach \d in {1,...,4}{
\node (current) at ($(\d*.05,\d*.3)$){};
\dynkin[name=\d,at=(current)]D{oo.oooo}}
\begin{pgfonlayer}{Dynkin behind}
\newcommand\df[2]{
\draw[/Dynkin diagram/fold style]
($(#1 root \i)$) -- ($(#2 root \i)$);}
\foreach \i in
{1,...,6}{\df{1}{2}\df{2}{3}\df{3}{4}}
\end{pgfonlayer}
\end{tikzpicture}

\newpage
\begin{tikzpicture}
\begin{yquant}
qubit {$\ket\psi$} a;
qubit {$\ket0$} b[2];
h b[1];
cnot b[0] | b[1];
cnot b[0] | a;
h a;
align a, b;
measure a;
[direct control]
measure b[0];
x b[1] | b[0];
z b[1] | a;
discard a;
discard b[0];
output {$\ket\psi$} b[1];
\end{yquant}
\end{tikzpicture}


\end{document}