在同一个 tikpicture 环境中绘制电路和量子电路

在同一个 tikpicture 环境中绘制电路和量子电路

我想添加一个电路符号(电容器)和quantikz仪表在相同的tikzpicture环境中,但这并没有绘制quantikz符号。我遗漏了什么?

\documentclass{article}
\usepackage{amssymb,amsfonts,dsfont}
\usepackage{tikz}
\usepackage{quantikz}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{quantikz}

\begin{document}

\begin{tikzpicture}[circuit ee IEC]

\draw (0,0) to [capacitor] (2,0);
\node at (1,-1) {capacitor};

\draw (0,-4) to |[meter]| (2,-4);
\node at (1,-5) {meter};

\end{tikzpicture}

\end{document}

答案1

meter您可以添加具有 定义的样式的节点quantikz

A

\documentclass{article}
\usepackage{amssymb,amsfonts,dsfont}

\usepackage{tikz}
\usetikzlibrary {circuits.ee.IEC} 
\usetikzlibrary{quantikz}

\begin{document}
    
    \begin{tikzpicture}[circuit ee IEC]

        \draw (0,0) to [capacitor] (2,0);
        \node at (1,1) {capacitor};
        
        \node[meter, label=below:meter] (M) at (1,-2) {};   
        \draw  (M) edge  (0,-2) (2,-2) edge (M); 

    \end{tikzpicture}

\end{document}

相关内容