-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatlab_notebook.tex
174 lines (140 loc) · 4.67 KB
/
matlab_notebook.tex
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
%!TEX root = thesis.tex
%-------------------------------------------------------------------------------
\chapter{Local distinguishability in Matlab}
\label{chap:AppendixA}
%-------------------------------------------------------------------------------
\section*{Setup}
\subsection*{Requirements}
\begin{itemize}
\item MATLAB\footnote{Unfortunately at the time of writing this,
the package CVX only runs on Matlab. I solemnly promise that I will port
all the code to GNU Octave once the Octave port of CVX will be completed.};
\item CVX \textgreater= 2.1 \cite{cvx};
\item QETLAB \textgreater= 0.7 \cite{Johnston2015};
\end{itemize}
\subsection*{List of functions}
\begin{itemize}
\item \texttt{Distinguishability} (by N. Johnston) ---
given an ensemble $\E$, computes $\opt(\E)$;
\item \texttt{LocalDistinguishability} ---
given an ensemble $\E$, computes $\opt_{\PPT}(\E)$ or $\opt_{\Sym}(\E)$;
\item \texttt{UPBSepDistinguishable} (by N. Johnston) -- an implementation of
the criterion described in Sec.~\ref{sec:criterion-sep-upb};
\end{itemize}
\sloppy
\definecolor{lightgray}{gray}{0.5}
\setlength{\parindent}{0pt}
\section*{Examples}
The code for the following examples can be found in the repository \cite{Cosentino15}.
\subsection*{Yu--Duan--Ying states}
\begin{verbatim}
states = 1/2*[vec(kron(Pauli(0),Pauli(0)))'; ...
vec(kron(Pauli(1),Pauli(1)))'; ...
vec(kron(Pauli(2),Pauli(1)))'; ...
vec(kron(Pauli(3),Pauli(1)))']';
disp(Distinguishability(states));
disp(LocalDistinguishability(states, 'copies', 1));
disp(LocalDistinguishability(states));
\end{verbatim}\color{lightgray}
\begin{verbatim}
1
0.8750
0.7500
\end{verbatim}
\color{black}
\subsection*{Tiles set plus extra orthogonal state (Example \ref{ex:tiles-set})}
\begin{verbatim}
extra_state = 1/2*[1 1 -1 0 0 -1 0 0 0];
set = [UPB('Tiles') extra_state'];
disp(LocalDistinguishability(UPB('Tiles')))
disp(LocalDistinguishability(states, 'copies', 1));
disp(LocalDistinguishability(states));
\end{verbatim}\color{lightgray}
\begin{verbatim}
1.0000
1.0000
0.9860
\end{verbatim}
\color{black}
\subsection*{Bell state discrimination}
\begin{verbatim}
bells_m = [Bell(1) Bell(2) Bell(3) Bell(4)]';
disp(Distinguishability(bells_m));
disp(LocalDistinguishability(bells_m, 'copies', 1));
\end{verbatim}
\color{lightgray}
\begin{verbatim}
1
0.5000
\end{verbatim} \color{black}
\subsection*{Entanglement cost (Section \ref{sec:entanglement-cost})}
\begin{verbatim}
eps = 1/2; % takes a value between 0 and 1
eps_state = [sqrt((1+eps)/2) 0 0 sqrt((1-eps)/2)]';
\end{verbatim}
\subsubsection*{4 Bell states}
\begin{verbatim}
d = 4;
n = 4;
bells_m = zeros(d^2, n);
for k=1:n
% makes sure we are considering the right partition
bells_m(:, k) = Swap(kron(Bell(k), eps_state), [2 3], [2 2 2 2]);
end
disp(Distinguishability(bells_m));
disp(LocalDistinguishability(bells_m, 'copies', 1));
\end{verbatim}\color{lightgray}\begin{verbatim}
1
0.9330
\end{verbatim}
\color{black}
\subsubsection*{3 Bell states}
\begin{verbatim}
n = 3;
disp(Distinguishability(bells_m(:, 1:n)));
disp(LocalDistinguishability(bells_m(:, 1:n), 'copies', 1));
disp(LocalDistinguishability(bells_m(:, 1:n), 'copies', 2));
\end{verbatim}
\color{lightgray}
\begin{verbatim}
1
0.9916
0.9586
\end{verbatim} \color{black}
\section*{Generalized Bell states (Examples from \cite{Ghosh04})}
In the code that follows, the function \texttt{GenPauli(a,b,n)} generates the
matrix corresponding to the operator $W_{a,b}\in\Unitary(\complex^{n})$
defined in Eq.~\eqref{eq:generalized-Pauli-operators}.
\subsection*{$5$ maximally entangled states in $\complex^{5}\otimes\complex^{5}$}
\begin{verbatim}
n = 5;
gen_bells = [vec(GenPauli(0,0,n)), ...
vec(GenPauli(1,1,n)), ...
vec(GenPauli(1,2,n)), ...
vec(GenPauli(3,1,n)), ...
vec(GenPauli(3,2,n))];
disp(Distinguishability(gen_bells));
disp(LocalDistinguishability(gen_bells, 'copies', 1));
\end{verbatim}
\color{lightgray}
\begin{verbatim}
1
0.9898
\end{verbatim} \color{black}
\subsection*{$6$ maximally entangled states in $\complex^{6}\otimes\complex^{6}$}
\begin{verbatim}
n = 6;
gen_bells = [vec(GenPauli(0,0,n)), ...
vec(GenPauli(1,1,n)), ...
vec(GenPauli(0,2,n)), ...
vec(GenPauli(0,3,n)), ...
vec(GenPauli(0,4,n)), ...
vec(GenPauli(3,0,n))];
disp(Distinguishability(gen_bells));
disp(LocalDistinguishability(gen_bells, 'copies', 1));
\end{verbatim}
\color{lightgray}
\begin{verbatim}
1
0.9905
\end{verbatim} \color{black}