diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-11-17 12:27:26 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2020-09-21 16:33:21 -0400 |
commit | 96a73c22465652f42666940abf54742ce0cf1e92 (patch) | |
tree | d4164a2a437ee21679ae98f4a230bfaae6ffd66e | |
parent | d98487bf7f7b46cb64828d1798864d853b751709 (diff) | |
download | multi_mode_eit-96a73c22465652f42666940abf54742ce0cf1e92.tar.gz multi_mode_eit-96a73c22465652f42666940abf54742ce0cf1e92.zip |
squeezing filter draft
l--------- | squeezing_filter/L0m.cache | 1 | ||||
-rw-r--r-- | squeezing_filter/Makefile | 35 | ||||
l--------- | squeezing_filter/basis_transformation.m | 1 | ||||
l--------- | squeezing_filter/dipole_elementRb87D1line.m | 1 | ||||
-rw-r--r-- | squeezing_filter/rb87_D1_line.m | 148 | ||||
-rw-r--r-- | squeezing_filter/susceptibility_problem.m | 99 | ||||
-rwxr-xr-x | squeezing_filter/task_solver.m | 19 | ||||
-rwxr-xr-x | squeezing_filter/tasks_builder.m | 39 | ||||
l--------- | squeezing_filter/useful_constants.m | 1 | ||||
l--------- | squeezing_filter/useful_functions.m | 1 |
10 files changed, 345 insertions, 0 deletions
diff --git a/squeezing_filter/L0m.cache b/squeezing_filter/L0m.cache new file mode 120000 index 0000000..3ac664a --- /dev/null +++ b/squeezing_filter/L0m.cache @@ -0,0 +1 @@ +../L0m.cache/
\ No newline at end of file diff --git a/squeezing_filter/Makefile b/squeezing_filter/Makefile new file mode 100644 index 0000000..0a84c81 --- /dev/null +++ b/squeezing_filter/Makefile @@ -0,0 +1,35 @@ + + +PROBLEMS = $(wildcard tasks/*.mat) +RESULTS = $(PROBLEMS:tasks/%=results/%) + + +calculate: problems solutions + +solutions: results $(RESULTS) + +results: + @mkdir results + + +problems: problems_prepared.stamp + +tasks: + @mkdir tasks + +problems_prepared.stamp: tasks tasks_builder.m + @./tasks_builder.m + @touch $@ + @echo "Please run again: make calculate" + +$(RESULTS): results/% : tasks/% + ./task_solver.m $< $@ + +clean: + rm -f problems_prepared.stamp + rm -rf tasks + rm -rf results + + +real_clean: + rm -rf L0m.cache diff --git a/squeezing_filter/basis_transformation.m b/squeezing_filter/basis_transformation.m new file mode 120000 index 0000000..28d8beb --- /dev/null +++ b/squeezing_filter/basis_transformation.m @@ -0,0 +1 @@ +../basis_transformation.m
\ No newline at end of file diff --git a/squeezing_filter/dipole_elementRb87D1line.m b/squeezing_filter/dipole_elementRb87D1line.m new file mode 120000 index 0000000..6a11745 --- /dev/null +++ b/squeezing_filter/dipole_elementRb87D1line.m @@ -0,0 +1 @@ +../dipole_elementRb87D1line.m
\ No newline at end of file diff --git a/squeezing_filter/rb87_D1_line.m b/squeezing_filter/rb87_D1_line.m new file mode 100644 index 0000000..74a52f0 --- /dev/null +++ b/squeezing_filter/rb87_D1_line.m @@ -0,0 +1,148 @@ +1; +useful_constants; + +% note all frequency values are in MHz + +% 87Rb D1 line +% +% m=-2 m=-1 m=0 m=1 m=2 +% ---- ---- ---- ---- ---- |P,F=2> +% +% ---- ---- ---- |P,F=1> +% m=-1 m=0 m=1 +% +% +% +% +% +% m=-2 m=-1 m=0 m=1 m=2 +% ---- ---- ---- ---- ---- |S,F=2> +% +% ---- ---- ---- |S,F=1> +% m=-1 m=0 m=1 + + +w_hpf_ground=6834; +w_hpf_exited=817; +w_sf2 = w_hpf_ground; % Distance from |S,F=1> to |S,F=2> +w_pf1 =1e9; % something big Distance from |S,F=1> to |P,F=1> +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 + + +%bottom level |F=1> +levels( 1)=struct( "ang_momentum", 0, "total_momentum", 1, "m", -1, "energy", 0, "gm", -gmg); +levels( 2)=struct( "ang_momentum", 0, "total_momentum", 1, "m", 0, "energy", 0, "gm", -gmg); +levels( 3)=struct( "ang_momentum", 0, "total_momentum", 1, "m", 1, "energy", 0, "gm", -gmg); + +%second bottom level |F=2> +levels( 4)=struct( "ang_momentum", 0, "total_momentum", 2, "m", -2, "energy", w_sf2, "gm", gmg); +levels( 5)=struct( "ang_momentum", 0, "total_momentum", 2, "m", -1, "energy", w_sf2, "gm", gmg); +levels( 6)=struct( "ang_momentum", 0, "total_momentum", 2, "m", 0, "energy", w_sf2, "gm", gmg); +levels( 7)=struct( "ang_momentum", 0, "total_momentum", 2, "m", 1, "energy", w_sf2, "gm", gmg); +levels( 8)=struct( "ang_momentum", 0, "total_momentum", 2, "m", 2, "energy", w_sf2, "gm", gmg); + +% first exited level |F=1> +levels( 9)=struct( "ang_momentum", 1, "total_momentum", 1, "m", -1, "energy", w_pf1, "gm", -gme); +levels(10)=struct( "ang_momentum", 1, "total_momentum", 1, "m", 0, "energy", w_pf1, "gm", -gme); +levels(11)=struct( "ang_momentum", 1, "total_momentum", 1, "m", 1, "energy", w_pf1, "gm", -gme); + +% second exited level |F=2> +levels(12)=struct( "ang_momentum", 1, "total_momentum", 2, "m", -2, "energy", w_pf2, "gm", gme); +levels(13)=struct( "ang_momentum", 1, "total_momentum", 2, "m", -1, "energy", w_pf2, "gm", gme); +levels(14)=struct( "ang_momentum", 1, "total_momentum", 2, "m", 0, "energy", w_pf2, "gm", gme); +levels(15)=struct( "ang_momentum", 1, "total_momentum", 2, "m", 1, "energy", w_pf2, "gm", gme); +levels(16)=struct( "ang_momentum", 1, "total_momentum", 2, "m", 2, "energy", w_pf2, "gm", gme); + +Nlevels=size(levels)(2); + + +H0=zeros(Nlevels); +energy = [1:Nlevels].*0; +ang_momentum = [1:Nlevels].*0; +total_momentum = [1:Nlevels].*0; +m = [1:Nlevels].*0; +gm = [1:Nlevels].*0; + +for i=1:Nlevels + energy(i) = levels(i).energy; + ang_momentum(i) = levels(i).ang_momentum; + total_momentum(i) = levels(i).total_momentum; + m(i) = levels(i).m; + gm(i) = levels(i).gm; +endfor +H0=diag(energy)*hbar; + + +dipole_elements.left = zeros(Nlevels); +dipole_elements.right = zeros(Nlevels); +dipole_elements.linear = zeros(Nlevels); +% define dipole elements for transition from level j->k +for j=1:Nlevels + for k=1:Nlevels + if ( abs(ang_momentum(j) - ang_momentum(k)) == 1) + %transition allowed for L =L' +/- 1 + % but they correct within a factor, but not sign + if ( ( H0(j,j) < H0(k,k)) ) + de=dipole_elementRb87D1line(... + total_momentum(j),m(j), ... + total_momentum(k),m(k) ... + ); + dipole_elements.left(j,k) = de.left; + dipole_elements.right(j,k) = de.right; + dipole_elements.linear(j,k) = de.linear; + endif + endif + endfor +endfor +dipole_elements.linear+=dipole_elements.linear'; +dipole_elements.left+=dipole_elements.left'; +dipole_elements.right+=dipole_elements.right'; + +maximum_dipole_elements=abs(dipole_elements.linear) + abs(dipole_elements.left) + abs(dipole_elements.right); + +%defasing matrix +g_deph=0; +g_dephasing=zeros(Nlevels); +% dephasing only for non zero dipole elements (am I right?) +g_dephasing=g_deph*(abs(maximum_dipole_elements) != 0); + +% decay matrix g(i,j) correspnds to decay from i-->j +gamma=6; +g_decay=zeros(Nlevels); +for i=1:Nlevels + for j=1:Nlevels + if ( H0(i,i) > H0(j,j) ) + % only upper levels decaying and decay is always positive + g_decay(i,j)=gamma * abs( maximum_dipole_elements(i,j) ); + endif + endfor +endfor + +% ground level mixing need to be artificial +gamma_hpf=.0001; +for i=1:Nlevels + for j=1:Nlevels + % it would be better to introduce a level corresponding to the bath + % but this slows calculations + % So + % ground hyperfine are equally mixed together + if ( (abs( H0(i,i) - H0(j,j)) == w_hpf_ground*hbar ) || ... + (abs( H0(i,i) - H0(j,j)) == 0 ) ) + % i and j correspond to 2 ground levels + % we cannot decay to itself + if ( i != j ) + % total eight ground levels F=2 and F=1 so we decay in 7 channels + g_decay(i,j)+=gamma_hpf/7; + endif + endif + endfor +endfor + +% apply B field Zeeman splitting +energy+=B_field * ( gm .* m); +% convert frequency to energy units +H0=diag(energy)*hbar; + +% vim: ts=2:sw=2:fdm=indent diff --git a/squeezing_filter/susceptibility_problem.m b/squeezing_filter/susceptibility_problem.m new file mode 100644 index 0000000..56808e9 --- /dev/null +++ b/squeezing_filter/susceptibility_problem.m @@ -0,0 +1,99 @@ +function [xi_linear, xi_left, xi_right]=susceptibility_problem(detuning_freq, Ep, psi_el, B_field, 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. +% +% Note: it is expensive to recalculate atom property for each given B_field strength +% so run as many calculation for constant magnetic field as possible + +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; + + +B_str=num2str(B_field(1),"%g"); +% the child file to which calculated matrices are written +cfile='L0m.cache/L0m_and_polarizability_calculated_for_B='; +cfile=strcat(cfile,B_str,'.mat'); + +need_update=true; +[s, err, msg] = stat (cfile); +if(err) + %file does not exist + need_update=true; +else + need_update=false; +endif; +if ( !need_update) + % 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 + +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; + +% 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); + + +wp0=w_pf1-w_sf2; %Fg=2 -> Fe=1 +wp=wp0+detuning_freq; +light_positive_freq=[ wp]; +% 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=atom_field_problem; + +[xi_linear, xi_left, xi_right]=susceptibility_steady_state_at_freq( problems_cell_array); + + +elapsed_time = etime (clock (), t0) +return + +endfunction + +% vim: ts=2:sw=2:fdm=indent diff --git a/squeezing_filter/task_solver.m b/squeezing_filter/task_solver.m new file mode 100755 index 0000000..0ba57ea --- /dev/null +++ b/squeezing_filter/task_solver.m @@ -0,0 +1,19 @@ +#!/usr/bin/octave -qf +% reads parameters file (argv1) and output results of the calculations into output file (argv(2) + +arg_list = argv (); + +if (nargin < 2) + error("need at least two parameters"); +end +params_file=arg_list{1}; +output_fname=arg_list{2}; + +load(params_file); + +[xi_linear, xi_left, xi_right]=susceptibility_problem(detuning_freq, Ep, psi_el, B_field, theta, phi) + +save(output_fname, 'detuning_freq', 'Ep', 'psi_el', 'B_field', 'theta', 'phi', ... + 'xi_linear', 'xi_left', 'xi_right' ... + ); + diff --git a/squeezing_filter/tasks_builder.m b/squeezing_filter/tasks_builder.m new file mode 100755 index 0000000..8af439e --- /dev/null +++ b/squeezing_filter/tasks_builder.m @@ -0,0 +1,39 @@ +#!/usr/bin/octave -qf + +task_dir='tasks/'; +task_base_name='task_'; +task_ext='.mat'; +data_dir='results/'; +output_dir='results/'; +detuning_freq=0; + + +% assign some defaults +gmg=.7; % gyro magnetic ration for ground level + +%[psr_rad]=psr_vs_detuning(Ep, psi_el, B_field, theta, phi) + +% phi is angle between linear polarization and axis x +%phi=pi/4; +phi=pi/2; +% 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=0*3/180*pi; + +Ep=sqrt(10.0); + +% we are going to sweep B so parts related to sweep paramer(s) +zeeman_splitting=+0.1; +Nsteps=100; +B_fields=linspace(-zeeman_splitting/gmg, zeeman_splitting/gmg, Nsteps); + +for i=1:Nsteps + filename_task=strcat(task_dir, task_base_name); + i_str=num2str(i, "%04d"); + filename_task=strcat(filename_task,i_str, task_ext); + B_field = B_fields(i); + save(filename_task, 'detuning_freq', 'Ep', 'psi_el', 'B_field', 'theta', 'phi'); +endfor + +disp("Tasks creation done"); diff --git a/squeezing_filter/useful_constants.m b/squeezing_filter/useful_constants.m new file mode 120000 index 0000000..fc5b92d --- /dev/null +++ b/squeezing_filter/useful_constants.m @@ -0,0 +1 @@ +../useful_constants.m
\ No newline at end of file diff --git a/squeezing_filter/useful_functions.m b/squeezing_filter/useful_functions.m new file mode 120000 index 0000000..a2d3237 --- /dev/null +++ b/squeezing_filter/useful_functions.m @@ -0,0 +1 @@ +../useful_functions.m
\ No newline at end of file |