From 28b07b24d5a86d7adc957129943bc4e453dae008 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Wed, 27 Apr 2016 11:13:59 -0400 Subject: full simulation of 5 level MOR to separate folder --- MOR_5_levels_with_doppler_and_propagation/Makefile | 55 +++ .../Nlevels_with_MOR.xmds | 481 +++++++++++++++++++++ .../pp_Nlevels.m | 187 ++++++++ 3 files changed, 723 insertions(+) create mode 100644 MOR_5_levels_with_doppler_and_propagation/Makefile create mode 100644 MOR_5_levels_with_doppler_and_propagation/Nlevels_with_MOR.xmds create mode 100644 MOR_5_levels_with_doppler_and_propagation/pp_Nlevels.m (limited to 'MOR_5_levels_with_doppler_and_propagation') diff --git a/MOR_5_levels_with_doppler_and_propagation/Makefile b/MOR_5_levels_with_doppler_and_propagation/Makefile new file mode 100644 index 0000000..ade8cb0 --- /dev/null +++ b/MOR_5_levels_with_doppler_and_propagation/Makefile @@ -0,0 +1,55 @@ +### -*- make -*- +### This file is part of the Debian xmds package +### Copyright (C) 2006 Rafael Laboissiere +### This file is relased under the GNU General Public License +### NO WARRANTIES! + +### This makefile can be used to build and run the XMDS examples + +XMDS_FILES = $(shell ls *.xmds) +RUN_FILES = $(patsubst %.xmds,%.run,$(XMDS_FILES)) +CC_FILES = $(patsubst %.xmds,%.cc,$(XMDS_FILES)) +XSIL_FILES = $(patsubst %.xmds,%.xsil,$(XMDS_FILES)) +M_FILES = $(patsubst %.xmds,%.m,$(XMDS_FILES)) + +XMDS = xmds2 +XSIL2GRAPHICS = xsil2graphics2 + +all: $(RUN_FILES) + +%.run: %.xmds + $(XMDS) $< + mv $(patsubst %.xmds,%,$<) $@ + +%.xsil: %.run + ./$< --E1o=0 --E3o=0 + +%.m: %.xsil + $(XSIL2GRAPHICS) $< + +plot: $(M_FILES) + octave pp.m + +clean: + rm -f $(CC_FILES) $(RUN_FILES) $(M_FILES) $(XSIL_FILES) *.wisdom.fftw3 *.dat octave-core *.wisdom *.pdf + rm -f $(png_targets) + rm -f $(eps_targets) + +eps_targets = $(wildcard *.eps) +pdf_targets = $(eps_targets:%.eps=%.pdf) +png_targets = $(pdf_targets:%.pdf=%.png) + +png: pdf $(png_targets) + +$(png_targets): %.png : %.pdf + convert -density 300 $< $@ + +pdf: $(pdf_targets) + +$(pdf_targets): %.pdf : %.eps + cat $< | ps2eps -B > __tt.eps + epspdf __tt.eps $@ + rm -f __tt.eps + #ps2eps -B $< | epspdf $< $@ +.PRECIOUS: %.run %.xsil %.m +.PHONY: all clean diff --git a/MOR_5_levels_with_doppler_and_propagation/Nlevels_with_MOR.xmds b/MOR_5_levels_with_doppler_and_propagation/Nlevels_with_MOR.xmds new file mode 100644 index 0000000..99d88a0 --- /dev/null +++ b/MOR_5_levels_with_doppler_and_propagation/Nlevels_with_MOR.xmds @@ -0,0 +1,481 @@ + + + + Nlevels_with_MOR + + Eugeniy Mikhailov, M. Guidry + + License GPL. + + Solving split 3-level atom + with field propagation along spatial axis Z + with Doppler broadening. + + + * + * -------- |a> + * / / \ \ + * EdL / / \ \ + * / / \ \ + * |c> ----------/--- \ \ EpR + * / EpL \ \ + * |C> -------------- \ \ + * EdR \ \ + * \ \ + * ------\------ |b> + * \ + * ------------- |B> + * + * + + + We are solving + dE/dz+(1/c)*dE/dt=i*eta*rho_ij, where j level is higher then i. + Note that E is actually a Rabi frequency of electromagnetic field not the EM field + in xmds terms it looks like + dE_dz = i*eta*rhoij - 1/c*L[E], here we moved t dependence to Fourier space + + VERY IMPORTANT: all Rabi frequency should be given in [1/s], if you want to + normalize it to something else look drho/dt equation. + No need to renormalizes eta as long as its express through + the upper level decay rate in the same units as Rabi frequency. + + + + + section + double eta = 0; // eta constant in the wave equation for Rabi frequency. Units are [1/(m s)] + + // --------- Atom and cell properties ------------------------- + // range of Maxwell distribution atomic velocities + const double mass = (86.909180527 * 1.660538921e-27); // atom mass in [kg] + // above mass expression is written as (expression is isotopic_mass * atomic_mass_unit) + + // Average sqrt(v^2) in Maxwell distribution for one dimension + // Maxwell related parameters will be calculated in section + double v_thermal_averaged=0; + // Maxwell distribution velocities range to take in account in [m/s] + double V_maxwell_min = 0, V_maxwell_max = 0; + + // repopulation rate (atoms flying in/out the laser beam) in [1/s] + //const double gt=0.01 *(2*M_PI*1e6); + // Natural linewidth of j's level in [1/s] + //const double Ga=3.0 *(2*M_PI*1e6); + //const double G4=3.0 *(2*M_PI*1e6); + + complex g = Gamma_super; + complex gbc = (2*M_PI)*1e3; // 1/s untits + const complex Split = 0; + const complex noise = 0; + + complex Gab, GAB, Gca, GCA, Gcb, GCB; + + // total decay of i-th level branching ratios. Rij branching of i-th level to j-th + //const double Rab=0.5, Rac=0.5; + + + complex EdLac, EdRac, EpLac, EpRac; + + // inner use variables + double probability_v; // will be used as p(v) in Maxwell distribution + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 to provide range for Maxwell velocity distribution\n"); + v_thermal_averaged=sqrt(k_boltzmann*Temperature/mass); + // Maxwell distribution velocities range to take in account in [m/s] + // there is almost zero probability for higher velocity p(4*v_av) = 3.3e-04 * p(0) + V_maxwell_min = -4*v_thermal_averaged; V_maxwell_max = -V_maxwell_min; + + // eta constant in the wave equation for Rabi frequency. Units are [1/(m s)] + eta = 3*lambda*lambda*Ndens*Gamma_super/8.0/M_PI; + ]]> + + + + + + + + + + + + + z + + + + + + + + + + EdL EdR EpL EpR + + + + + + + + probability_v + + + + + + + + probability_v_norm + + Maxwell_distribution_probabilities + + + + + + + + EdLa EdRa EpLa EpRa + + E_field Maxwell_distribution_probabilities Maxwell_distribution_probabilities_norm + + + + + + + rbb_av rBB_av rcc_av rCC_av raa_av rcb_av rab_av rca_av rCB_av rAB_av rCA_av + + density_matrix Maxwell_distribution_probabilities Maxwell_distribution_probabilities_norm + + + + + + + rbb rBB rcc rCC raa rcb rab rca rCB rAB rCA + + + E_field_avgd + + + + + + + + + + + + + + + + + + 100 100 + + + + + density_matrix + E_field_avgd + + + + + + + + Lt + + + E_field + density_matrix + + + + + + + + + + + + E_field_avgd + IdL_out IpL_out IdR_out IpR_out + + + + + + + density_matrix_averaged + + rbb_out rBB_out + rcc_out rCC_out + raa_out + rcb_re_out rcb_im_out + rCB_re_out rCB_im_out + rab_re_out rab_im_out + rAB_re_out rAB_im_out + rca_re_out rca_im_out + rCA_re_out rCA_im_out + + + + + + + + + + + + + diff --git a/MOR_5_levels_with_doppler_and_propagation/pp_Nlevels.m b/MOR_5_levels_with_doppler_and_propagation/pp_Nlevels.m new file mode 100644 index 0000000..0991c97 --- /dev/null +++ b/MOR_5_levels_with_doppler_and_propagation/pp_Nlevels.m @@ -0,0 +1,187 @@ +Nlevels_with_MOR + +%% field propagation +z_1=z_1*100; % z in cm +t_1=t_1*1e6; % time now measured in uS +figure(1) +subplot(2,2,1); imagesc(z_1, t_1, IdL_out_1); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_{dL}') +title('I_{dL}') +subplot(2,2,2); imagesc(z_1, t_1, IpL_out_1); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_{pL}') +title('I_{pL}') +subplot(2,2,3); imagesc(z_1, t_1, IdR_out_1); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_{dR}') +title('I_{dR}') +subplot(2,2,4); imagesc(z_1, t_1, IpR_out_1); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_{pR}') +title('I_{pR}') + + +%print('-color','fields_propagation.eps') + + + +%% fields before and after the cell +figure(5) +subplot(2,2,1); +plot( ... + t_1,IdL_out_1(1,:)', ... + t_1,IdL_out_1(end,:)','LineWidth', 4 ... + ) +xlabel('t (uS)') +ylabel('I_{dL} (1/s)^2') +title('I_{dL} before and after cell') +legend('before', 'after') + +%% +subplot(2,2,2); +plot( ... + t_1,IpL_out_1(1,:)', ... + t_1,IpL_out_1(end,:)', 'linewidth', 4 ... + ) +xlabel('t (uS)') +ylabel('I_{pL} (1/s)^2') +title('I_{pL} before and after cell') +legend('before', 'after') + +%% +subplot(2,2,3); +plot( ... + t_1,IdR_out_1(1,:)', ... + t_1,IdR_out_1(end,:)', 'linewidth', 4 ... + ) +xlabel('t (uS)') +ylabel('I_{dR} (1/s)^2') +title('I_{dR} before and after cell') +legend('before', 'after') + +%% + +[b, a]=butter(3, 0.05); + +IpR_out_after=IpR_out_1(end,:); + +IpR_out_after_filtered=filtfilt(b,a,IpR_out_after); +settling_time=0.8; %uS +t_good_indx=t_1> min(t_1 + settling_time); + +[m, max_pos_before]=max(IpR_out_1(1,t_good_indx) ); + + +[m, max_pos_after]=max(IpR_out_after_filtered(1, t_good_indx)); + + +delay_time=t_1(max_pos_after)-t_1(max_pos_before); + + +display( strcat('Second field delay time = ', num2str(delay_time), ' uS/n')); + +%% + +%print('-color','fields_before_after_cell.eps') + +subplot(2,2,4); +plot( ... + t_1,IpR_out_1(1,:)', ... + t_1,IpR_out_1(end,:)', 'linewidth', 4 ... + ) +xlabel('t (uS)') +ylabel('I_{pR} (1/s)^2') +title('I_{pR} before and after cell') + + +%% +figure(4) +IpR_max_in=max(IpR_out_1(1,t_good_indx)); +IpR_max_out=max(IpR_out_1(end, t_good_indx)); +IpR_in_norm=(IpR_out_1(1,:))/IpR_max_in; +IpR_out_norm=(IpR_out_1(end,:))/IpR_max_out; + + +tmin=-0.05; +tmax=0.05; +indx=(t_1>=tmin & t_1<=tmax); % soom in in time to this region +plot( ... + t_1(indx),IpR_in_norm(indx), ... + t_1(indx),IpR_out_norm(indx), 'linewidth', 4 ... + ) +xlim([tmin,tmax]); +xlabel('t (uS)') +ylabel('I_{pR}') +title('I_{pR} before and after cell normalized') +%print('-color','probe_before_after_cell.eps') +legend('before', 'after') + +return; + +%% all density matrix elements in one plot +% diagonal populations, +% upper triangle real part of coherences, +% lower diagonal imaginary part of coherences +z_2=z_2*100; % z in cm +t_2=t_2*1e6; % time now measured in uS + +%% +figure(3) +subplot(4,4,1); imagesc(z_1, t_2, rbb_out_2(:,:,1)); caxis([0,1]); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('rho_{bb}') +title('rho_{bb}') + +%% +subplot(4,4,6); imagesc (z_2, t_2, rcc_out_2(:,:,1)); caxis([0,1]); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('rho_{cc}') +title('rho_{cc}') +subplot(4,4,11); imagesc (z_2, t_2, raa_out_2); caxis([0,1]); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('rho_{aa}') +title('rho_{aa}') + +% real parts of coherences +subplot(4,4,2); imagesc(z_2, t_2, rcb_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{cb})') +title('Real(rho_{cb})') +subplot(4,4,3); imagesc(z_2, t_2, rab_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{ab})') +title('Real(rho_{ab})') + +subplot(4,4,7); imagesc(z_2, t_2, rca_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{ca})') +title('Real(rho_{ca})') + +% imaginary parts of coherences +subplot(4,4,5); imagesc(z_2, t_2, rcb_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{cb})') +title('Imag(rho_{cb})') +subplot(4,4,9); imagesc(z_2, t_2, rab_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{ab})') +title('Imag(rho_{ab})') +subplot(4,4,10); imagesc(z_2, t_2, rca_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{ca})') +title('Imag(rho_{ca})') + -- cgit v1.2.3