请问这种图怎么画出来
建议看一下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}[
]
% 左侧 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
我看你的代码已经很专业了哈哈,都是互相交流学习而已,没有什么好坏之分😀~
感谢感谢 已经学到了很多
@u90186 请你「编辑」修改你的「评论」中的代码块(改为三个反引号的围栏代码块形式),下面这样的代码渲染会丢失「
\
」,谢谢。唉唉
markdown
@u90186
请正确使用
markdown
让AI帮忙加上的
\
,哎哎,感觉哪里很不对的样子....