List of commits:
Subject Hash Author Date (UTC)
Refactor run_entanglement_evaluation_simulation dc585c8941b2bf97dc182a8afc1082b10ec8dee2 Jason Hoelscher-Obermaier 2016-06-16 11:34:45
Include functionality of run_.._quick into run_entanglement_evaluation_simulation 12cc4e34841c52e44a49dae459497b45efedda17 Jason Hoelscher-Obermaier 2016-06-16 11:09:56
Add prototypical evaluation folder for quick tests of the entanglement evaluation 920d5ccf6408b1f0122e8b8af7b15f8518433f44 Jason Hoelscher-Obermaier 2016-06-16 10:18:32
Remove unfinished fct symplectic_fcts_test.m e44f20cd99436fcdfe601c23178bbd5aa94bbe9e Jason Hoelscher-Obermaier 2016-06-16 10:14:16
Move remaining cov.matrix-based functions to subfolder covmats a7434c41951a01fcabd067313b71ab2565d0e958 Jason Hoelscher-Obermaier 2016-06-16 10:03:44
Move boundedline to subfolder gui 95d89409f1bce72549a826e62a778290cb2ced14 Jason Hoelscher-Obermaier 2016-06-16 09:15:15
Move filerelated fcts to subfolder io and add simple tests 74d721b0b33749967e9322021bb7663369ee6168 Jason Hoelscher-Obermaier 2016-06-16 08:22:59
Move williamson_diagonalization and williamson_form and add simple tests c237ef65f3eae46800cd06664de163df9eadf989 Jason Hoelscher-Obermaier 2016-06-15 14:41:59
Move combineCMs and traceOutCM and add simple test d4170659c28da6a0fe0e7723e20b5574d40d105f Jason Hoelscher-Obermaier 2016-06-15 14:31:02
Move ui/gui fcts to subfolders of misc/ 95f71a63ac5e8e1bf88d3f1db7f40759c3d2dd87 Jason Hoelscher-Obermaier 2016-06-15 14:02:34
Move matrix fcts is_orthogonal and is_symplectic and add simple tests b2e67152da7c9e2222e6f2b47679d4e6f111977a Jason Hoelscher-Obermaier 2016-06-15 14:00:33
Move fidelity.m and purity.m and add tests 1d27232478130ca3ab04b87620f26d7ffe3ef030 Jason Hoelscher-Obermaier 2016-06-15 13:42:58
Move smss.m and tmss.m 5bd484893e8e535b13ca20fc62b622433657cd77 Jason Hoelscher-Obermaier 2016-06-15 12:40:25
Simplify checkCMdimensions.m 4e45bd575f356bca400b03fb3c40dbe34125ea5d Jason Hoelscher-Obermaier 2016-06-15 12:33:55
Store software_version together with entanglement_evaluation object and export it d84aee1d422dcc64881a538c02cbaebb0513db51 Jason Hoelscher-Obermaier 2016-06-13 12:29:41
Add explicit comparison to eval. results as of commit 5d8d07 to ent.._eval.._test 7764d769c1b11f0363aeb061c0f6fa3326c5c362 Jason Hoelscher-Obermaier 2016-06-13 12:08:43
Change 'blocksize' argument in blocked_cross_correlation to key-value type syntax 5d8d0735783578340181b70eff55d071ba4d25d7 Jason Hoelscher-Obermaier 2016-06-13 09:36:01
Add quick version of entanglement evalution 63b2dc15c5fc7a7c5c9f870d783ab8f4d1c95396 Jason Hoelscher-Obermaier 2016-06-13 09:35:01
Fix wrong calculation of pulse modes (wrong pulse width; gamma -> 2 pi gamma) f2e86613d70f9f14b6f9b0fa28087c4acae94230 Jason Hoelscher-Obermaier 2016-06-13 09:33:34
Add fcts for obtaining commit hash for given git repo / all git repos on MATLAB path efef21a37871118248627a2889e1c3e3ddfaf0cd Jason Hoelscher-Obermaier 2016-06-10 14:10:53
Commit dc585c8941b2bf97dc182a8afc1082b10ec8dee2 - Refactor run_entanglement_evaluation_simulation
- fix bug in plot titles
- etc
Author: Jason Hoelscher-Obermaier
Author date (UTC): 2016-06-16 11:34
Committer name: Jason Hoelscher-Obermaier
Committer date (UTC): 2016-06-16 11:35
Parent(s): 12cc4e34841c52e44a49dae459497b45efedda17
Signer:
Signing key:
Signing status: N
Tree: acdf2ef4b3b752c0a35d4ba83aa7f9b62e1e6d08
File Lines added Lines deleted
data_analysis/auxfunctions/run_entanglement_evaluation_simulation.m 45 71
File data_analysis/auxfunctions/run_entanglement_evaluation_simulation.m changed (mode: 100644) (index de55d7f..90e61d3)
1 1 %% [ev, model] = run_entanglement_evaluation_simulation(simulation_dir): %% [ev, model] = run_entanglement_evaluation_simulation(simulation_dir):
2 %takes a directory simulation_dir
3 %and creates a suitable evaluation object
2 %takes a directory simulation_dir and creates a suitable evaluation object
4 3 % %
5 4 % simulation_dir must contain a script 'setup_eval.m' % simulation_dir must contain a script 'setup_eval.m'
6 %and a simulation model 'model.mat'
5 % and a simulation model 'model.mat'
7 6 % %
8 %run_entanglement_evaluation_simulation(simulation_dir, 'test') runs in test-mode
7 %run_entanglement_evaluation_simulation(simulation_dir, 'test') runs an evaluation
8 % over only the first 10 pulse pairs.
9 9 %run_entanglement_evaluation_simulation(simulation_dir, 'quick') runs an evaluation %run_entanglement_evaluation_simulation(simulation_dir, 'quick') runs an evaluation
10 10 % over only the first 1e3 pulse pairs. % over only the first 1e3 pulse pairs.
11 11 function [ev, model] = run_entanglement_evaluation_simulation(simulation_dir, varargin) function [ev, model] = run_entanglement_evaluation_simulation(simulation_dir, varargin)
12 12 assert_file_in_dir('setup_eval.m', simulation_dir); assert_file_in_dir('setup_eval.m', simulation_dir);
13 13 assert_file_in_dir('model.mat', simulation_dir); assert_file_in_dir('model.mat', simulation_dir);
14 14
15
16 test_mode = false;
17 quick_mode = false;
15 evaluation_mode = 'fulll'; % complete evalution
18 16 for k=1:length(varargin) for k=1:length(varargin)
19 17 switch varargin{k} switch varargin{k}
20 18 case 'test' case 'test'
21 test_mode = true;
19 evaluation_mode = 'test'; % ultraquick evaluation: 10 pulepairs only
22 20 case 'quick' case 'quick'
23 quick_mode = true;
21 evaluation_mode = 'quick'; % quick evaluation: 1e3 pulepairs only
24 22 otherwise otherwise
25 23 error('unrecognized varargin-argument'); error('unrecognized varargin-argument');
26 24 end end
27 25 end end
28 26
29 27 currenttime = datestr(now, 'yyyymmdd-HHMMSS'); currenttime = datestr(now, 'yyyymmdd-HHMMSS');
30 if test_mode
31 currenttime = 'test'
32 elseif quick_mode
33 currenttime = [currenttime, '_quick']
28 if ~isequal(evaluation_mode, 'normal')
29 currenttime = [currenttime, '_', evaluation_mode]
34 30 end end
35 31 mkdir(simulation_dir, currenttime); mkdir(simulation_dir, currenttime);
36 32 export_dir = fullfile(simulation_dir, currenttime); export_dir = fullfile(simulation_dir, currenttime);
 
