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 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=-1; 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; % now we create Liouville indexes list [N, rhoLiouville_w, rhoLiouville_r, rhoLiouville_c]=unfold_density_matrix(Nlevels,Nfreq); rhoLiouville=zeros(N,1); % 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 ... ); atom_properties_fname='atom_properties.mat'; save( atom_properties_fname, 'L0m', 'polarizability_m', 'dipole_elements' ) ; for detuning_p_cntr=1:N_detun_steps+1; wp0=w12; detuning_p=detuning_p_min+detun_step*(detuning_p_cntr-1); wp=wp0+detuning_p; wm=wd-(wp-wd); %modulation_freq=[0, wp, wd, wm, -wp, -wd, -wm, wp-wd, wd-wp]; %E_field =[0, Ep, Ed, Em, Epc, Edc, Emc, 0, 0 ]; modulation_freq=[0, wp, wd, -wp, -wd, wp-wd, wd-wp]; E_field =[0, Ep, Ed, Epc, Edc, 0, 0 ]; freq_index=freq2index(wp,modulation_freq); atom_field_problem.atom_properties_fname = atom_properties_fname; %atom_field_problem.L0m = L0m; %atom_field_problem.polarizability_m = polarizability_m; %atom_field_problem.dipole_elements = dipole_elements; 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; %kappa_p(detuning_p_cntr)=susceptibility_steady_state_at_freq( atom_field_problem); detuning_freq(detuning_p_cntr)=detuning_p; endfor % 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); figure(1); plot(detuning_freq, real(kappa_p)); title("probe dispersion"); figure(2); plot(detuning_freq, imag(kappa_p)); title("probe absorption"); %figure(3); plot(detuning_freq, real(kappa_m)); title("off resonant sideband dispersion"); %figure(4); plot(detuning_freq, imag(kappa_m)); title("off resonant absorption"); elapsed_time = etime (clock (), t0) % vim: ts=2:sw=2:fdm=indent