我在《量子计算机》第 5 页上看到了一个表示不同复杂振幅的图这论文。这是一张图片:
如您所见,结构类似于矩阵,包含不同的线条、方程式和文本元素。我在设计此类元素方面没有太多经验,我只使用过能帮我完成这类工作的软件包。如果有人能为我指明创建此类图形的方向,我将不胜感激。也许使用表格或矩阵软件包会有所帮助?这就是我所能做到的!
答案1
虽然这绝不是一个完美的解决方案,但这是一个简单的开始。请随意尝试下面的代码,直到您获得所需的输出。
\documentclass[10pt,a4paper]{standalone}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\def\w{2}
\def\h{1}
\begin{tikzpicture}
\node (A) at (0,0) {};
\node (x1) at (\w,0) {};
\node (y1) at (\w,\h) {};
\node[label=below:$\{00\ldots00\}$] (x2) at (2*\w,0) {};
\node (y2) at (2*\w,\h) {};
\node[label=below:$\{00\ldots01\}$] (x3) at (3*\w,0) {};
\node (y3) at (3*\w,\h) {};
\node[label=below:$\cdots$] (x4) at (4*\w,0) {};
\node (y4) at (4*\w,\h) {};
\node[label=below:$x^*$] (x5) at (5*\w,0) {};
\node (y5) at (5*\w,\h) {};
\node[label=below:$\cdots$] (x6) at (6*\w,0) {};
\node (y6) at (6*\w,\h) {};
\node[label=below:$\{11\ldots11\}$] (x7) at (7*\w,0) {};
\node (y7) at (7*\w,\h) {};
\node[label=right:$0$] (x8) at (8*\w,0) {};
\node[label=right:{$\mu=\text{mean of amplitudes}$}] (y8) at (8*\w,\h) {};
\draw[thick] (x1) -- (x8);
\draw[dashed] (y1) -- (y8);
\draw [decorate,thick,decoration={brace,amplitude=4pt},xshift=-4pt,yshift=0pt]
(x1) -- (y1) node [black,midway,xshift=-0.6cm] {$\frac{1}{\sqrt{N}}$};
\draw (x2) -- (y2)
(x3) -- (y3)
(x5) -- (y5)
(x7) -- (y7);
\end{tikzpicture}
\end{document}
答案2
非常类似于N3buchadnezzar 的回答但采用一些方法可以避免重复明确的坐标。
\documentclass[tikz,border=3mm]{standalone}
\usepackage{amsmath}
\usetikzlibrary{decorations.pathreplacing, calligraphy}
\begin{document}
\begin{tikzpicture}
\draw[dashed] (0,1.5) coordinate (tl) -- ++ (8.5,0) coordinate (tr)
node[right] {$\mu=\text{mean of amplitudes}$};
\draw
(0,0) coordinate (bl) -- (tr|-bl) node[right] {$0$}
[nodes={alias=last,below,text height=2ex,append after command={-- (tl-|last)}}]
(1,0) node{$\{00\dots00\}$}
(2.75,0) node{$\{00\dots01\}$}
(5,0) node{$x^*$}
(7.25,0) node{$\{11\dots11\}$};
\draw[thick,decorate,decoration={calligraphic brace,raise=0.4ex}] (bl) --
node[left=0.8ex]{$\dfrac{1}{\sqrt{N}}$}(tl);
\end{tikzpicture}
\end{document}
答案3
解决方案如下 pstricks
:
\documentclass[border = 6pt]{standalone}
\usepackage{pst-node, pstricks-add}
\usepackage{multido}
\begin{document}
\begin{pspicture}(-0.5,-0.5)(15.2,1.5)\footnotesize
\pnodes{A}(0,1.2)(1,1.2)(3,1.2)(7,1.2)(11,1.2)(12,1.2)
\pnodes{B}(0,0)(1,0)(3,0)(7,0)(11,0)(12,0)
\pcline[linewidth=0.5pt, linestyle=dashed, dash=4pt 2pt, nodesep=1pt](A0)(A5)
\pcline[nodesep=2pt](B0)(B5)
\multido{\i=1+1}{4}{\psline(A\i)(B\i)}
\uput[d](B1){$\{00\dots00\}$}\uput[d](B2){$\{00\dots01\}$}\uput[d](B3){$x^*$}\uput[d](B4){$\{11\dots11\}$}
\uput{2ex}[d](5,0){$\dots$}\uput{2ex}[d](9,0){$\dots$}
\uput[r](A5){$\mu=$ mean of amplitudes}\uput[r](B5){$0$}
\psbrace[singleline, linewidth=0.5pt, braceWidthInner=2pt, braceWidthOuter=2pt, nodesepA=-14pt, nodesepB=7pt](A0)(B0){$\frac{1}{\sqrt{N}}$}
\end{pspicture}
\end{document}