summaryrefslogtreecommitdiff
path: root/compass.m
diff options
context:
space:
mode:
Diffstat (limited to 'compass.m')
-rw-r--r--compass.m32
1 files changed, 12 insertions, 20 deletions
diff --git a/compass.m b/compass.m
index a00155c..d7617ea 100644
--- a/compass.m
+++ b/compass.m
@@ -9,6 +9,8 @@ useful_functions;
% some physical constants
useful_constants;
+basis_transformation; % load subroutines
+
% load atom energy levels and decay description
%rb87_D1_line;
%four_levels_with_polarization;
@@ -65,18 +67,9 @@ E_field_lab.left = E_field_zero + (0.00000+0.00000i)*E_field_probe + (0.00000
phi=pi*2/8;
% theta is angle between lab z axis (light propagation direction) and magnetic field axis (z')
theta=pi/2;
-theta=0;
+theta=pi/4;
-% we define light as linearly polarized
-E_field_lab.x=cos(phi)*E_field_lab.linear;
-E_field_lab.y=sin(phi)*E_field_lab.linear;
-E_field_lab.z=E_field_zero;
-basis_transformation; % load subroutines
-coord_transf_m = lin2circ * oldlin2newlin(theta);
-E_field.right = coord_transf_m(1,1)*E_field_lab.x + coord_transf_m(1,2)*E_field_lab.y + coord_transf_m(1,3)*E_field_lab.z;
-E_field.left = coord_transf_m(2,1)*E_field_lab.x + coord_transf_m(2,2)*E_field_lab.y + coord_transf_m(2,3)*E_field_lab.z;
-E_field.linear = coord_transf_m(3,1)*E_field_lab.x + coord_transf_m(3,2)*E_field_lab.y + coord_transf_m(3,3)*E_field_lab.z;
fprintf (stderr, "tuning laser in forloop to set conditions vs detuning\n");
@@ -90,16 +83,6 @@ min_angle=0; max_angle=pi/2;
phis=min_angle:((max_angle-min_angle)/N_angle_steps):max_angle;
for phi=phis;
for detuning_p_cntr=1:length(detuning_freq);
- % we define light as linearly polarized
- % where phi is angle between light polarization and axis x
- E_field_lab.x=cos(phi)*E_field_lab.linear;
- E_field_lab.y=sin(phi)*E_field_lab.linear;
- E_field_lab.z=E_field_zero;
- % now we transfor x,y,z, to x',y', and z' with respect to magnetic field az z' axis
- coord_transf_m = lin2circ * oldlin2newlin(theta);
- E_field.right = coord_transf_m(1,1)*E_field_lab.x + coord_transf_m(1,2)*E_field_lab.y + coord_transf_m(1,3)*E_field_lab.z;
- E_field.left = coord_transf_m(2,1)*E_field_lab.x + coord_transf_m(2,2)*E_field_lab.y + coord_transf_m(2,3)*E_field_lab.z;
- E_field.linear = coord_transf_m(3,1)*E_field_lab.x + coord_transf_m(3,2)*E_field_lab.y + coord_transf_m(3,3)*E_field_lab.z;
wp0=w_pf1;
wd=w_pf1-w_hpf_ground;
@@ -108,6 +91,15 @@ for phi=phis;
wm=wd-(wp-wd);
%modulation_freq=[0, wp, wd, wm, -wp, -wd, -wm, wp-wd, wd-wp];
modulation_freq=[0, wp, wd, -wp, -wd, wp-wd, wd-wp];
+ % we define light as linearly polarized
+ % where phi is angle between light polarization and axis x
+ [E_field_lab.x, E_field_lab.y] = rotXpolarization(phi, E_field_lab.linear, modulation_freq);
+ E_field_lab.z=E_field_zero;
+ % now we transfor x,y,z, to x',y', and z' with respect to magnetic field az z' axis
+ coord_transf_m = lin2circ * oldlin2newlin(theta);
+ E_field.right = coord_transf_m(1,1)*E_field_lab.x + coord_transf_m(1,2)*E_field_lab.y + coord_transf_m(1,3)*E_field_lab.z;
+ E_field.left = coord_transf_m(2,1)*E_field_lab.x + coord_transf_m(2,2)*E_field_lab.y + coord_transf_m(2,3)*E_field_lab.z;
+ E_field.linear = coord_transf_m(3,1)*E_field_lab.x + coord_transf_m(3,2)*E_field_lab.y + coord_transf_m(3,3)*E_field_lab.z;
freq_index=freq2index(wp,modulation_freq);
atom_field_problem.E_field = E_field;