-
Notifications
You must be signed in to change notification settings - Fork 27
/
RobustnessCoherence.m
50 lines (42 loc) · 1.72 KB
/
RobustnessCoherence.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
%% RobustnessCoherence Computes the robustness of coherence of a quantum state
% This function has one required argument:
% RHO: a pure state vector or a density matrix
%
% ROC = RobustnessCoherence(RHO) is the robustness of coherence (as
% defined in [1,2]) of the quantum state (density matrix) RHO.
%
% References: [1] C. Napoli, T. R. Bromley, M. Cianciaruso, M. Piani,
% N. Johnston, G. Adesso. Robustness of coherence: An
% operational and observable measure of quantum
% coherence. Preprint submitted to PRL, 2016.
% [2] M. Piani, M. Cianciaruso, T. R. Bromley, C. Napoli,
% N. Johnston, G. Adesso. Robustness of asymmetry and
% coherence of quantum states. Preprint submitted to PRA,
% 2016.
%
% URL: http://www.qetlab.com/RobustnessCoherence
% requires: cvx (http://cvxr.com/cvx/), L1NormCoherence.m,
% pure_to_mixed.m
% author: Nathaniel Johnston (nathaniel@njohnston.ca)
% package: QETLAB
% last updated: January 12, 2016
function RoC = RobustnessCoherence(rho)
rho = pure_to_mixed(rho); % Let the user enter either a pure state vector or a density matrix.
n = length(rho);
% If the state is pure or single-qubit, we can compute it faster by
% recalling that it is equal to the l1-norm of coherence.
if(n <= 2 || rank(rho) == 1)
RoC = L1NormCoherence(rho);
return
end
% Robustness of coherence is computed by semidefinite programming
cvx_begin sdp quiet
cvx_precision best;
variable inc_state(n,1);
variable sig(n,n) hermitian;
minimize trace(sig);
subject to
sig >= 0;
rho + sig == diag(inc_state);
cvx_end
RoC = real(cvx_optval);