summaryrefslogtreecommitdiff
path: root/compass.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2010-01-12 22:16:06 +0000
committerEugeniy Mikhailov <evgmik@gmail.com>2010-01-12 22:16:06 +0000
commit97c16478c617405d5c7e8e2e8fc7511fd0904709 (patch)
tree0491631c02d32e8ae6b8a080aeef971dfc6fd8e0 /compass.m
parent44edaf08dbbd1ae86d7281a9b3a8d759b8d86fcf (diff)
downloadmulti_mode_eit-97c16478c617405d5c7e8e2e8fc7511fd0904709.tar.gz
multi_mode_eit-97c16478c617405d5c7e8e2e8fc7511fd0904709.zip
added code for compass signals output
Diffstat (limited to 'compass.m')
-rw-r--r--compass.m132
1 files changed, 132 insertions, 0 deletions
diff --git a/compass.m b/compass.m
new file mode 100644
index 0000000..1970ac7
--- /dev/null
+++ b/compass.m
@@ -0,0 +1,132 @@
+1;
+clear all;
+t0 = clock (); % we will use this latter to calculate elapsed time
+
+
+% load useful functions;
+useful_functions;
+
+% some physical constants
+useful_constants;
+
+% load atom energy levels and decay description
+rb87_D1_line;
+%four_levels_with_polarization;
+%four_levels;
+%three_levels;
+%two_levels;
+
+% load EM field description
+field_description;
+
+%Nfreq=length(modulation_freq);
+
+
+
+%tune probe frequency
+detuning_p=0;
+N_detun_steps=100;
+detuning_p_min=-B_field*gmg*4; % span +/-4 Zeeman splitting
+detuning_p_max=-detuning_p_min;
+detuning_freq=zeros(1,N_detun_steps+1);
+kappa_p =zeros(1,N_detun_steps+1);
+kappa_m =zeros(1,N_detun_steps+1);
+detun_step=(detuning_p_max-detuning_p_min)/N_detun_steps;
+
+fprintf (stderr, "calculating atom properties\n");
+fflush (stderr);
+% calculate E_field independent properties of the atom
+% to be used as sub matrix templates for Liouville operator matrix
+[L0m, polarizability_m]=L0_and_polarization_submatrices( ...
+ Nlevels, ...
+ H0, g_decay, g_dephasing, dipole_elements ...
+ );
+elapsed_time = etime (clock (), t0);
+fprintf (stderr, "elapsed time so far is %.3f sec\n",elapsed_time);
+fflush (stderr);
+
+global atom_properties;
+atom_properties.L0m=L0m;
+atom_properties.polarizability_m=polarizability_m;
+atom_properties.dipole_elements=dipole_elements;
+
+%modulation_freq=[0, wp, wd, -wp, -wd, wp-wd, wd-wp];
+E_field_drive =[0, 0 , Ed, 0 , Edc, 0, 0 ];
+E_field_probe =[0, Ep, 0 , Epc, 0 , 0, 0 ];
+E_field_zero =[0, 0 , 0 , 0 , 0 , 0, 0 ];
+E_field_lab.linear = E_field_zero + (1.00000+0.00000i)*E_field_probe + (1.00000+0.00000i)*E_field_drive;
+E_field_lab.right = E_field_zero + (0.00000+0.00000i)*E_field_probe + (0.00000+0.00000i)*E_field_drive;
+E_field_lad.left = E_field_zero + (0.00000+0.00000i)*E_field_probe + (0.00000+0.00000i)*E_field_drive;
+
+% phi is angle between linear polarization and axis x
+phi=pi*2/8;
+% theta is angle between lab z axis (light porpagation dirextion) and magnetic field axis (z')
+theta=pi/2;
+
+% we define light as linearly polarized
+E_field_lab.x=cos(phi)*E_field_lab.linear;
+E_field_lab.y=sin(phi)*E_field_lab.linear;
+E_field_lab.z=E_field_zero;
+
+basis_transformation; % load subroutines
+coord_transf_m = lin2circ * oldlin2newlin(theta);
+E_field.right = coord_transf_m(1,1)*E_field_lab.x + coord_transf_m(1,2)*E_field_lab.y + coord_transf_m(1,3)*E_field_lab.z;
+E_field.left = coord_transf_m(2,1)*E_field_lab.x + coord_transf_m(2,2)*E_field_lab.y + coord_transf_m(2,3)*E_field_lab.z;
+E_field.linear = coord_transf_m(3,1)*E_field_lab.x + coord_transf_m(3,2)*E_field_lab.y + coord_transf_m(3,3)*E_field_lab.z;
+
+
+fprintf (stderr, "tuning laser in forloop to set conditions vs detuning\n");
+fflush (stderr);
+
+detuning_freq=[-.75, -.5, -.25, 0 , .25, .5 , .75, 1.0];
+
+problem_cntr=1;
+N_angle_steps=5;
+min_angle=0; max_angle=pi/2;
+for theta=min_angle:((max_angle-min_angle)/N_angle_steps):max_angle;
+ for detuning_p_cntr=1:length(detuning_freq);
+ coord_transf_m = lin2circ * oldlin2newlin(theta);
+ E_field.right = coord_transf_m(1,1)*E_field_lab.x + coord_transf_m(1,2)*E_field_lab.y + coord_transf_m(1,3)*E_field_lab.z;
+ E_field.left = coord_transf_m(2,1)*E_field_lab.x + coord_transf_m(2,2)*E_field_lab.y + coord_transf_m(2,3)*E_field_lab.z;
+ E_field.linear = coord_transf_m(3,1)*E_field_lab.x + coord_transf_m(3,2)*E_field_lab.y + coord_transf_m(3,3)*E_field_lab.z;
+
+ wp0=w_pf1;
+ wd=w_pf1-w_hpf_ground;
+ detuning_p=detuning_p_min+detun_step*(detuning_p_cntr-1);
+ detuning_p=detuning_freq(detuning_p_cntr);
+ wp=wp0+detuning_p;
+ wm=wd-(wp-wd);
+ %modulation_freq=[0, wp, wd, wm, -wp, -wd, -wm, wp-wd, wd-wp];
+ modulation_freq=[0, wp, wd, -wp, -wd, wp-wd, wd-wp];
+ freq_index=freq2index(wp,modulation_freq);
+
+ atom_field_problem.E_field = E_field;
+ atom_field_problem.modulation_freq = modulation_freq;
+ atom_field_problem.freq_index = freq_index;
+
+ problems_cell_array{problem_cntr}=atom_field_problem;
+ problem_cntr++;
+
+
+ %kappa_p(detuning_p_cntr)=susceptibility_steady_state_at_freq( atom_field_problem);
+ endfor
+endfor
+
+save 'problem_definition.mat' problems_cell_array atom_properties detuning_freq ;
+fprintf (stderr, "now really hard calculations begin\n");
+fflush (stderr);
+% once we define all problems the main job is done here
+%kappa_p=cellfun( @susceptibility_steady_state_at_freq, problems_cell_array);
+%kappa_p=parcellfun(2, @susceptibility_steady_state_at_freq, problems_cell_array);
+%[xi_linear, xi_left, xi_right]=parcellfun(2, @susceptibility_steady_state_at_freq, problems_cell_array);
+total_absorption_vs_detuning=parcellfun(2, @total_field_absorption, problems_cell_array);
+
+%save 'xi_vs_detuning.mat' detuning_freq xi_linear xi_left xi_right ;
+problem_cntr--;
+save 'total_absorption_vs_detuning.mat' detuning_freq total_absorption_vs_detuning theta problem_cntr;
+
+compass_output_results;
+
+elapsed_time = etime (clock (), t0)
+
+% vim: ts=2:sw=2:fdm=indent