Skip to content

Commit 5ab969c

Browse files
committed
Version 2.1 update
Major changes: * A new general Frank Wolfe routine for writing new math solver modules. Math solver developers no longer have to write their own Frank Wolfe routines for each problem! Just provide it the objective function f(x), The gradient, grad[f](x), and the direction finding subproblem function. * BREAKING CHANGE, the new Frank Wolfe solver splits off Frank Wolfe options into its own struct, ``frankWolfeOptions``. Please move the following options (if present in your preset) to ``franWolfeOptions``: * ``maxIter`` * ``maxGap`` * ``linearSearchPrecision`` * ``linearSearchMinStep`` * Even more parallel processing tools. New example scripts for running basic parallel pools using ``xargs`` in Bash, and ``ForEach-Object -Parallel`` in Windows Power Shell. These let you split the total number of runs from the total number of threads. The previous ``BatchJobExample.sh`` was updated and renamed ``ParallelExampleBash.sh``. * Various small bug fixes for validation functions. * Removed a few ancient functions that snuck into the V2.0.x builds. * ``isAnnouncement.m`` * ``isModuleStruct.m`` * ``mustBeAnAnnouncement.m`` * Corrected the spelling of ``isBlockDimsWellFormatted.m``. The old spelling ``isBlockDimsWellFormated.m`` remains for now but will be removed in the next major version.
1 parent fe4b421 commit 5ab969c

File tree

57 files changed

+2434
-1484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2434
-1484
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*.log
1212
*.out
1313

14+
# ignore documentation build files
15+
docs/build/
16+
1417
# Don't know where this is from but it keeps comming up
1518
*.DS_Store
1619

@@ -26,4 +29,4 @@
2629

2730
# Packaged app and toolbox files
2831
*.mlappinstall
29-
*.mltbx
32+
*.mltbx

BasicProtocols/BasicBB84Alice2D/BasicBB84Alice2DPreset.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
% The optimizer module is designed to tweak parameters to increase your
8181
% keyrate. It's not used in this protocol, though use cases can include
8282
% tweaking the intensity of coherent pulses used by Alice.
83-
optimizerMod = QKDOptimizerModule(@coordinateDescentFunc,struct("verboseLevel",0),struct("verboseLevel",0));
83+
optimizerMod = QKDOptimizerModule(@coordinateDescentFunc,struct("verboseLevel",0),...
84+
struct("verboseLevel",0));
8485
qkdInput.setOptimizerModule(optimizerMod);
8586

8687

@@ -91,8 +92,8 @@
9192
% the key and Eve's information.
9293
mathSolverOptions = struct();
9394
mathSolverOptions.initMethod = 1; %closest to maximally mixed.
94-
mathSolverOptions.maxIter = 10; %number of iterations that should be performed
95-
mathSolverOptions.maxGap = 1e-6;
95+
mathSolverOptions.frankWolfeMethod = @FrankWolfe.vanilla;
96+
mathSolverOptions.frankWolfeOptions = struct("maxIter",10,"maxGap",1e-6);
9697
mathSolverOptions.linearConstraintTolerance = 1e-10;
9798
mathSolverMod = QKDMathSolverModule(@FW2StepSolver,mathSolverOptions);
9899
qkdInput.setMathSolverModule(mathSolverMod);
@@ -108,7 +109,7 @@
108109
% * verboseLevel (default 1): Non-negative integer telling the program how
109110
% much information it should display in the command window. 0, minimum; 1
110111
% basic information; 2, full details, including CVX output.
111-
% * errorHandling (2): ErrorHandling object (unit8 or convertible),
112+
% * errorHandling (2): ErrorHandling object (uint8 or convertible),
112113
% detailing how the program should handle run time errors. CatchSilent 1:
113114
% catch but don't warn the user and the error message is appended to the
114115
% debug info. CatchWarn 2: catch and warn the user. The key rate for the

BasicProtocols/BasicBB84Alice2DFinite/BasicBB84Alice2DFinitePreset.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
% math solver options
6161
mathSolverOptions = struct();
6262
mathSolverOptions.initMethod = 1;
63-
mathSolverOptions.maxIter = 50 ;
64-
mathSolverOptions.maxGap = 1e-6;
63+
mathSolverOptions.frankWolfeMethod = @FrankWolfe.vanilla;
64+
mathSolverOptions.frankWolfeOptions = struct("maxIter",50,"maxGap",1e-6);
6565
mathSolverOptions.blockDiagonal = false;
6666
mathSolverMod = QKDMathSolverModule(@FW2StepSolver,mathSolverOptions,mathSolverOptions);
6767
qkdInput.setMathSolverModule(mathSolverMod);
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
%pick the preset file
2-
3-
qkdInput = BasicBB84Alice2DFinitePreset();
4-
5-
%run the QKDSolver with this input
6-
results = MainIteration(qkdInput);
7-
8-
%save the results and preset to a file.
9-
10-
save("BasicBB84Alice2DFiniteresults.mat","results","qkdInput");
11-
12-
13-
%% plot the result
1+
%pick the preset file
2+
3+
qkdInput = BasicBB84Alice2DFinitePreset();
4+
5+
%run the QKDSolver with this input
6+
results = MainIteration(qkdInput);
7+
8+
%save the results and preset to a file.
9+
10+
save("BasicBB84Alice2DFiniteresults.mat","results","qkdInput");
11+
12+
13+
%% plot the result
1414
QKDPlot.simple1DPlot(qkdInput,results)

