mirror of https://github.com/openqasm/openqasm.git
251 lines
16 KiB
TeX
251 lines
16 KiB
TeX
\documentclass{standalone}
|
|
\usepackage{tikz}
|
|
\usetikzlibrary{decorations.pathreplacing,decorations.pathmorphing}
|
|
\usetikzlibrary{fit,quotes}
|
|
\usepackage{yquant, braket}
|
|
|
|
\begin{document}
|
|
|
|
%! \usetikzlibrary{decorations.pathreplacing,decorations.pathmorphing}
|
|
%\begin{tikzpicture}[scale=1.000000,x=1pt,y=1pt]
|
|
\begin{tikzpicture}[scale=0.800000,x=1pt,y=1pt]
|
|
\filldraw[color=white] (0.000000, -7.500000) rectangle (582.000000, 112.500000);
|
|
% Drawing wires
|
|
% Line 2: q0 W q[0]\ket{0}
|
|
\draw[color=black] (0.000000,105.000000) -- (60.000000,105.000000);
|
|
%\draw[color=black] (60.000000,104.500000) -- (573.000000,104.500000);
|
|
\draw[color=black] (60.000000,105.00000) -- (573.000000,105.00000);
|
|
\draw[color=black] (0.000000,105.000000) node[left] {$q[0]\ket{0}$};
|
|
% Line 3: q1 W q[1]\ket{0}
|
|
\draw[color=black] (0.000000,90.000000) -- (170.000000,90.000000);
|
|
%\draw[color=black] (170.000000,89.500000) -- (573.000000,89.500000);
|
|
\draw[color=black] (170.000000,90.00000) -- (573.000000,90.00000);
|
|
\draw[color=black] (0.000000,90.000000) node[left] {$q[1]\ket{0}$};
|
|
% Line 4: q2 W a[2]\ket{0}
|
|
\draw[color=black] (0.000000,75.000000) -- (330.000000,75.000000);
|
|
%\draw[color=black] (330.000000,74.500000) -- (573.000000,74.500000);
|
|
\draw[color=black] (330.000000,75.00000) -- (573.000000,75.00000);
|
|
\draw[color=black] (0.000000,75.000000) node[left] {$a[2]\ket{0}$};
|
|
% Line 5: q3 W q[3]\ket{0}
|
|
\draw[color=black] (0.000000,60.000000) -- (552.000000,60.000000);
|
|
%\draw[color=black] (552.000000,59.500000) -- (573.000000,59.500000);
|
|
\draw[color=black] (552.000000,60.00000) -- (573.000000,60.00000);
|
|
\draw[color=black] (0.000000,60.000000) node[left] {$q[3]\ket{0}$};
|
|
% Line 6: c00 W c0[0]\-0
|
|
\draw[color=black] (0.000000,45.000000) -- (573.000000,45.000000);
|
|
\draw[color=black] (0.000000,44.000000) -- (573.000000,44.000000);
|
|
\draw[color=black] (0.000000,45.000000) node[left] {$c0[0]~~0$};
|
|
% Line 7: c10 W c1[0]\-0
|
|
\draw[color=black] (0.000000,30.000000) -- (573.000000,30.000000);
|
|
\draw[color=black] (0.000000,29.000000) -- (573.000000,29.000000);
|
|
\draw[color=black] (0.000000,30.000000) node[left] {$c1[0]~~0$};
|
|
% Line 8: c20 W c2[0]\-0
|
|
\draw[color=black] (0.000000,15.000000) -- (573.000000,15.000000);
|
|
\draw[color=black] (0.000000,14.000000) -- (573.000000,14.000000);
|
|
\draw[color=black] (0.000000,15.000000) node[left] {$c2[0]~~0$};
|
|
% Line 9: c30 W c3[0]\-0
|
|
\draw[color=black] (0.000000,0.000000) -- (573.000000,0.000000);
|
|
\draw[color=black] (0.000000,-1.000000) -- (573.000000,-1.000000);
|
|
\draw[color=black] (0.000000,0.000000) node[left] {$c3[0]~~0$};
|
|
% Done with wires; drawing gates
|
|
% Line 10: q0 H
|
|
\begin{scope}
|
|
\draw[fill=white] (12.000000, 105.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\clip (12.000000, 105.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\draw (12.000000, 105.000000) node {$H$};
|
|
\end{scope}
|
|
% Line 11: q1 H
|
|
\begin{scope}
|
|
\draw[fill=white] (12.000000, 90.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\clip (12.000000, 90.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\draw (12.000000, 90.000000) node {$H$};
|
|
\end{scope}
|
|
% Line 12: q2 H
|
|
\begin{scope}
|
|
\draw[fill=white] (12.000000, 75.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\clip (12.000000, 75.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\draw (12.000000, 75.000000) node {$H$};
|
|
\end{scope}
|
|
% Line 13: q3 H
|
|
\begin{scope}
|
|
\draw[fill=white] (12.000000, 60.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\clip (12.000000, 60.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\draw (12.000000, 60.000000) node {$H$};
|
|
\end{scope}
|
|
% Line 14: q0 q1 q2 q3 BARRIER
|
|
\draw[decorate,decoration={zigzag,amplitude=1pt,segment length=4}] (24.000000,52.500000) -- (24.000000,112.500000);
|
|
% Line 15: q0 H
|
|
\begin{scope}
|
|
\draw[fill=white] (36.000000, 105.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\clip (36.000000, 105.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\draw (36.000000, 105.000000) node {$H$};
|
|
\end{scope}
|
|
% Line 16: q0:cwire +c00
|
|
%\draw (59.500000,105.000000) -- (59.500000,45.000000);
|
|
\draw (60.00000,105.000000) -- (60.00000,45.000000);
|
|
\filldraw (60.000000, 105.000000) circle(1.500000pt);
|
|
\begin{scope}
|
|
%\draw[fill=white] (60.000000, 45.000000) circle(3.000000pt);
|
|
\clip (60.000000, 45.000000) circle(3.000000pt);
|
|
\draw (57.000000, 45.000000) -- (63.000000, 45.000000);
|
|
%\draw (60.000000, 42.000000) -- (60.000000, 48.000000);
|
|
\end{scope}
|
|
\draw[->,>=stealth] (60.000000, 55.00000) -- +(270:10.392305pt); % arrowhead
|
|
\draw[fill=white] (54.000000, 99.000000) rectangle (66.000000, 111.000000);
|
|
\draw[very thin] (60.000000, 105.600000) arc (90:150:6.000000pt);
|
|
\draw[very thin] (60.000000, 105.600000) arc (90:30:6.000000pt);
|
|
\draw[->,>=stealth] (60.000000, 99.600000) -- +(80:10.392305pt);
|
|
% Line 17: q1 G:width=50 $u(0,0,\frac{\pi}{2}$ c00 %% ==1
|
|
\draw (103.000000,42.500000) node[text width=144pt,below,text centered] {\scriptsize ==1};
|
|
\draw (102.000000,90.000000) -- (102.000000,45.000000);
|
|
\draw (104.000000,90.000000) -- (104.000000,45.000000);
|
|
\begin{scope}
|
|
\draw[fill=white] (103.000000, 90.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
\clip (103.000000, 90.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
%\draw (103.000000, 90.000000) node {\scriptsize rz$(\frac{\pi}{2})$};
|
|
\draw (103.000000, 90.000000) node {\scriptsize rz$(\pi/2)$};
|
|
\end{scope}
|
|
\filldraw (103.000000, 45.000000) circle(1.500000pt);
|
|
% Line 18: q1 H
|
|
\begin{scope}
|
|
\draw[fill=white] (146.000000, 90.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\clip (146.000000, 90.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\draw (146.000000, 90.000000) node {$H$};
|
|
\end{scope}
|
|
% Line 19: TOUCH
|
|
% Line 20: q1:cwire +c10
|
|
%\draw (169.500000,90.000000) -- (169.500000,30.000000);
|
|
\draw (170.00000,90.000000) -- (170.00000,30.000000);
|
|
\filldraw (170.000000, 90.000000) circle(1.500000pt);
|
|
\begin{scope}
|
|
%\draw[fill=white] (170.000000, 30.000000) circle(3.000000pt);
|
|
\clip (170.000000, 30.000000) circle(3.000000pt);
|
|
\draw (167.000000, 30.000000) -- (173.000000, 30.000000);
|
|
%\draw (170.000000, 27.000000) -- (170.000000, 33.000000);
|
|
\end{scope}
|
|
\draw[->,>=stealth] (170.000000, 40.00000) -- +(270:10.392305pt); % arrowhead
|
|
\draw[fill=white] (164.000000, 84.000000) rectangle (176.000000, 96.000000);
|
|
\draw[very thin] (170.000000, 90.600000) arc (90:150:6.000000pt);
|
|
\draw[very thin] (170.000000, 90.600000) arc (90:30:6.000000pt);
|
|
\draw[->,>=stealth] (170.000000, 84.600000) -- +(80:10.392305pt);
|
|
% Line 21: q2 G:width=50 $u(0,0,\frac{\pi}{4}$ c00 %% ==1
|
|
\draw (201.000000, 42.500000) node[text width=144pt,below,text centered] {\scriptsize ==1};
|
|
\draw (200.000000,75.000000) -- (200.000000,45.000000);
|
|
\draw (202.000000,75.000000) -- (202.000000,45.000000);
|
|
\begin{scope}
|
|
\draw[fill=white] (201.000000, 75.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
\clip (201.000000, 75.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
%\draw (201.000000, 75.000000) node {\scriptsize rz$(\frac{\pi}{4})$};
|
|
\draw (201.000000, 75.000000) node {\scriptsize rz$(\pi/4)$};
|
|
\end{scope}
|
|
\filldraw (201.000000, 45.000000) circle(1.500000pt);
|
|
% Line 22: q2 G:width=50 $u(0,0,\frac{\pi}{2}$ c10 %% ==1
|
|
\draw (263.000000, 28.500000) node[text width=144pt,below,text centered] {\scriptsize ==1};
|
|
\draw (262.000000,75.000000) -- (262.000000,30.000000);
|
|
\draw (264.000000,75.000000) -- (264.000000,30.000000);
|
|
\begin{scope}
|
|
\draw[fill=white] (263.000000, 75.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
\clip (263.000000, 75.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
%\draw (263.000000, 75.000000) node {\scriptsize rz$(\frac{\pi}{2})$};
|
|
\draw (263.000000, 75.000000) node {\scriptsize rz$(\pi/2)$};
|
|
\end{scope}
|
|
\filldraw (263.000000, 30.000000) circle(1.500000pt);
|
|
% Line 23: q2 H
|
|
\begin{scope}
|
|
\draw[fill=white] (306.000000, 75.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\clip (306.000000, 75.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\draw (306.000000, 75.000000) node {$H$};
|
|
\end{scope}
|
|
% Line 24: TOUCH
|
|
% Line 25: q2:cwire +c20
|
|
%\draw (329.500000,75.000000) -- (329.500000,15.000000);
|
|
\draw (330.00000,75.000000) -- (330.00000,15.000000);
|
|
\filldraw (330.000000, 75.000000) circle(1.500000pt);
|
|
\begin{scope}
|
|
%\draw[fill=white] (330.000000, 15.000000) circle(3.000000pt);
|
|
\clip (330.000000, 15.000000) circle(3.000000pt);
|
|
\draw (327.000000, 15.000000) -- (333.000000, 15.000000);
|
|
%\draw (330.000000, 12.000000) -- (330.000000, 18.000000);
|
|
\end{scope}
|
|
\draw[->,>=stealth] (330.000000, 25.00000) -- +(270:10.392305pt); % arrowhead
|
|
\draw[fill=white] (324.000000, 69.000000) rectangle (336.000000, 81.000000);
|
|
\draw[very thin] (330.000000, 75.600000) arc (90:150:6.000000pt);
|
|
\draw[very thin] (330.000000, 75.600000) arc (90:30:6.000000pt);
|
|
\draw[->,>=stealth] (330.000000, 69.600000) -- +(80:10.392305pt);
|
|
% Line 26: q3 G:width=50 $u(0,0,\frac{\pi}{8}$ c00 %% ==1
|
|
\draw (361.000000, 42.00000) node[text width=144pt,below,text centered] {\scriptsize ==1};
|
|
\draw (360.000000,60.000000) -- (360.000000,45.000000);
|
|
\draw (362.000000,60.000000) -- (362.000000,45.000000);
|
|
\begin{scope}
|
|
\draw[fill=white] (361.000000, 60.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
\clip (361.000000, 60.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
%\draw (361.000000, 60.000000) node {\scriptsize rz$(\frac{\pi}{8})$};
|
|
\draw (361.000000, 60.000000) node {\scriptsize rz$(\pi/8)$};
|
|
\end{scope}
|
|
\filldraw (361.000000, 45.000000) circle(1.500000pt);
|
|
% Line 27: q3 G:width=50 $u(0,0,\frac{\pi}{4}$ c10 %% ==1
|
|
\draw (423.000000, 28.00000) node[text width=144pt,below,text centered] {\scriptsize ==1};
|
|
\draw (422.000000,60.000000) -- (422.000000,30.000000);
|
|
\draw (424.000000,60.000000) -- (424.000000,30.000000);
|
|
\begin{scope}
|
|
\draw[fill=white] (423.000000, 60.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
\clip (423.000000, 60.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
%\draw (423.000000, 60.000000) node {\scriptsize rz$(\frac{\pi}{4})$};
|
|
\draw (423.000000, 60.000000) node {\scriptsize rz$(\pi/4)$};
|
|
\end{scope}
|
|
\filldraw (423.000000, 30.000000) circle(1.500000pt);
|
|
% Line 28: q3 G:width=50 $u(0,0,\frac{\pi}{2}$ c20 %% ==1
|
|
\draw (485.000000, 15.00000) node[text width=144pt,below,text centered] {\scriptsize ==1};
|
|
\draw (484.000000,60.000000) -- (484.000000,15.000000);
|
|
\draw (486.000000,60.000000) -- (486.000000,15.000000);\\
|
|
\begin{scope}
|
|
\draw[fill=white] (485.000000, 60.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
\clip (485.000000, 60.000000) +(-45.000000:35.355339pt and 8.485281pt) -- +(45.000000:35.355339pt and 8.485281pt) -- +(135.000000:35.355339pt and 8.485281pt) -- +(225.000000:35.355339pt and 8.485281pt) -- cycle;
|
|
%\draw (485.000000, 60.000000) node {\scriptsize rz$(\frac{\pi}{2})$};
|
|
\draw (485.000000, 60.000000) node {\scriptsize rz$(\pi/2)$};
|
|
\end{scope}
|
|
\filldraw (485.000000, 15.000000) circle(1.500000pt);
|
|
% Line 29: q3 H
|
|
\begin{scope}
|
|
\draw[fill=white] (528.000000, 60.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\clip (528.000000, 60.000000) +(-45.000000:8.485281pt and 8.485281pt) -- +(45.000000:8.485281pt and 8.485281pt) -- +(135.000000:8.485281pt and 8.485281pt) -- +(225.000000:8.485281pt and 8.485281pt) -- cycle;
|
|
\draw (528.000000, 60.000000) node {$H$};
|
|
\end{scope}
|
|
% Line 30: q3:cwire +c30
|
|
%\draw (551.500000,60.000000) -- (551.500000,0.000000);
|
|
\draw (552.00000,60.000000) -- (552.00000,0.000000);
|
|
\filldraw (552.000000, 60.000000) circle(1.500000pt);
|
|
\begin{scope}
|
|
%\draw[fill=white] (552.000000, 0.000000) circle(3.000000pt);
|
|
\clip (552.000000, 0.000000) circle(3.000000pt);
|
|
\draw (549.000000, 0.000000) -- (555.000000, 0.000000);
|
|
%\draw (552.000000, -3.000000) -- (552.000000, 3.000000);
|
|
\end{scope}
|
|
\draw[->,>=stealth] (552.000000, 10.00000) -- +(270:10.392305pt); % arrowhead
|
|
\draw[fill=white] (546.000000, 54.000000) rectangle (558.000000, 66.000000);
|
|
\draw[very thin] (552.000000, 60.600000) arc (90:150:6.000000pt);
|
|
\draw[very thin] (552.000000, 60.600000) arc (90:30:6.000000pt);
|
|
\draw[->,>=stealth] (552.000000, 54.600000) -- +(80:10.392305pt);
|
|
% Line 31: TOUCH
|
|
% Line 32: q0 OUT 0
|
|
\filldraw[color=white] (570.000000, 102.000000) rectangle (576.000000, 108.000000);
|
|
\draw (570.000000, 102.000000) -- (570.000000, 108.000000);
|
|
%\draw (573.000000, 105.000000) node {$\scriptstyle{0}$};
|
|
% Line 33: q1 OUT 0
|
|
\filldraw[color=white] (570.000000, 87.000000) rectangle (576.000000, 93.000000);
|
|
\draw (570.000000, 87.000000) -- (570.000000, 93.000000);
|
|
%\draw (573.000000, 90.000000) node {$\scriptstyle{0}$};
|
|
% Line 34: q2 OUT 0
|
|
\filldraw[color=white] (570.000000, 72.000000) rectangle (576.000000, 78.000000);
|
|
\draw (570.000000, 72.000000) -- (570.000000, 78.000000);
|
|
%\draw (573.000000, 75.000000) node {$\scriptstyle{0}$};
|
|
% Line 35: q3 OUT 0
|
|
\filldraw[color=white] (570.000000, 57.000000) rectangle (576.000000, 63.000000);
|
|
\draw (570.000000, 57.000000) -- (570.000000, 63.000000);
|
|
%\draw (573.000000, 60.000000) node {$\scriptstyle{0}$};
|
|
% Done with gates; drawing ending labels
|
|
% Done with ending labels; drawing cut lines and comments
|
|
% Done with comments
|
|
\end{tikzpicture}
|
|
\end{document}
|