diff options
-rw-r--r-- | psr/make_representative_psr_vs_detuning_for_given_B_and_psi_el.m | 53 | ||||
-rw-r--r-- | psr/output_psr_results_vs_detuning.m | 9 | ||||
-rw-r--r-- | psr/output_psr_results_vs_power.m | 70 | ||||
-rw-r--r-- | psr/psr_vs_detuning.m | 2 | ||||
-rw-r--r-- | psr/psr_vs_detuning_combo.m | 40 | ||||
-rw-r--r-- | psr/psr_vs_power.m | 147 | ||||
-rw-r--r-- | psr/rb87_D1_line.m | 2 |
7 files changed, 312 insertions, 11 deletions
diff --git a/psr/make_representative_psr_vs_detuning_for_given_B_and_psi_el.m b/psr/make_representative_psr_vs_detuning_for_given_B_and_psi_el.m new file mode 100644 index 0000000..9627b8a --- /dev/null +++ b/psr/make_representative_psr_vs_detuning_for_given_B_and_psi_el.m @@ -0,0 +1,53 @@ +function ... + [ ... + psr_rad_tnEp_pos_el, psr_rad_tnEp_neg_el, ... + psr_rad_smEp_pos_el, psr_rad_smEp_neg_el, ... + psr_rad_lgEp_pos_el, psr_rad_lgEp_neg_el, ... + psr_rad_grEp_pos_el, psr_rad_grEp_neg_el ... + ] =make_representative_psr_vs_detuning_for_given_B_and_psi_el(detuning_freq, B_field, psi_el, theta, phi) + %%%%%%%%%%%%%%%%%%%%% + %printf("%f\n", B_field); + Ep=sqrt(0.01); + [psr_rad_tnEp_pos_el]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, phi) ; + [psr_rad_tnEp_neg_el]=psr_vs_detuning(detuning_freq, Ep,-psi_el, B_field, theta, phi) ; + + Ep=sqrt(0.1); + [psr_rad_smEp_pos_el]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, phi) ; + [psr_rad_smEp_neg_el]=psr_vs_detuning(detuning_freq, Ep,-psi_el, B_field, theta, phi) ; + + Ep=sqrt(1.0); + [psr_rad_lgEp_pos_el]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, phi) ; + [psr_rad_lgEp_neg_el]=psr_vs_detuning(detuning_freq, Ep,-psi_el, B_field, theta, phi) ; + + Ep=sqrt(10.0); + [psr_rad_grEp_pos_el]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, phi) ; + [psr_rad_grEp_neg_el]=psr_vs_detuning(detuning_freq, Ep,-psi_el, B_field, theta, phi) ; + + + figure(6); + plot ( ... + detuning_freq, psr_rad_tnEp_pos_el, '-;tn,pos el;' + , detuning_freq, psr_rad_tnEp_neg_el, '-;tn,neg el;' + , detuning_freq, psr_rad_smEp_pos_el, '-;sm,pos el;' + , detuning_freq, psr_rad_smEp_neg_el, '-;sm,neg el;' + , detuning_freq, psr_rad_lgEp_pos_el, '-;lg,pos el;' + , detuning_freq, psr_rad_lgEp_neg_el, '-;lg,neg el;' + , detuning_freq, psr_rad_grEp_pos_el, '-;gr,pos el;' + , detuning_freq, psr_rad_grEp_neg_el, '-;gr,neg el;' + ); + + str_title=sprintf("PSR. B field=%.5f Gauss, ellipticity=%.2f rad, theta=%.2f, phi=%.2f", B_field, psi_el, theta, phi); + title(str_title); + xlabel('detuning, MHz'); + ylabel('PSR, radians'); + fname=strcat('results/',str_title, '.pdf'); + print(fname); + fname=strcat('results/',str_title, '.mat'); + save(fname, ... + 'detuning_freq', 'B_field', 'theta', 'phi', 'psi_el', ... + 'psr_rad_tnEp_pos_el', 'psr_rad_tnEp_neg_el', ... + 'psr_rad_smEp_pos_el', 'psr_rad_smEp_neg_el', ... + 'psr_rad_lgEp_pos_el', 'psr_rad_lgEp_neg_el', ... + 'psr_rad_grEp_pos_el', 'psr_rad_grEp_neg_el' ); + +endfunction diff --git a/psr/output_psr_results_vs_detuning.m b/psr/output_psr_results_vs_detuning.m index cf71711..93912ae 100644 --- a/psr/output_psr_results_vs_detuning.m +++ b/psr/output_psr_results_vs_detuning.m @@ -1,6 +1,4 @@ -1; - - +function psr_rad=output_psr_results_vs_detuning() load '/tmp/xi_vs_detuning.mat' ; Er=(1+I*xi_right)*E_field_pos_freq.right; @@ -48,13 +46,14 @@ 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 MHz", I_probe, psi_el*180/pi, B_field); +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=%.3fMHz.mat", I_probe, psi_el*180/pi,B_field); +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; diff --git a/psr/output_psr_results_vs_power.m b/psr/output_psr_results_vs_power.m new file mode 100644 index 0000000..2d28565 --- /dev/null +++ b/psr/output_psr_results_vs_power.m @@ -0,0 +1,70 @@ +1; + + +load '/tmp/xi_vs_power.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(Ep.^2, real(xi_left-xi_right), '-'); +title("differential real xi"); +xlabel("two photon detuning"); + +figure(2); +hold off; +plot(Ep.^2, imag(xi_left-xi_right), '-'); +title("differential imag xi"); +xlabel("two photon detuning"); + +figure(3); +hold off; +plot(Ep.^2, imag(xi_left), '-', Ep, imag(xi_right), '-'); +title("imag xi"); +xlabel("two photon detuning"); + +figure(4); +hold off; +plot(Ep.^2, real(xi_left), '-', Ep.^2, real(xi_right), '-'); +title("real xi"); +xlabel("two photon detuning"); + +figure(5); +hold off; +%plot(Ep.^2, (Ipos-Ineg), '-'); +semilogx(Ep.^2, (Ipos-Ineg), '-'); +%semilogx(Ep.^2, (Ipos-Ineg)./(Ep.^2), '-'); +title("BPD signal xi"); +xlabel("two photon detuning"); + +%figure(1); + %hold off; + %plot(detuning_freq, imag(xi_linear), '-1;linear;'); + %hold on; + %plot(detuning_freq, imag(xi_left), '-2;left;'); + %plot(detuning_freq, imag(xi_right), '-3;right;'); + %title("probe absorption"); + %hold off; +%figure(2); + %hold off; + %plot(detuning_freq, real(xi_linear), '-1;linear;'); + %hold on; + %plot(detuning_freq, real(xi_left), '-2;left;'); + %plot(detuning_freq, real(xi_right), '-3;right;'); + %title("probe dispersion"); + %hold off; + diff --git a/psr/psr_vs_detuning.m b/psr/psr_vs_detuning.m index c293d02..acf7d43 100644 --- a/psr/psr_vs_detuning.m +++ b/psr/psr_vs_detuning.m @@ -45,7 +45,7 @@ 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 -neef_update=false; +need_update=false; [s, err_p, msg] = stat (pfile); if(err_p) %file does not exist diff --git a/psr/psr_vs_detuning_combo.m b/psr/psr_vs_detuning_combo.m index 2e8921d..1016a82 100644 --- a/psr/psr_vs_detuning_combo.m +++ b/psr/psr_vs_detuning_combo.m @@ -13,12 +13,46 @@ B_field=zeeman_splitting/gmg; %[psr_rad]=psr_vs_detuning(Ep, psi_el, B_field, theta, phi) % phi is angle between linear polarization and axis x -phi=pi*2/8; +phi=pi/4; % 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; -Ep=0.2; -[psr_rad]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, phi) ; + +figure(6); +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 +% zero magnetic field,, 30 degree ellipticity +zeeman_splitting=+0.000; +B_field=zeeman_splitting/gmg; +psi_el=30/180*pi; + +[psr_rad_tnEp_pos_el, psr_rad_tnEp_neg_el, psr_rad_smEp_pos_el, psr_rad_smEp_neg_el, psr_rad_lgEp_pos_el, psr_rad_lgEp_neg_el, psr_rad_grEp_pos_el, psr_rad_grEp_neg_el] =make_representative_psr_vs_detuning_for_given_B_and_psi_el(detuning_freq, B_field, psi_el, theta, phi); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 +% 0.1 G magnetic field,, 30 degree ellipticity + +zeeman_splitting=+0.070; +B_field=zeeman_splitting/gmg; +psi_el=30/180*pi; + +[psr_rad_tnEp_pos_el, psr_rad_tnEp_neg_el, psr_rad_smEp_pos_el, psr_rad_smEp_neg_el, psr_rad_lgEp_pos_el, psr_rad_lgEp_neg_el, psr_rad_grEp_pos_el, psr_rad_grEp_neg_el] =make_representative_psr_vs_detuning_for_given_B_and_psi_el(detuning_freq, B_field, psi_el, theta, phi); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 +% 0.0001 G magnetic field,, 30 degree ellipticity + +zeeman_splitting=+0.000070; +B_field=zeeman_splitting/gmg; +psi_el=30/180*pi; + +[psr_rad_tnEp_pos_el, psr_rad_tnEp_neg_el, psr_rad_smEp_pos_el, psr_rad_smEp_neg_el, psr_rad_lgEp_pos_el, psr_rad_lgEp_neg_el, psr_rad_grEp_pos_el, psr_rad_grEp_neg_el] =make_representative_psr_vs_detuning_for_given_B_and_psi_el(detuning_freq, B_field, psi_el, theta, phi); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 +% 1.0 G magnetic field,, 30 degree ellipticity + +zeeman_splitting=+0.70; +B_field=zeeman_splitting/gmg; +psi_el=30/180*pi; + +[psr_rad_tnEp_pos_el, psr_rad_tnEp_neg_el, psr_rad_smEp_pos_el, psr_rad_smEp_neg_el, psr_rad_lgEp_pos_el, psr_rad_lgEp_neg_el, psr_rad_grEp_pos_el, psr_rad_grEp_neg_el] =make_representative_psr_vs_detuning_for_given_B_and_psi_el(detuning_freq, B_field, psi_el, theta, phi); diff --git a/psr/psr_vs_power.m b/psr/psr_vs_power.m new file mode 100644 index 0000000..97b9fab --- /dev/null +++ b/psr/psr_vs_power.m @@ -0,0 +1,147 @@ +1; +clear all; +t0 = clock (); % we will use this latter to calculate elapsed time + + +% load useful functions; +useful_functions; + +% some physical constants +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); + + + +%tune probe frequency +detuning_p=0; +N_detun_steps=100; +%detuning_p_min=-B_field*gmg*4; % span +/-4 Zeeman splitting +detuning_p_min=-200.0; +detuning_p_max=-detuning_p_min; +detuning_p_max=1000; +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); +pfile='rb87_D1_line.m'; % the parent file from which L0_and_polarization_submatrices calculated +cfile='L0m_and_polarizability_calculated.mat'; % the child file to which calculated matrices writen +[s, err, msg] = stat (pfile); +if(err) + %file does not exist + disp('Big troubles are coming, no file to define Hamiltonian)'); + msg=cstrcat('File: ', pfile, ' is missing...exiting'); + disp(msg); + return; +else + pfile_mtime=s.mtime; +endif +[s, err, msg] = stat (cfile); +if(err) + %file does not exist + cfile_mtime=0; +else + cfile_mtime=s.mtime; +endif; +if ( cfile_mtime >= pfile_mtime) + % matrices already calculated and up to date, all we need to load them + load(cfile); + else + % 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 ... + ); + 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; + + +% 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=-5/180*pi; + + + +fprintf (stderr, "tuning laser in forloop to set conditions vs detuning\n"); +fflush (stderr); +wp=w_pf1-w_sf2 +80; %Fg=2 -> Fe=1 +80 MHz +Ep=logspace(-2,1,100); +for cntr=1:length(Ep); + + %light_positive_freq = [wp]; + E_field_drive = [0 ]; + E_field_probe = [Ep(cntr) ]; + 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; + + % 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); + % we add required ellipticity + E_field_lab_pos_freq.x*=exp(I*psi_el); + E_field_lab_pos_freq.y*=exp(-I*psi_el); + E_field_lab_pos_freq.z=E_field_zero; + + E_field_pos_freq=xyz_lin2atomic_axis_polarization(theta, E_field_lab_pos_freq); + + + light_positive_freq=[ wp]; + % we calculate dc and negative frequiencies 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); + 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{cntr}=atom_field_problem; + +endfor + +save '/tmp/problem_definition.mat' problems_cell_array atom_properties Ep ; +fprintf (stderr, "now really hard calculations begin\n"); +fflush (stderr); +% once we define all problems the main job is done here +[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_power.mat' Ep xi_linear xi_left xi_right E_field_pos_freq wp; + +%output_psr_results_vs_detuning; +output_psr_results_vs_power; + +elapsed_time = etime (clock (), t0) + +% vim: ts=2:sw=2:fdm=indent diff --git a/psr/rb87_D1_line.m b/psr/rb87_D1_line.m index ecdd6a3..74a52f0 100644 --- a/psr/rb87_D1_line.m +++ b/psr/rb87_D1_line.m @@ -30,8 +30,6 @@ w_pf2 = w_pf1+w_hpf_exited; %Distance from |S,F=1> to |P,F=2> gmg=.7; % gyro magnetic ration for ground level gme=.23; % gyro magnetic ration for exited level % CHECKME -zeeman_splitting=0.0; -B_field=zeeman_splitting/gmg; %bottom level |F=1> levels( 1)=struct( "ang_momentum", 0, "total_momentum", 1, "m", -1, "energy", 0, "gm", -gmg); |