summaryrefslogtreecommitdiff
path: root/psr/output_psr_results_vs_detuning.m
blob: cf71711b84a2f422d3cf09e7ecd6996d45b72b68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
1;


load '/tmp/xi_vs_detuning.mat' ;

Er=(1+I*xi_right)*E_field_pos_freq.right;
El=(1+I*xi_left) *E_field_pos_freq.left;

Ex=(Er+El)/sqrt(2);
Ey=I*(Er-El)/sqrt(2);

%extra rotation to compensate rotation due to ellipticity
% actually no need for it since x-polarization shifts by positive phase 
% and y-pol by negative phase 
%el_rot=0*psi_el;
%Ex=cos(el_rot)*Ex-sin(el_rot)*Ey;
%Ey=sin(el_rot)*Ex+cos(el_rot)*Ey;

Ipos=(abs(Ey).^2)/2;
Ineg=(abs(Ex).^2)/2;

figure(1);
hold off;
plot(detuning_freq, real(xi_left-xi_right), '-');  
title("differential real xi");
xlabel("two photon detuning (MHz)");

figure(2);
hold off;
plot(detuning_freq, imag(xi_left-xi_right), '-');  
title("differential imag xi");
xlabel("two photon detuning (MHz)");

figure(3);
hold off;
plot(detuning_freq, real(xi_left), '-', detuning_freq, real(xi_right), '-');  
title("real xi");
xlabel("two photon detuning (MHz)");

figure(4);
hold off;
plot(detuning_freq, imag(xi_left), '-', detuning_freq, imag(xi_right), '-');  
title("imag xi");
xlabel("two photon detuning (MHz)");

figure(5);
hold off;
I_probe=E_field_probe^2;
psr_rad=(Ipos-Ineg)/(2*I_probe);
plot(detuning_freq, psr_rad, '-');  
subt_str=sprintf("Laser Rabi freq normalized to upper state decay %.3f, ellipticity %.1f degree, \n B field ground level splitting %.3f MHz", I_probe, psi_el*180/pi, B_field); 
title(cstrcat("BPD normilized PSR signal at F_g=2 to F_e=1,2.\n ",subt_str) );
xlabel("two photon detuning (MHz)");
ylabel("PSR (radians)");

print("psr_vs_detuning.ps");

fname= sprintf("psr_vs_detuning_Fg=2toFe=1,2_Ip=%.3f_el_%.1f_B=%.3fMHz.mat", I_probe, psi_el*180/pi,B_field); 
save(fname,'detuning_freq', 'psr_rad');