From 1f1c3ba4520e8899eb5a3257e47dd08899c53c41 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Tue, 29 Sep 2020 11:09:08 -0400 Subject: added code for lin EIT vs theta --- compass_lin_extrema_vs_theta.m | 155 ++++++++++++++++++++++++++ compass_lin_extrema_vs_theta_output_results.m | 87 +++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 compass_lin_extrema_vs_theta.m create mode 100644 compass_lin_extrema_vs_theta_output_results.m diff --git a/compass_lin_extrema_vs_theta.m b/compass_lin_extrema_vs_theta.m new file mode 100644 index 0000000..1c90f8c --- /dev/null +++ b/compass_lin_extrema_vs_theta.m @@ -0,0 +1,155 @@ +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_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; + +%Ed=.1; Edc=conj(Ed); +%Ep=0.8*Ed; Epc=conj(Ep); + +%light_positive_freq = [wp, wd, wp-wd]; +E_field_drive = [0 , Ed, 0 ]; +E_field_probe = [Ep, 0 , 0 ]; +E_field_zero = [0 , 0 , 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/4; +% theta is angle between lab z axis (light propagation direction) and magnetic field axis (z') +theta=pi/2; +%theta=65/180*pi; + +%small ellipticity angle psi (0 to pi/2) +% 0 will give linear polarization +% pi/4 circular polarization +%psi_el=pi/4; +%psi_el=.2*pi/4; +psi_el=0.0*pi/4; + + + + + +fprintf (stderr, "tuning laser in forloop to set conditions vs detuning\n"); +fflush (stderr); + +detuning_freq=[-.075, -.05, -.025, 0 , .025, .05 , .075, .1]; + +problem_cntr=1; +N_angle_steps=31; +min_angle=0; max_angle=pi; +thetas=min_angle:((max_angle-min_angle)/N_angle_steps):max_angle; +for theta=thetas; + for detuning_p_cntr=1:length(detuning_freq); + + wp0=w_pf1; + wd=w_pf1-w_hpf_ground; + detuning_p=detuning_freq(detuning_p_cntr); + wp=wp0+detuning_p; + wm=wd-(wp-wd); + + light_positive_freq=[ wp, wd, wp-wd]; + % we define light as linearly polarized along x + E_field_lab_pos_freq.x = E_field_lab_pos_freq.linear; + E_field_lab_pos_freq.y = 0; + % now we add small elasticity + E_field_lab_pos_freq.y=sin(psi_el)*E_field_lab_pos_freq.x*(1i); % order is important + E_field_lab_pos_freq.x=cos(psi_el)*E_field_lab_pos_freq.x; + % set phi angle between light polarization and axis x + [E_field_lab_pos_freq.x, E_field_lab_pos_freq.y] = rotLinPolarization(phi, E_field_lab_pos_freq.x, E_field_lab_pos_freq.y); + E_field_lab_pos_freq.z=E_field_zero; + + + % now we transfor x,y,z, to x',y', and z' with respect to magnetic field az z' axis + E_field_pos_freq=xyz_lin2atomic_axis_polarization(theta, E_field_lab_pos_freq); + + % 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); + + 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 '/tmp/problem_definition.mat' problems_cell_array atom_properties detuning_freq theta; +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); +% strangely parcell is slower than cellfun 20 seconds vs 29 +%total_relative_transmission_vs_phi=parcellfun(2, @total_relative_transmission, problems_cell_array); +total_relative_transmission=cellfun(@total_relative_transmission, problems_cell_array); + +%save 'xi_vs_detuning.mat' detuning_freq xi_linear xi_left xi_right ; +problem_cntr--; +save '/tmp/total_relative_transmission_vs_theta.mat' detuning_freq total_relative_transmission thetas problem_cntr; + +compass_lin_extrema_vs_theta_output_results; + +elapsed_time = etime (clock (), t0) + +% vim: ts=2:sw=2:fdm=indent diff --git a/compass_lin_extrema_vs_theta_output_results.m b/compass_lin_extrema_vs_theta_output_results.m new file mode 100644 index 0000000..4e8d21b --- /dev/null +++ b/compass_lin_extrema_vs_theta_output_results.m @@ -0,0 +1,87 @@ +1; + + +load '/tmp/total_relative_transmission_vs_theta.mat' ; + +% let's create sideband transmission vs angle vectors +% 1st of all we need to create matrix instead of a vector +% with rows corresponding to absorption for each sideband +% and columns to each phi angle + +N_detunings=length(detuning_freq); +N_angles=length(thetas); + +transmission_matrix=reshape(total_relative_transmission, N_detunings, N_angles); + +% the last sideband is not in two-photon resonance +% we use it as a reference for background transmission +background_vector=transmission_matrix(N_detunings,:); +background_transmission=repmat( background_vector , N_detunings, 1); + +transmission_matrix=-background_transmission+transmission_matrix; + + + +line_colors= [ ... + [ 0, 0, 1]; ... + [ 1, 0, 0]; ... + [ 0, 1, 0]; ... + [ 0, 0, 0]; ... + [ 0, 0.8, 0]; ... + [ 1, 0, 1]; ... + [ 0, 0, .6] ... + ]; + +figure(1); +clf(); +hold off; +labels={}; +for i=1:N_detunings-1 + %we will skip the very last row since it the reference transmission + + zoom_factor=1; + %plot_style=strcat("-", num2str(i)); + %plot( thetas, zoom_factor*(transmission_matrix(i,:)), plot_style); + labels = {labels{:}, strcat("a_{", num2str(i-4), "}")}; + line( thetas, zoom_factor*(transmission_matrix(i,:)), "color", line_colors(i,:) ); + hold on; +endfor + +set(gca, 'XTick', [0,pi/4, pi/2, 3*pi/4, pi]) +set(gca, 'XTickLabel', {'0', '\pi/4', '\pi/2', '3\pi/4', '\pi'}) +title("Relative sidebands amplitudes"); +xlabel('Angle \theta, between B-field and light propagation direction'); +ylabel("Amplitude"); +legend(labels); +print('compass_circ_sidebands_vs_theta.png') + +hold off; + +figure(2) +clf(); +j=4; k= 3; +j=2; k= 7; +% plotting parametric line of a sideband amplitude (j) vs another one (k) +z = zeros(1,N_angles); +col = thetas; % This is the color, vary with x in this case. +surface([zoom_factor*(transmission_matrix(j,:));zoom_factor*(transmission_matrix(j,:))], ... + [zoom_factor*(transmission_matrix(k,:));zoom_factor*(transmission_matrix(k,:))], ... + [z;z],[col;col],... + 'facecol','no',... + 'edgecol','interp',... + 'linew',2); +%plot(zoom_factor*(transmission_matrix(j,:)), zoom_factor*(transmission_matrix(k,:))) +xlabel( labels{j}); +ylabel( labels{k}); +%clabel('\theta'); +colorbar; +set(gca, 'ZTick', [0,pi/4, pi/2, 3*pi/4, pi]) +set(gca, 'ZTickLabel', {'0', '\pi/4', '\pi/2', '3\pi/4', '\pi'}) + +%colorbar('Ticks',[0, pi/2, pi], 'TicksLabels', ['0', '\pi/2', '\pi']) +%ctickslabel(['0', '\pi/2', '\pi']) +title('One sideband amplitude vs another for different angles theta'); +print('compass_circ_sidebands_combo_vs_theta.png') + + +% vim: ts=2:sw=2:fdm=indent -- cgit v1.2.3