如何使用 qcircuit 绘制接地符号

如何使用 qcircuit 绘制接地符号

我想知道如何添加地面符号在此处输入图片描述到我的 qcircuit 而不是下面的垃圾。在此处输入图片描述 当我搜索时,它会向我展示如何在 tikz 电路中执行此操作。

答案1

Qcircuit 不提供接地符号,因为这不是量子电路图的标准组件。如果您有接地符号,您可以将其放入量子电路的相应条目中。

如果您没有地面符号,您可以制作一个并将其放入,如下所示:

\documentclass{standalone}
\usepackage[braket]{qcircuit}
\usepackage{pgf}
\newcommand{\ground}{
\begin{pgfpicture}{0cm}{0cm}{.5cm}{-.35cm}
\pgfline{\pgfxy(.25,.05)}{\pgfxy(.25,-.25)}
\pgfline{\pgfxy(.05,-.25)}{\pgfxy(.45,-.25)}
\pgfline{\pgfxy(.1,-.3)}{\pgfxy(.4,-.3)}
\pgfline{\pgfxy(.15,-.35)}{\pgfxy(.35,-.35)}
\end{pgfpicture}
}
\begin{document}
\hspace{1.5em}
\begin{tabular}{c}
\vspace{-.6em}\\
     \Qcircuit @C=0.5cm @R=.5cm {
         \lstick{\ket{0}} & \gate{U} & \ground \qw \\
     }
\vspace{1.em}\hspace{1em}
\\
\end{tabular}
\end{document}

最终输出结果如下:

Qcircuit接地

相关内容