diff options
-rw-r--r-- | faraday/data_file_name.m | 5 | ||||
-rw-r--r-- | faraday/faraday_vs_B.m | 147 | ||||
-rw-r--r-- | faraday/run_me.m | 25 |
3 files changed, 0 insertions, 177 deletions
diff --git a/faraday/data_file_name.m b/faraday/data_file_name.m deleted file mode 100644 index 5d6e106..0000000 --- a/faraday/data_file_name.m +++ /dev/null @@ -1,5 +0,0 @@ -function fname=data_file_name(prefix, title, suffix, B_field, theta,phi,psi_el) - str_title=sprintf("%s B field=%.5f Gauss, ellipticity=%.2f rad, theta=%.2f, phi=%.2f", title, B_field, psi_el, theta, phi); - fname=strcat(prefix, str_title, '.', suffix); -endfunction - diff --git a/faraday/faraday_vs_B.m b/faraday/faraday_vs_B.m deleted file mode 100644 index 733657e..0000000 --- a/faraday/faraday_vs_B.m +++ /dev/null @@ -1,147 +0,0 @@ -function [psr_rad]=faraday_vs_B(detuning_freq, Ep, psi_el, B_fields, 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 - -%tune probe frequency -detuning_p=0; -N_steps=length(B_fields) -kappa_p =zeros(1,N_steps+1); -kappa_m =zeros(1,N_steps+1); -xi_linear=zeros(1,N_steps); -xi_left =zeros(1,N_steps); -xi_right =zeros(1,N_steps); - -% load useful functions; -useful_functions; - -% some physical constants -useful_constants; - -basis_transformation; % load subroutines - -fprintf (stderr, "tuning laser in forloop to set conditions vs detuning\n"); -fflush (stderr); -for B_field_cntr=1:N_steps; - B_field=B_fields(B_field_cntr) - - % load atom energy levels and decay description - rb87_D1_line; - - - fprintf (stderr, "calculating atom properties\n"); - fflush (stderr); - pfile='atomic_B_field.mat'; % the parent file where B_field is stored. This is the parameter for calculated L0_and_polarization_submatrices - cfile='L0m_and_polarizability_calculated.mat'; % the child file to which calculated matrices are written - need_update=false; - [s, err_p, msg] = stat (pfile); - if(err_p) - %file does not exist - need_update=true; - else - B_field_cur=B_field; - load (pfile); % loading old B_field value - if (B_field ~= B_field_cur) - % old and current B field are different - B_field=B_field_cur; - need_update=true; - else - need_update=false; - endif - endif - - [s, err, msg] = stat (cfile); - if(err) - %file does not exist - need_update=true; - 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(pfile, 'B_field'); - save(cfile, 'L0m', 'polarizability_m'); - endif - - 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; - - %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; - - % phi is angle between linear polarization and axis x - %phi=pi*2/8; - % 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=-30/180*pi; - - % 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; - 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; - -save '/tmp/problem_definition.mat' problems_cell_array atom_properties detuning_freq ; -fprintf (stderr, "now really hard calculations begin\n"); -fflush (stderr); - [xi_linear_i, xi_left_i, xi_right_i]=susceptibility_steady_state_at_freq( problems_cell_array); - %[xi_linear, xi_left, xi_right]=cellfun( @susceptibility_steady_state_at_freq, problems_cell_array); - xi_left(B_field_cntr)=xi_left_i; - xi_right(B_field_cntr)=xi_right_i; - xi_linear(B_field_cntr)=xi_linear_i; - -endfor - -save '/tmp/xi_vs_B.mat' detuning_freq xi_linear xi_left xi_right E_field_pos_freq E_field_probe B_fields psi_el; - -psr_rad=output_faraday_results_vs_B; - -elapsed_time = etime (clock (), t0) -return - -% vim: ts=2:sw=2:fdm=indent diff --git a/faraday/run_me.m b/faraday/run_me.m deleted file mode 100644 index a8984e1..0000000 --- a/faraday/run_me.m +++ /dev/null @@ -1,25 +0,0 @@ -data_dir='results/'; -output_dir='results/'; -detuning_freq=0; - -gmg=.7; % gyro magnetic ration for ground level -zeeman_splitting=+0.1; -Nsteps=100; -B_fields=linspace(-zeeman_splitting/gmg, zeeman_splitting/gmg, Nsteps); - -%[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=-30/180*pi*e-8; - -Ep=sqrt(0.1); - -%[psr_rad_smEp_pos_el]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, phi) ; -[psr_rad_smEp_pos_el]=faraday_vs_B(detuning_freq, Ep, psi_el, B_fields, theta, phi) ; - -plot(B_fields, psr_rad_smEp_pos_el) |