Skip to content

Commit 016911b

Browse files
committed
Added Tr[rhoAB] == 1 constraint when no rhoA is given for BasicKeyRateFunc.
Added note to the pauliBasis function reminding people that the phase conventions differ from bloch sphere rotations.
1 parent 9e07ff5 commit 016911b

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

keyRateModules/BasicKeyRateFunc.m

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
% Bob's measurements that line up with it's corresponding observable in
2828
% observablesJoint. These values should be betwen 0 and 1.
2929
% * rhoA (nan): The fixed known density matrix on Alice's side for
30-
% prepare-and-measure protocols.
30+
% prepare-and-measure protocols. Setting to nan means this is ignored and
31+
% no rhoA constraint is passed to the convex solver. Furthermore, an
32+
% explicit Tr[rhoAB] == 1 constraint is added in its place.
3133
% Outputs:
3234
% * keyrate: Key rate of the QKD protocol measured in bits per block
3335
% processed.
@@ -113,16 +115,19 @@
113115
%operators for the key map (Z).
114116
mathSolverInput.krausOps = params.krausOps;
115117
mathSolverInput.keyProj = params.keyProj;
116-
% also include rhoA from the description if it was given
117-
if ~isequaln(params.rhoA,nan)
118-
mathSolverInput.rhoA = params.rhoA;
119-
end
120118

121119
numObs = numel(params.observablesJoint);
122120

123121
mathSolverInput.equalityConstraints = arrayfun(@(x)...
124122
EqualityConstraint(params.observablesJoint{x},params.expectationsJoint(x)),1:numObs);
125123

124+
% Include rhoA (if given) or add an explicit Tr[rhoAB] == 1 constriant.
125+
if ~isequaln(params.rhoA,nan)
126+
mathSolverInput.rhoA = params.rhoA;
127+
else
128+
mathSolverInput.equalityConstraints(end+1) = EqualityConstraint(eye(params.dimA*params.dimB),1);
129+
end
130+
126131
% if block diag information was give, then pass it to the solver.
127132
if ~isequaln(params.blockDimsA,nan)
128133
mathSolverInput.blockDimsA = params.blockDimsA;

tools/HelperFunctions/pauliBasis.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
% states of the Pauli Z operator (H/1,V/2) to the eigen states of the Pauli
44
% X (D/+,A/-) or Y (R,L) operators.
55
%
6+
% Note: Unlike, the functions present in Rotations, Qudit, and Coherent
7+
% which are based on rotations around the bloch sphere, pauliBasis does not
8+
% pick up any additional phase factors.
9+
%
610
% Inputs:
711
% * basis: Integer which selects which basis the unitary should transform
812
% the Z eigen basis to: 1=Z (H/1,V/2) (identity), 2=X (D/+,A/-), 3=Y (R,L).
913
% * revY (false): Logical to reverse the assignement for the Pauli Y eigen
1014
% vectors. In other words, revY = true: U|1> = |R>, U|2> = |L>, revY =
1115
% false: U|1> = |L>, U|2> = |R>. Has no effect for other basis choices.
16+
%
17+
% See also: Rotations, Qudit, Coherent
1218
arguments
1319
basis (1,1) double {mustBeMember(basis,[1,2,3])}
1420
revY (1,1) logical = false

0 commit comments

Comments
 (0)