补充一句:这种图专业称为 量子线路(Quantum Circuit),其实有更加专业的宏包处理这种图,见 TSE 上的回答
具体实操本人暂不做了,因为电脑最近送修了 :-)
请问这种图怎么画出来
建议看一下tikz
宏包,其中的入门内容可以比较方便地画出上图的大致轮廓。
本论坛「应该」不是一个「do-this-for-me」的平台,请尽量阅读上面的文档,使用「编辑问题」功能给一份你的尝试的代码。这样既有利于自己的能力提高,也能让论坛的uu能更有针对性地帮到你。
效果也许是这样,但「在你给出你的尝试之后我再贴代码叭😀」
\documentclass[tikz,border=1cm]{standalone}
\usepackage{physics2}
\usephysicsmodule{ab.braket}
\begin{document}
\begin{tikzpicture}
\draw (0,.5)
node[rectangle,anchor=east] {Meter}
edge node[above] {$\rho$}
++(1,0) -- ++(5,0);%
\draw (0,-.5)
node[rectangle,anchor=east] {System}
edge node[below] {$\ket|\Phi>$}
++(1,0) -- ++(5,0);%
\node[draw,thick,fill=white,rectangle,minimum size=1.75cm,font=\Huge] at (2,0) {$\hat{u}$};
\draw (4,.5)
node[circle,fill,inner sep=1pt] {} -- (4,-.5)
node[draw,thick,fill=white,rectangle,minimum size=.5cm] {}
node[below=.25cm] {$\Big\{\ket|\Phi>,\ket|\Phi^\perp>\Big\}$};
\end{tikzpicture}
\end{document}
不好意思呀 我画的不太好,这是我的代码
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning, decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[
node distance=1cm,
textbox/.style={draw, minimum size=0.7cm},
line/.style={thick},
brace/.style={decorate, decoration={brace, amplitude=5pt, mirror}, thick}
]
% 左侧 Meter 和 System
\node (meterText) {Meter};
\node[draw, minimum width=1.5cm, minimum height=0.3cm, below=0.1cm of meterText] (meterLine) {};
\node[right=1.5cm of meterText] (systemText) {System};
\node[draw, minimum width=1.5cm, minimum height=0.3cm, below=0.1cm of systemText] (systemLine) {};
% 连接线
\draw[line] (meterLine) -- (systemLine);
% 操作符 û
\node[textbox, right=0.5cm of systemText] (u) {$\hat{u}$};
\draw[line] (systemLine) -- (u.west);
% 右侧分支点
\coordinate[right=1.2cm of u] (branchPoint);
\draw[line] (u) -- (branchPoint);
% 分支路径
\node[above right=0.5cm and 0.8cm of branchPoint] (P) {P};
\node[below right=0.5cm and 0.8cm of branchPoint] (phi) {$|\phi\rangle$};
\draw[line] (branchPoint) -- (P.west);
\draw[line] (branchPoint) -- (phi.west);
% 花括号
\node[right=0.1cm of P] (Pbrace) {};
\node[right=0.1cm of phi] (phiBrace) {};
\draw[brace] ([yshift=0.2cm] Pbrace.center) -- node[midway, right=0.2cm] {} ([yshift=-0.2cm] phiBrace.center);
\end{tikzpicture}
\end{document}
@u90186 感谢补充代码!我已经把我的尝试放到了原答案中,思路供参考。一些符号的细节我看不清也不太懂这个学科,可能需要你自行微调。
@u90186 别光明白啊,上面的「评论」中的代码没有正确被「高亮」,请使用「编辑」功能修改!
我的macbook pro plus ultra max turbo /(ㄒoㄒ)/~~
@u79794 对于我这种看文档能力差且是文科专业的人来说并没有多省事...
不过必须承认,确实是「更加专业」,但对我来说不一定更加「usr-friendly」泪
希望S老师抽空给点意见...