summaryrefslogtreecommitdiff
path: root/sources/know/concept/deutsch-jozsa-algorithm/circuit.tex
blob: ad0dff3547ca74d237a1673152da7d5e4563aee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{physics}
\usepackage{yquant}


\begin{document}

\section{Spacer}

\begin{tikzpicture}
	\begin{yquant}[operator/separation=5mm]
		qubit {$\ket{0}$} a;
		qubit {$\ket{1}$} b;

		h a;
		h b;
		box {$U_f$} (a, b);
		h a;
		measure a;
	\end{yquant}
\end{tikzpicture}

\section{Spacer}

\yquantdefinebox{dots}[inner sep=0pt]{$\dots$}
\begin{tikzpicture}
	\begin{yquant}[operator/separation=5mm]
		qubit {$\ket{0}$} a[2];
		nobit ellipsis;
		qubit {$\ket{0}$} z;
		qubit {$\ket{1}$} b;

		h a[0];
		h a[1];
		dots ellipsis;
		h z;
		h b;
		box {$U_f$} (a[0, 1], ellipsis, z, b);
		h a[0];
		h a[1];
		dots ellipsis;
		h z;
		measure a[0];
		measure a[1];
		dots ellipsis;
		measure z;
	\end{yquant}
\end{tikzpicture}

\end{document}