... ... function [ev, model] = run_entanglement_evaluation_simulation(simulation_dir, va
40 36 to_log = @(string) append_string_to_txtfile(string, diary_file); to_log = @(string) append_string_to_txtfile(string, diary_file);
41 37
42 38 whereami = pwd; whereami = pwd;
43
44 addpath(genpath('/home/membrane/Documents/MATLAB/datoolbox'));
45 addpath(genpath('/home/membrane/Documents/MATLAB/optomechanics'));
46 39 cd(simulation_dir); cd(simulation_dir);
47 40
48 41 load('model.mat'); % load experiment-model 'model' load('model.mat'); % load experiment-model 'model'
 
... ... function [ev, model] = run_entanglement_evaluation_simulation(simulation_dir, va
56 49
57 50 save(fullfile(export_dir, 'model.mat'), 'model'); save(fullfile(export_dir, 'model.mat'), 'model');
58 51
59 theory_fig = figure; hold all;
60 plot(model.pulse_gammas, model.log_neg,...
61 'DisplayName', 'Singlemode theory with adiabatic elimination, noise-free');
62
63 gridxy(ev.pulse_gammas, 'Color',[0,0,0]+0.5,'Linestyle','-',...
64 'DisplayName', 'gammas for evaluation');
65
66 ylims = [max(-0.5, 1.1*min(real(model.log_neg))),...
67 1.1*max(real(model.log_neg))];
68 ylim(ylims);
69 xlim([0.5*min(model.pulse_gammas), 1.5*max(model.pulse_gammas)]);
70 set(gca,'xscale','log')
71
72 xlabel('Pulse gammas [Hz]');
73 ylabel('Logarithmic negativity');
74 legend('Location','Best');
75 gridxy([],0);
76 saveas(theory_fig, fullfile(export_dir, 'theory.fig'));
77 saveas(theory_fig, fullfile(export_dir, 'theory.jpg'));
78
79 52 ev.calculateModeVectors; %% calculate mode vectors ev.calculateModeVectors; %% calculate mode vectors
80 if test_mode
81 return
82 end
83 ev = calculate_entanglement(ev, quick_mode); %% run evaluation with current params
84
85 %% export simulation curve and evaluation results
86 simulation_fig = figure; hold all;
87 plot(model.pulse_gammas, model.log_neg,...
88 'DisplayName', 'Singlemode theory with adiabatic elimination, noise-free');
89
90 %gridxy(ev.pulse_gammas, 'Color',[0,0,0]+0.5,'Linestyle','-',...
91 % 'DisplayName', 'gammas for evaluation');
92
93 for ii = 1:ev.tracepairs_no
94 plot(ev.pulse_gammas, [ev.logneg_corrected{ii}{:}],'.',...
95 'DisplayName',['signal = ', num2str(ev.signal_power_muW(ii,1)),'muW']);
96 end
97 ylims = [max(-0.5, 1.1*min(real(model.log_neg))),...
98 2*max(real(model.log_neg))];
99 ylim(ylims);
100 xlim([0.5*min(ev.pulse_gammas), 1.5*max(ev.pulse_gammas)]);
101 set(gca,'xscale','log')
53 ev = calculate_entanglement(ev, evaluation_mode); %% run evaluation with current params
102 54
103 xlabel('Pulse gammas [Hz]');
104 ylabel('Logarithmic negativity');
105 legend('Location','Best');
106 title(export_dir);
107 gridxy([],0);
108 saveas(simulation_fig, fullfile(export_dir, 'simulation.fig'));
109 saveas(simulation_fig, fullfile(export_dir, 'simulation.jpg'));
110
111 %%export data
55 %% export plots and data
56 export_simulation_plot(ev, model, export_dir)
112 57 ev.exportResults; ev.exportResults;
113 58 dlmwrite(fullfile(export_dir, 'theory.csv'),([model.pulse_gammas; model.log_neg]')); dlmwrite(fullfile(export_dir, 'theory.csv'),([model.pulse_gammas; model.log_neg]'));
114 59
 
... ... end
118 63
119 64
120 65 %% AUX FUNCTIONS %% %% AUX FUNCTIONS %%
121 function ev = calculate_entanglement(ev, quick_mode)
66 function ev = calculate_entanglement(ev, evaluation_mode)
122 67 %% calculate quadratures %% calculate quadratures
123 68 tic tic
124 69 for i=1:ev.tracepairs_no for i=1:ev.tracepairs_no
125 70 disp(''); disp('');
126 71 disp('***************'); disp('***************');
127 72 disp(['calculating quadratures for P=',num2str(ev.signal_power_muW(i,1)),'muW']); disp(['calculating quadratures for P=',num2str(ev.signal_power_muW(i,1)),'muW']);
128 if quick_mode
129 ev.calculatePulsedQuadratures(i, 'pulsepairs', 1e3);
130 else
73 if isequal(evaluation_mode, 'normal')
131 74 ev.calculatePulsedQuadratures(i); ev.calculatePulsedQuadratures(i);
75 elseif isequal(evaluation_mode, 'quick')
76 ev.calculatePulsedQuadratures(i, 'pulsepairs', 1e3);
77 elseif isequal(evaluation_mode, 'test')
78 ev.calculatePulsedQuadratures(i, 'pulsepairs', 10);
132 79 end end
133 80 end end
134 81 toc toc
 
... ... function ev = calculate_entanglement(ev, quick_mode)
151 98 ev.calibratePulsedCMs; ev.calibratePulsedCMs;
152 99 toc toc
153 100 end end
101
102 function export_simulation_plot(ev, model, export_dir)
103 simulation_fig = figure; hold all;
104 plot(model.pulse_gammas, model.log_neg,...
105 'DisplayName', 'Singlemode theory with adiabatic elimination, noise-free');
106 %gridxy(ev.pulse_gammas, 'Color',[0,0,0]+0.5,'Linestyle','-',...
107 % 'DisplayName', 'gammas for evaluation');
108
109 for ii = 1:ev.tracepairs_no
110 plot(ev.pulse_gammas, [ev.logneg_corrected{ii}{:}],'.',...
111 'DisplayName',['signal = ', num2str(ev.signal_power_muW(ii,1)),'muW']);
112 end
113 ylims = [max(-0.5, 1.1*min(real(model.log_neg))),...
114 2*max(real(model.log_neg))];
115 ylim(ylims);
116 xlim([0.5*min(ev.pulse_gammas), 1.5*max(ev.pulse_gammas)]);
117 set(gca,'xscale','log')
118
119 xlabel('Pulse gammas [Hz]');
120 ylabel('Logarithmic negativity');
121 legend('Location','Best');
122 parentfolders = regexp(export_dir, filesep, 'split');
123 title([parentfolders{end-1}, 10, parentfolders{end}], 'interpreter', 'none');
124 gridxy([],0);
125 saveas(simulation_fig, fullfile(export_dir, 'simulation.fig'));
126 saveas(simulation_fig, fullfile(export_dir, 'simulation.jpg'));
127 end
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/gutc61/Membrane

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/gutc61/Membrane

Clone this repository using git:
git clone git://git.rocketgit.com/user/gutc61/Membrane

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main