BasicProtocols/BasicBB84Alice4D/BasicBB84Alice4DPreset.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
% the key and Eve's information.
9494
mathSolverOptions = struct();
9595
mathSolverOptions.initMethod = 1; %closest to maximally mixed.
96-
mathSolverOptions.maxIter = 10; %number of iterations that should be performed
97-
mathSolverOptions.maxGap = 1e-6;
96+
mathSolverOptions.frankWolfeMethod = @FrankWolfe.vanilla;
97+
mathSolverOptions.frankWolfeOptions = struct("maxIter",10,"maxGap",1e-6);
9898
mathSolverOptions.linearConstraintTolerance = 1e-10;
9999
mathSolverMod = QKDMathSolverModule(@FW2StepSolver,mathSolverOptions);
100100
qkdInput.setMathSolverModule(mathSolverMod);
@@ -117,5 +117,5 @@
117117
% point is set to nan and the error message is appended to the debug
118118
% info. The key rate for the point is set to nan. DontCatch 3: don't
119119
% catch the error and let it up the stack.
120-
qkdInput.setGlobalOptions(struct("errorHandling",ErrorHandling.CatchWarn,"verboseLevel",1,"cvxSolver","SDPT3", "cvxPrecision", "high"));
120+
qkdInput.setGlobalOptions(struct("errorHandling",ErrorHandling.CatchWarn,"verboseLevel",1,"cvxSolver","SeDuMi", "cvxPrecision", "high"));
121121
end
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
%pick the preset file to use In this case we start with a basic qubit BB84
2-
%protocol with no loss. Feel free to open up the module and look at what it
3-
%sets!
4-
qkdInput = BasicBB84Alice4DPreset();
5-
6-
%run the QKDSolver with this input
7-
results = MainIteration(qkdInput);
8-
9-
%save the results and preset to a file.
10-
save("BasicBB84Alice4DResults.mat","results","qkdInput");
11-
12-
%% plot the result
1+
%pick the preset file to use In this case we start with a basic qubit BB84
2+
%protocol with no loss. Feel free to open up the module and look at what it
3+
%sets!
4+
qkdInput = BasicBB84Alice4DPreset();
5+
6+
%run the QKDSolver with this input
7+
results = MainIteration(qkdInput);
8+
9+
%save the results and preset to a file.
10+
save("BasicBB84Alice4DResults.mat","results","qkdInput");
11+
12+
%% plot the result
1313
QKDPlot.simple1DPlot(qkdInput,results)

BasicProtocols/BasicBB84Lossy/BasicBB84LossyPreset.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
% math solver options
5050
mathSolverOptions = struct();
5151
mathSolverOptions.initMethod = 1;
52-
mathSolverOptions.maxIter = 10;
53-
mathSolverOptions.maxGap = 1e-6;
52+
mathSolverOptions.frankWolfeMethod = @FrankWolfe.vanilla;
53+
mathSolverOptions.frankWolfeOptions = struct("maxIter",10,"maxGap",1e-6);
5454
mathSolverOptions.blockDiagonal = true;
5555
mathSolverMod = QKDMathSolverModule(@FW2StepSolver,mathSolverOptions);
5656
qkdInput.setMathSolverModule(mathSolverMod);
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
%pick preset
2-
qkdInput = BasicBB84LossyPreset();
3-
4-
%run the QKDSolver with this input and store results
5-
results = MainIteration(qkdInput);
6-
7-
%save the results and preset to a file.
8-
save("BasicBB84LossyResults.mat","results","qkdInput");
9-
10-
%% plot the result
1+
%pick preset
2+
qkdInput = BasicBB84LossyPreset();
3+
4+
%run the QKDSolver with this input and store results
5+
results = MainIteration(qkdInput);
6+
7+
%save the results and preset to a file.
8+
save("BasicBB84LossyResults.mat","results","qkdInput");
9+
10+
%% plot the result
1111
QKDPlot.simple1DPlot(qkdInput,results,"xScaleStyle","dB","yScaleStyle","log")

BasicProtocols/BasicBB84WCPDecoy/BasicBB84WCPDecoyKeyRateFunc.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@
113113

114114
modParser.addOptionalParam("rhoA", nan, @(x) isequaln(x,nan) || isDensityOperator(x));
115115

116-
modParser.addOptionalParam("blockDimsA", nan, @isBlockDimsWellFormated);
117-
modParser.addOptionalParam("blockDimsB", nan, @isBlockDimsWellFormated);
116+
modParser.addOptionalParam("blockDimsA", nan, @isBlockDimsWellFormatted);
117+
modParser.addOptionalParam("blockDimsB", nan, @isBlockDimsWellFormatted);
118118
modParser.addAdditionalConstraint(@(x,y) blockDimsMustMatch(x,y),["blockDimsA","dimA"]);
119119
modParser.addAdditionalConstraint(@(x,y) blockDimsMustMatch(x,y),["blockDimsB","dimB"]);
120120
modParser.addAdditionalConstraint(@(blockDimsA,blockDimsB) ~xor(isequaln(blockDimsA,nan),isequaln(blockDimsB,nan)),["blockDimsA","blockDimsB"]);

BasicProtocols/BasicBB84WCPDecoy/BasicBB84WCPDecoyPreset.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
% math solver options
5151
mathSolverOptions = struct();
5252
mathSolverOptions.initMethod = 1;
53-
mathSolverOptions.maxIter = 10;
54-
mathSolverOptions.maxGap = 1e-6;
53+
mathSolverOptions.frankWolfeMethod = @FrankWolfe.vanilla;
54+
mathSolverOptions.frankWolfeOptions = struct("maxIter",10,"maxGap",1e-6);
5555
mathSolverOptions.blockDiagonal = true;
5656
mathSolverMod = QKDMathSolverModule(@FW2StepSolver,mathSolverOptions,mathSolverOptions);
5757
qkdInput.setMathSolverModule(mathSolverMod);

0 commit comments

Comments
 (0)