-
Notifications
You must be signed in to change notification settings - Fork 3
/
bestSteeringMeasurements.m
59 lines (47 loc) · 1.93 KB
/
bestSteeringMeasurements.m
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
function [beta, Max] = bestSteeringMeasurements(rho,F)
%BESTSTEERINGMEASUREMENTS finds best measurements for steering functional
%and state
% This function has two required arguments:
% rho: a 2-D array containing a valid bipartite quantum state.
% F: a 4-D array containing a steering functional. The first two
% dimensions contain the dB x dB hermitian members of the functional, and
% the last two dimensions are (a,x).
%
% beta = bestSteeringMeasurements(rho,F) returns the optimal violation of
% the steering functional F, with for the quantum state rho.
%
% [beta, Max] = bestSteeringMeasurements(rho,F) also returns the optimal
% measurements Max that achieve the optimal violation. Max is a 4-D array,
% containing the oa dA x dA POVM elements of the ma measurements. The first
% two dimensions contain the POVM elements, and the last two dimensions are
% (a,x).
%
% requires: CVX (http://cvxr.com/cvx/), QETLAB (http://www.qetlab.com)
% authors: Paul Skrzypczyk, Daniel Cavalcanti
% last updated: March 17, 2016
[dB,~,oa,ma] = size(F);
% dB = dim. of Bob, oa = # outcomes for Alice, ma = # inputs for Alice
dA = length(rho)/dB;
% dA = dim. of Alice.
sigma = zeros(dA,dA,oa,ma);
% sigma stores the 'assemblage' that Bob would create for Alice by applying
% the operators F_ax on rho. NOTE: This is not an assemblage, since the
% F_ax do not need to be positive operators, and do not need to sum to the
% identity.
for a = 1:oa
for x = 1:ma
sigma(:,:,a,x) = PartialTrace(Tensor(eye(dA),F(:,:,a,x))*rho,2,[dA,dB]);
end
end
cvx_begin sdp quiet
variable Max(dA,dA,oa,ma) hermitian semidefinite
% the POVM elements of Alice
maximise real(sum(reshape(conj(sigma).*Max,1,[])))
% NOTE: we assume that the steering inequality is of the form
% F.sigma^LHS <= beta, hence the maximisation.
subject to
validPOVMs(Max) == 1;
% Max should be a valid set of POVMs
cvx_end
beta = cvx_optval;
end