summaryrefslogtreecommitdiff
path: root/faraday/susceptibility_problem.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-11-16 18:49:06 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2020-09-21 16:29:52 -0400
commitae5a5c4ee8e182ef9ee236f4492af803950feb5e (patch)
tree19239b704adfdf9b3a86dd3608011eda17b648f6 /faraday/susceptibility_problem.m
parentb9e0d2fd3bb04e77c37574c35fd2b306fb3e1d9b (diff)
downloadmulti_mode_eit-ae5a5c4ee8e182ef9ee236f4492af803950feb5e.tar.gz
multi_mode_eit-ae5a5c4ee8e182ef9ee236f4492af803950feb5e.zip
Atom L0m cached
Diffstat (limited to 'faraday/susceptibility_problem.m')
-rw-r--r--faraday/susceptibility_problem.m99
1 files changed, 99 insertions, 0 deletions
diff --git a/faraday/susceptibility_problem.m b/faraday/susceptibility_problem.m
new file mode 100644
index 0000000..56808e9
--- /dev/null
+++ b/faraday/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