答案1
使用\wireoverride{n}
。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{quantikz2}
\begin{document}
\begin{quantikz}
a &\wireoverride{n}b & \wireoverride{n}c & \wireoverride{n}d & \wireoverride{n}e \\
& \gate{X} & \ctrl{1} & & \\
& & \targ{}\wire[u]{q} & \gate{Z}&\\
& & \gate{X} & &
\end{quantikz}
\end{document}