一开始,它可以从“n”个输入和相同数量的输出开始,但无法生成输出行。我现在实际上非常确定这些代码的细节,这就是为什么无法增加输入数量的原因。我尝试在上面画图(见图),但圆圈不是必须的。如果可能的话,我想在错误框下写上“环境”。提前致谢。
\documentclass[10pt,letterpaper,twocolumn,aps,pra, superscriptaddress,longbibliography]{revtex4-2}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{braket}
\usepackage{circuitikz}
\usepackage{tikz}
\usetikzlibrary{quantikz}
\usepackage[export]{adjustbox}
\usepackage{subcaption,graphicx}
\captionsetup{
subrefformat=parens
}
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
\makeatletter
\renewcommand\frontmatter@abstractwidth{\dimexpr\textwidth\relax}
\makeatother
\begin{document}
\begin{figure}[h]
\centering
\begin{quantikz}
& \gate[wires=3][1.5cm]{encode}
\gateoutput[wires=1]{} & \gate[wires=3][1.5cm]{errors} & \gate[wires=3][1.5cm]{recovery} & \gate[wires=3][1.5cm]{decode}\\
&\gateinput{} & & &\qw \\
&\gateoutput{}& & &\qw \\
\end{quantikz}
\caption{The journey of quantum data.}
\end{figure}
\end{document}
答案1
对于右侧的箭头,您可以将其添加\arrow[thick, r] &
到每一行。您需要将其&
作为额外的列,以便箭头可以指向某个位置。
\documentclass[10pt]{article}
\usepackage{tikz}
\usetikzlibrary{quantikz}
\begin{document}
\begin{figure}[h]
\centering
\begin{quantikz}
& \gate[wires=3][1.5cm]{encode}
\gateoutput[wires=1]{} & \gate[wires=3][1.5cm]{errors} & \gate[wires=3][1.5cm]{recovery} & \gate[wires=3][1.5cm]{decode}\arrow[thick, r] & \\
&\gateinput{} & & &\qw\arrow[thick, r] & \\
&\gateoutput{}& & &\qw\arrow[thick, r] & \\
\end{quantikz}
\caption{The journey of quantum data.}
\end{figure}
\end{document}
您可能考虑只使用基本的 Ti钾Z 满足您的其他要求:
\documentclass[10pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
[thick, mybox/.style={fill=white, draw, minimum height=2cm, pos=#1, font=\itshape}, minimum width=15mm]
\draw[{Circle[open]}->](0,.7)--(8,.7);
\draw[{Circle[open]}->](0,-.7)--(8,-.7);
\draw[{Circle[open]}->](0,0)--node[mybox=.14]{encode}node[mybox=.38](errors){errors}node[mybox=.62]{recovery}node[mybox=.86]{decode}(8,0);
\node[below] at (errors.south){environment};
\end{tikzpicture}
\caption{The journey of quantum data.}
\end{figure}
答案2
非常感谢你的帮助。当然,我把它们画成箭头的样子,它们也应该是圆形的 :) 但多亏了你,我才修好了它 :)
\begin{figure}
\centering
\begin{tikzpicture}
[thick, mybox/.style={fill=white, draw, minimum height=2cm, pos=#1, font=\itshape}, minimum width=15mm]
\draw[{Circle[open]}-{Circle[open]}](0,.7)--(8,.7);
\draw[{Circle[open]}-{Circle[open]}](0,-.7)--(8,-.7);
\draw[{Circle[open]}-{Circle[open]}](0,0)--node[mybox=.14]{encode}node[mybox=.38](errors){errors}node[mybox=.62]{recovery}node[mybox=.86]{decode}(8,0);
\node[below] at (errors.south){environment};
\end{tikzpicture}
\caption{The journey of quantum data.}
\end{figure}