summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-11-15 23:30:03 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2020-09-21 16:29:52 -0400
commit4c4d562bc5c87deb828ede01a27b3fa9132f580e (patch)
tree5d9482a4a75b121e32325797e7310d099d8727f0
parentdad02a2d28e3ba0b2dee4c70d724f5588e5d4737 (diff)
downloadmulti_mode_eit-4c4d562bc5c87deb828ede01a27b3fa9132f580e.tar.gz
multi_mode_eit-4c4d562bc5c87deb828ede01a27b3fa9132f580e.zip
initial changes
-rw-r--r--faraday/faraday_vs_B.m141
-rw-r--r--faraday/output_faraday_results_vs_B.m59
2 files changed, 120 insertions, 80 deletions
diff --git a/faraday/faraday_vs_B.m b/faraday/faraday_vs_B.m
index acf7d43..11ba11b 100644
--- a/faraday/faraday_vs_B.m
+++ b/faraday/faraday_vs_B.m
@@ -1,6 +1,6 @@
-function [psr_rad]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, phi)
-% calculates psr in rad vs detunings of the probe field
-% for given laser probe and B field.
+function [psr_rad]=faraday_vs_B(detuning_freq, Ep, psi_el, B_fields, theta, phi)
+% calculates transmission if light polarizations vs B field in the cell
+% for given laser probe and B fields array
% Probe field defined by field strength (Ep) and ellipticity angle (pse_el)
% Magnetic field defined by magnitude (B_field) and angles theta and phi.
%
@@ -9,6 +9,11 @@ function [psr_rad]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, ph
t0 = clock (); % we will use this latter to calculate elapsed time
+%tune probe frequency
+detuning_p=0;
+N_steps=length(B_fields)
+kappa_p =zeros(1,N_steps+1);
+kappa_m =zeros(1,N_steps+1);
% load useful functions;
useful_functions;
@@ -18,36 +23,22 @@ useful_constants;
basis_transformation; % load subroutines
-% 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);
+fprintf (stderr, "tuning laser in forloop to set conditions vs detuning\n");
+fflush (stderr);
+for B_field_cntr=1:N_steps;
+ B_field=B_fields(B_field_cntr);
+ % load atom energy levels and decay description
+ rb87_D1_line;
-%tune probe frequency
-detuning_p=0;
-%detuning_p_min=-B_field*gmg*4; % span +/-4 Zeeman splitting
-%detuning_freq=zeros(1,N_detun_steps+1);
-N_detun_steps=length(detuning_freq);
-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);
-pfile='atomic_B_field.mat'; % the parent file where B_field is stored. This is the parameter for calculated L0_and_polarization_submatrices
-cfile='L0m_and_polarizability_calculated.mat'; % the child file to which calculated matrices are written
-need_update=false;
-[s, err_p, msg] = stat (pfile);
-if(err_p)
+ fprintf (stderr, "calculating atom properties\n");
+ fflush (stderr);
+ pfile='atomic_B_field.mat'; % the parent file where B_field is stored. This is the parameter for calculated L0_and_polarization_submatrices
+ cfile='L0m_and_polarizability_calculated.mat'; % the child file to which calculated matrices are written
+ need_update=false;
+ [s, err_p, msg] = stat (pfile);
+ if(err_p)
%file does not exist
need_update=true;
else
@@ -60,14 +51,15 @@ if(err_p)
else
need_update=false;
endif
-endif
-
-[s, err, msg] = stat (cfile);
-if(err)
- %file does not exist
- need_update=true;
-endif;
-if ( !need_update)
+ endif
+
+ [s, err, msg] = stat (cfile);
+ if(err)
+ %file does not exist
+ need_update=true;
+ endif;
+
+ if ( !need_update)
% matrices already calculated and up to date, all we need to load them
load(cfile);
else
@@ -80,32 +72,31 @@ if ( !need_update)
save(pfile, 'B_field');
save(cfile, 'L0m', 'polarizability_m');
endif
-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;
-
-%light_positive_freq = [wp];
-E_field_drive = [0 ];
-E_field_probe = [Ep ];
-E_field_zero = [0 ];
-E_field_lab_pos_freq.linear = E_field_zero + (1.00000+0.00000i)*E_field_probe + (1.00000+0.00000i)*E_field_drive;
-%E_field_lab_pos_freq.right = E_field_zero + (0.00000+0.00000i)*E_field_probe + (0.00000+0.00000i)*E_field_drive;
-%E_field_lab_pos_freq.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 propagation direction) and magnetic field axis (z')
-%theta=0;
-% psi_el is the ellipticity parameter (phase difference between left and right polarization)
-%psi_el=-30/180*pi;
-
-% we define light as linearly polarized
-% where phi is angle between light polarization and axis x
+ 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;
+
+ %light_positive_freq = [wp];
+ E_field_drive = [0 ];
+ E_field_probe = [Ep ];
+ E_field_zero = [0 ];
+ E_field_lab_pos_freq.linear = E_field_zero + (1.00000+0.00000i)*E_field_probe + (1.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 propagation direction) and magnetic field axis (z')
+ %theta=0;
+ % psi_el is the ellipticity parameter (phase difference between left and right polarization)
+ %psi_el=-30/180*pi;
+
+ % we define light as linearly polarized
+ % where phi is angle between light polarization and axis x
% only sign of modulation frequency is important now
% we define actual frequency later on
[E_field_lab_pos_freq.x, E_field_lab_pos_freq.y] = rotXpolarization(phi, E_field_lab_pos_freq.linear);
@@ -117,30 +108,21 @@ E_field_lab_pos_freq.linear = E_field_zero + (1.00000+0.00000i)*E_field_probe +
E_field_pos_freq=xyz_lin2atomic_axis_polarization(theta, E_field_lab_pos_freq);
-fprintf (stderr, "tuning laser in forloop to set conditions vs detuning\n");
-fflush (stderr);
-for detuning_p_cntr=1:length(detuning_freq);
wp0=w_pf1-w_sf2; %Fg=2 -> Fe=1
- %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;
+ wp=wp0;
light_positive_freq=[ wp];
- % we calculate dc and negative frequiencies as well as amplitudes
+ % we calculate dc and negative frequencies as well as amplitudes
[modulation_freq, E_field] = ...
- light_positive_frequencies_and_amplitudes2full_set_of_modulation_frequencies_and_amlitudes(...
- light_positive_freq, E_field_pos_freq);
+ light_positive_frequencies_and_amplitudes2full_set_of_modulation_frequencies_and_amlitudes(...
+ light_positive_freq, E_field_pos_freq);
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{detuning_p_cntr}=atom_field_problem;
-
+ problems_cell_array{B_field_cntr}=atom_field_problem;
- %kappa_p(detuning_p_cntr)=susceptibility_steady_state_at_freq( atom_field_problem);
- %detuning_freq(detuning_p_cntr)=detuning_p;
endfor
save '/tmp/problem_definition.mat' problems_cell_array atom_properties detuning_freq ;
@@ -150,10 +132,9 @@ fflush (stderr);
[xi_linear, xi_left, xi_right]=parcellfun(2, @susceptibility_steady_state_at_freq, problems_cell_array);
%[xi_linear, xi_left, xi_right]=cellfun( @susceptibility_steady_state_at_freq, problems_cell_array);
-%save '/tmp/relative_transmission_vs_detuning.mat' detuning_freq relative_transmission_vs_detuning;
-save '/tmp/xi_vs_detuning.mat' detuning_freq xi_linear xi_left xi_right E_field_pos_freq E_field_probe B_field psi_el;
+save '/tmp/xi_vs_B.mat' detuning_freq xi_linear xi_left xi_right E_field_pos_freq E_field_probe B_field psi_el;
-psr_rad=output_psr_results_vs_detuning;
+psr_rad=output_faraday_results_vs_B;
elapsed_time = etime (clock (), t0)
return
diff --git a/faraday/output_faraday_results_vs_B.m b/faraday/output_faraday_results_vs_B.m
new file mode 100644
index 0000000..96e0a5e
--- /dev/null
+++ b/faraday/output_faraday_results_vs_B.m
@@ -0,0 +1,59 @@
+function psr_rad=output_faraday_results_vs_B()
+load '/tmp/xi_vs_B.mat' ;
+
+Er=(1+I*xi_right)*E_field_pos_freq.right;
+El=(1+I*xi_left) *E_field_pos_freq.left;
+
+Ex=(Er+El)/sqrt(2);
+Ey=I*(Er-El)/sqrt(2);
+
+%extra rotation to compensate rotation due to ellipticity
+% actually no need for it since x-polarization shifts by positive phase
+% and y-pol by negative phase
+%el_rot=0*psi_el;
+%Ex=cos(el_rot)*Ex-sin(el_rot)*Ey;
+%Ey=sin(el_rot)*Ex+cos(el_rot)*Ey;
+
+Ipos=(abs(Ey).^2)/2;
+Ineg=(abs(Ex).^2)/2;
+
+figure(1);
+hold off;
+plot(detuning_freq, real(xi_left-xi_right), '-');
+title("differential real xi");
+xlabel("two photon detuning (MHz)");
+
+figure(2);
+hold off;
+plot(detuning_freq, imag(xi_left-xi_right), '-');
+title("differential imag xi");
+xlabel("two photon detuning (MHz)");
+
+figure(3);
+hold off;
+plot(detuning_freq, real(xi_left), '-', detuning_freq, real(xi_right), '-');
+title("real xi");
+xlabel("two photon detuning (MHz)");
+
+figure(4);
+hold off;
+plot(detuning_freq, imag(xi_left), '-', detuning_freq, imag(xi_right), '-');
+title("imag xi");
+xlabel("two photon detuning (MHz)");
+
+figure(5);
+hold off;
+I_probe=E_field_probe^2;
+psr_rad=(Ipos-Ineg)/(2*I_probe);
+plot(detuning_freq, psr_rad, '-');
+subt_str=sprintf("Laser Rabi freq normalized to upper state decay %.3f, ellipticity %.1f degree, \n B field ground level splitting %.3f Gauss", I_probe, psi_el*180/pi, B_field);
+title(cstrcat("BPD normilized PSR signal at F_g=2 to F_e=1,2.\n ",subt_str) );
+xlabel("two photon detuning (MHz)");
+ylabel("PSR (radians)");
+
+print("psr_vs_detuning.ps");
+
+fname= sprintf("psr_vs_detuning_Fg=2toFe=1,2_Ip=%.3f_el_%.1f_B=%.3fG.mat", I_probe, psi_el*180/pi,B_field);
+save(fname,'detuning_freq', 'psr_rad');
+
+return;