Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
artiq_experiments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Nunez Barreto
artiq_experiments
Commits
d6b158b9
Commit
d6b158b9
authored
Sep 08, 2023
by
Nicolas Nunez Barreto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agrego ajustes de cpt con micromotion
parent
a97dd113
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
355 additions
and
56 deletions
+355
-56
CPT_plotter_20220520.py
...is/plots/20220526_CPTvariandoB_v2/CPT_plotter_20220520.py
+5
-5
CPT_plotter_20220615.py
.../20220615_CPTvariandocompensacion/CPT_plotter_20220615.py
+162
-11
CPT_plotter_20230421.py
.../plots/20230421_CPTconmicromocion/CPT_plotter_20230421.py
+22
-5
Espectroscpt_cristal.py
...s/20230720_EspectrosCristal2iones/Espectroscpt_cristal.py
+104
-0
CPT_plotter_20230906.py
...plots/20230906_CPTconmicromocion2/CPT_plotter_20230906.py
+54
-29
MM_eightLevel_2repumps_AnalysisFunctions.py
...2/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
+3
-3
MM_eightLevel_2repumps_python_scripts.py
...ion2/Data/EITfit/MM_eightLevel_2repumps_python_scripts.py
+5
-3
No files found.
analisis/plots/20220526_CPTvariandoB_v2/CPT_plotter_20220520.py
View file @
d6b158b9
...
...
@@ -591,10 +591,10 @@ plt.fill_between(FreqsDRpi_15, FiltCounts15+ErrorCounts15, FiltCounts15-ErrorCou
plt
.
xlim
(
-
40
,
30
)
plt
.
ylim
(
-
0.1
,
1.4
)
plt
.
xlabel
(
'
Repump detuning (MHz)'
,
fontsize
=
12
,
fontname
=
'STIXgeneral'
)
plt
.
ylabel
(
'Normalized fluorescence'
,
fontsize
=
1
2
,
fontname
=
'STIXgeneral'
)
plt
.
xticks
([
-
40
,
-
20
,
0
,
20
],
fontsize
=
1
2
,
fontname
=
'STIXgeneral'
)
plt
.
yticks
([
0
,
0.3
,
0.6
,
0.9
,
1.2
],
fontsize
=
1
2
,
fontname
=
'STIXgeneral'
)
plt
.
xlabel
(
'
IR laser detuning (MHz)'
,
fontsize
=
11
,
fontname
=
'STIXgeneral'
)
plt
.
ylabel
(
'Normalized fluorescence'
,
fontsize
=
1
1
,
fontname
=
'STIXgeneral'
)
plt
.
xticks
([
-
40
,
-
20
,
0
,
20
],
fontsize
=
1
1
,
fontname
=
'STIXgeneral'
)
plt
.
yticks
([
0
,
0.3
,
0.6
,
0.9
,
1.2
],
fontsize
=
1
1
,
fontname
=
'STIXgeneral'
)
visible_ticks
=
{
"top"
:
False
,
"right"
:
False
...
...
@@ -605,7 +605,7 @@ plt.tick_params(axis="y", which="both", **visible_ticks)
plt
.
grid
()
plt
.
tight_layout
()
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Work/2022 B vs k race/Figuras/Figuras jpg trabajadas/CPT_exp.png',dpi=500)
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig3
_final.pdf')
plt
.
savefig
(
'/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig4
_final.pdf'
)
#%%
from
scipy.optimize
import
curve_fit
...
...
analisis/plots/20220615_CPTvariandocompensacion/CPT_plotter_20220615.py
View file @
d6b158b9
...
...
@@ -8,6 +8,10 @@ from scipy.optimize import curve_fit
import
os
from
scipy
import
interpolate
"""
Ajustes de un espectro cpt global de dos iones.
Ajustamos con la contribucion de dos espectros individuales y da muy bien.
"""
#/home/nico/Documents/artiq_experiments/analisis/plots/20220615_CPTvariandocompensacion/Data
...
...
@@ -155,6 +159,10 @@ for dr in DR:
from
scipy.optimize
import
curve_fit
import
time
"""
AJUSTO LA CPT DE 2 IONES CON UN MODELO EN DONDE SUMO DOS ESPECTROS CON BETAS DISTINTOS
"""
phidoppler
,
titadoppler
=
0
,
90
phirepump
,
titarepump
=
0
,
0
phiprobe
=
0
...
...
@@ -176,9 +184,9 @@ u = 32.5e6
#B = (u/(2*np.pi))/c
correccion
=
6
correccion
=
-
1
offsetxpi
=
4
40
+
1
+
correccion
offsetxpi
=
4
27
+
correccion
DetDoppler
=
-
11.5
-
correccion
gPS
,
gPD
,
=
2
*
np
.
pi
*
21.58e6
,
2
*
np
.
pi
*
1.35e6
...
...
@@ -187,39 +195,182 @@ alpha = 0
drivefreq
=
2
*
np
.
pi
*
22.135
*
1e6
FreqsDR
=
[
2
*
f
*
1e-6
-
offsetxpi
+
14
for
f
in
Freqs
[
10
]]
FreqsDR
=
[
2
*
f
*
1e-6
-
offsetxpi
for
f
in
Freqs
[
10
]]
CountsDR
=
Counts
[
10
]
freqslong
=
np
.
arange
(
min
(
FreqsDR
),
max
(
FreqsDR
)
+
FreqsDR
[
1
]
-
FreqsDR
[
0
],
0.1
*
(
FreqsDR
[
1
]
-
FreqsDR
[
0
]))
freqslong
=
np
.
arange
(
min
(
FreqsDR
)
-
20
,
max
(
FreqsDR
)
+
FreqsDR
[
1
]
-
FreqsDR
[
0
],
0.1
*
(
FreqsDR
[
1
]
-
FreqsDR
[
0
]))
CircPr
=
1
alpha
=
0
def
FitEIT_MM
(
freqs
,
SG
,
SP
,
SCALE1
,
SCALE2
,
OFFSET
,
BETA1
,
BETA2
):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP
=
1e-3
Detunings
,
Fluorescence1
=
PerformExperiment_8levels
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA1
,
drivefreq
,
min
(
freqs
),
max
(
freqs
)
+
(
freqs
[
1
]
-
freqs
[
0
]),
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
Detunings
,
Fluorescence2
=
PerformExperiment_8levels
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA2
,
drivefreq
,
min
(
freqs
),
max
(
freqs
)
+
(
freqs
[
1
]
-
freqs
[
0
]),
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
TEMP
=
0.2e-3
Detunings
,
Fluorescence1
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA1
,
drivefreq
,
min
(
freqs
),
max
(
freqs
)
+
(
freqs
[
1
]
-
freqs
[
0
]),
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
Detunings
,
Fluorescence2
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA2
,
drivefreq
,
min
(
freqs
),
max
(
freqs
)
+
(
freqs
[
1
]
-
freqs
[
0
]),
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
ScaledFluo1
=
np
.
array
([
f
*
SCALE1
+
OFFSET
for
f
in
Fluorescence1
])
ScaledFluo2
=
np
.
array
([
f
*
SCALE2
+
OFFSET
for
f
in
Fluorescence2
])
return
ScaledFluo1
+
ScaledFluo2
#return ScaledFluo1
popt
,
pcov
=
curve_fit
(
FitEIT_MM
,
FreqsDR
,
CountsDR
,
p0
=
[
0.8
,
8
,
1e3
,
1e3
,
1e4
,
1
,
1
],
bounds
=
((
0
,
0
,
0
,
0
,
0
,
0
,
0
),
(
2
,
15
,
1e5
,
1e5
,
1e5
,
10
,
10
)))
popt_2sp
,
pcov_2sp
=
curve_fit
(
FitEIT_MM
,
FreqsDR
,
CountsDR
,
p0
=
[
0.9
,
6.2
,
3.5e4
,
2.9e4
,
1.34e3
,
3.5
,
0.1
],
bounds
=
((
0
,
0
,
0
,
0
,
0
,
0
,
0
),
(
2
,
10
,
5e4
,
5e4
,
4e3
,
10
,
2
)))
#popt, pcov = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.8, 8, 4e4, 3.5e3, 0], bounds=((0, 0, 0, 0, 0), (2, 15, 1e5, 1e5, 10)))
#array([7.12876797e-01, 7.92474752e+00, 4.29735308e+04, 1.74240582e+04,
#1.53401696e+03, 1.17073206e-06, 2.53804151e+00])
FittedEITpi
=
FitEIT_MM
(
freqslong
,
*
popt
)
#%%
FittedEITpi_2sp
=
FitEIT_MM
(
freqslong
,
*
popt_2sp
)
#FittedEITpi = FitEIT_MM(freqslong, 0.8, 8, 4e4, 3.5e3, 0)
beta1
=
popt_2sp
[
5
]
beta2
=
popt_2sp
[
6
]
errbeta1
=
np
.
sqrt
(
pcov_2sp
[
5
,
5
])
errbeta2
=
np
.
sqrt
(
pcov_2sp
[
6
,
6
])
"""
Estos params dan bien poniendo beta2=0 y correccion=0 y son SG, SP, SCALE1, SCALE2, OFFSET, BETA1
#array([9.03123248e-01, 6.25865542e+00, 3.47684055e+04, 2.92076804e+04, 1.34556420e+03, 3.55045904e+00])
"""
"""
Ahora considerando ambos betas, con los parametros iniciales dados por los que se obtuvieron con beta2=0
y correccion=0 dan estos parametros que son los de antes pero con BETA2 incluido:
array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
"""
plt
.
figure
()
plt
.
errorbar
(
FreqsDR
,
CountsDR
,
yerr
=
2
*
np
.
sqrt
(
CountsDR
),
fmt
=
'o'
,
color
=
'darkgreen'
,
alpha
=
0.5
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslong
,
FittedEITpi_2sp
,
color
=
'darkgreen'
,
linewidth
=
3
)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt
.
xlabel
(
'Detuning (MHz)'
)
plt
.
ylabel
(
'Counts'
)
plt
.
grid
()
#%%
"""
Vemos la contribucion de cada ion
"""
def
SinglespectraFitEIT_MM
(
freqs
,
SG
,
SP
,
SCALE1
,
SCALE2
,
OFFSET
,
BETA1
,
BETA2
):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP
=
0.2e-3
Detunings
,
Fluorescence1
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA1
,
drivefreq
,
min
(
freqs
),
max
(
freqs
)
+
(
freqs
[
1
]
-
freqs
[
0
]),
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
Detunings
,
Fluorescence2
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA2
,
drivefreq
,
min
(
freqs
),
max
(
freqs
)
+
(
freqs
[
1
]
-
freqs
[
0
]),
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
ScaledFluo1
=
np
.
array
([
f
*
SCALE1
+
OFFSET
for
f
in
Fluorescence1
])
ScaledFluo2
=
np
.
array
([
f
*
SCALE2
+
OFFSET
for
f
in
Fluorescence2
])
return
ScaledFluo1
,
ScaledFluo2
FittedEITpi_2sp_ion1
,
FittedEITpi_2sp_ion2
=
SinglespectraFitEIT_MM
(
freqslong
,
*
popt_2sp
)
#%%
plt
.
figure
()
plt
.
errorbar
(
FreqsDR
,
CountsDR
,
yerr
=
2
*
np
.
sqrt
(
CountsDR
),
fmt
=
'o'
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslong
,
FittedEITpi
)
#plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt
.
plot
(
freqslong
,
FittedEITpi_2sp_ion2
,
color
=
'darkolivegreen'
,
linewidth
=
3
,
label
=
'ion 1'
)
plt
.
plot
(
freqslong
,
FittedEITpi_2sp_ion1
,
color
=
'lawngreen'
,
linewidth
=
3
,
label
=
'ion 2'
)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt
.
xlabel
(
'Detuning (MHz)'
)
plt
.
ylabel
(
'Counts'
)
plt
.
legend
(
loc
=
'upper left'
,
fontsize
=
20
)
plt
.
grid
()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from
scipy.optimize
import
curve_fit
import
time
"""
AHORA AJUSTO LA CPT DE 2 IONES CON UN SOLO ESPECTRO PARA VER QUE
EFECTIVAMENTE DOS ESPECTROS SUMADOS DAN MEJOR
"""
phidoppler
,
titadoppler
=
0
,
90
phirepump
,
titarepump
=
0
,
0
phiprobe
=
0
titaprobe
=
90
Temp
=
0.5e-3
sg
=
0.544
sp
=
4.5
sr
=
0
DetRepump
=
0
lw
=
0.1
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
=
lw
,
lw
,
lw
#ancho de linea de los laseres
u
=
32.5e6
#B = (u/(2*np.pi))/c
correccion
=
-
1
offsetxpi
=
427
+
correccion
DetDoppler
=
-
11.5
-
correccion
gPS
,
gPD
,
=
2
*
np
.
pi
*
21.58e6
,
2
*
np
.
pi
*
1.35e6
alpha
=
0
drivefreq
=
2
*
np
.
pi
*
22.135
*
1e6
FreqsDR
=
[
2
*
f
*
1e-6
-
offsetxpi
for
f
in
Freqs
[
10
]]
CountsDR
=
Counts
[
10
]
freqslong
=
np
.
arange
(
min
(
FreqsDR
),
max
(
FreqsDR
)
+
FreqsDR
[
1
]
-
FreqsDR
[
0
],
0.1
*
(
FreqsDR
[
1
]
-
FreqsDR
[
0
]))
CircPr
=
1
alpha
=
0
def
FitEIT_MM
(
freqs
,
SG
,
SP
,
SCALE1
,
OFFSET
,
BETA1
):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP
=
0.2e-3
Detunings
,
Fluorescence1
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA1
,
drivefreq
,
min
(
freqs
),
max
(
freqs
)
+
(
freqs
[
1
]
-
freqs
[
0
]),
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
ScaledFluo1
=
np
.
array
([
f
*
SCALE1
+
OFFSET
for
f
in
Fluorescence1
])
return
ScaledFluo1
#return ScaledFluo1
popt_1sp
,
pcov_1sp
=
curve_fit
(
FitEIT_MM
,
FreqsDR
,
CountsDR
,
p0
=
[
0.9
,
6.2
,
3e4
,
1.34e3
,
2
],
bounds
=
((
0
,
0
,
0
,
0
,
0
),
(
2
,
10
,
5e4
,
5e4
,
10
)))
#array([7.12876797e-01, 7.92474752e+00, 4.29735308e+04, 1.74240582e+04,
#1.53401696e+03, 1.17073206e-06, 2.53804151e+00])
FittedEITpi_1sp
=
FitEIT_MM
(
freqslong
,
*
popt_1sp
)
#FittedEITpi_1sp = FitEIT_MM(freqslong, 0.9, 6.2, 4e4, 2.9e3, 2)
plt
.
figure
()
plt
.
errorbar
(
FreqsDR
,
CountsDR
,
yerr
=
2
*
np
.
sqrt
(
CountsDR
),
fmt
=
'o'
,
color
=
'darkgreen'
,
alpha
=
0.5
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslong
,
FittedEITpi_1sp
,
color
=
'darkgreen'
,
linewidth
=
3
)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt
.
xlabel
(
'Detuning (MHz)'
)
plt
.
ylabel
(
'Counts'
)
plt
.
grid
()
...
...
analisis/plots/20230421_CPTconmicromocion/CPT_plotter_20230421.py
View file @
d6b158b9
...
...
@@ -143,7 +143,7 @@ u = 33.5e6
beta
=
0
drivefreq
=
22.135e6
drivefreq
=
2
*
np
.
pi
*
2
2.135e6
correccion
=
12
...
...
@@ -159,27 +159,44 @@ freqslongpi = np.arange(min(FreqsDRpi), max(FreqsDRpi)+FreqsDRpi[1]-FreqsDRpi[0]
def
FitEITpi
(
freqs
,
SG
,
SP
,
BETA
,
scale
,
offset
):
temp
=
1e-3
MeasuredFreq
,
MeasuredFluo
=
GenerateNoisyCPT_MM_fit
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
temp
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA
,
drivefreq
,
freqs
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
,
noiseamplitude
=
noiseamplitude
)
MeasuredFreq
,
MeasuredFluo
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
temp
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA
,
drivefreq
,
min
(
freqs
),
max
(
freqs
),
freqs
[
1
]
-
freqs
[
0
])
#MeasuredFreq, MeasuredFluo = GenerateNoisyCPT_MM_fit(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, temp, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA, drivefreq, freqs, plot=False, solvemode=1, detpvec=None, noiseamplitude=noiseamplitude)
#scale = 0.3*2e+04
#offset = 0.3*2e+03
FinalFluo
=
[
f
*
scale
+
offset
for
f
in
MeasuredFluo
]
return
FinalFluo
popt_fullcpt
,
pcov_fullcpt
=
curve_fit
(
FitEITpi
,
FreqsDRpi
,
CountsDRpi
,
p0
=
[
0.5
,
4.5
,
1
,
1e4
,
1e3
],
bounds
=
((
0
,
0
,
0
,
1e1
,
0
),
(
2
,
10
,
1000
,
1e5
,
1e5
)))
popt_fullcpt
,
pcov_fullcpt
=
curve_fit
(
FitEITpi
,
FreqsDRpi
[
1
:]
,
CountsDRpi
,
p0
=
[
0.5
,
4.5
,
1
,
1e4
,
1e3
],
bounds
=
((
0
,
0
,
0
,
1e1
,
0
),
(
2
,
10
,
1000
,
1e5
,
1e5
)))
#print(f'Temperatura: ({round(1e3*popt_fullcpt[-1],2)} +- {round(1e3*np.sqrt(pcov_fullcpt[-1][-1]),2)}) mK')
print
(
popt_fullcpt
)
#%%
FittedEITpi
=
FitEITpi
(
freqslongpi
,
popt_fullcpt
[
0
],
popt_fullcpt
[
1
],
20
,
popt_fullcpt
[
3
],
popt_fullcpt
[
4
])
FittedEITpi
=
FitEITpi
(
freqslongpi
,
popt_fullcpt
[
0
],
popt_fullcpt
[
1
],
4
,
popt_fullcpt
[
3
],
popt_fullcpt
[
4
])
#FittedEITpi = FitEITpi(freqslongpi, *popt_fullcpt)
"""
Ploteo la CPT de referencia junto al ajuste y a la resonancia oscura de interes
I plot the reference CPT along with the fit to the model and the dark resonance of interest
"""
DRs
=
[
-
26.5
,
-
18
,
-
11.5
,
-
3
]
plt
.
figure
()
plt
.
errorbar
(
FreqsDRpi
,
Counts_merged
,
yerr
=
np
.
sqrt
(
np
.
array
(
Counts_merged
)),
fmt
=
'o'
,
capsize
=
2
,
markersize
=
2
)
for
dr
in
DRs
:
plt
.
axvline
(
dr
,
color
=
'black'
,
alpha
=
0.5
)
plt
.
axvline
(
dr
-
22.1
,
color
=
'red'
,
alpha
=
0.5
)
plt
.
axvline
(
dr
+
22.1
,
color
=
'blue'
,
alpha
=
0.2
)
plt
.
plot
(
freqslongpi
,
FittedEITpi
[
1
:])
#%%
#ignorar de aca para abajo por ahora
#%%
#i_DR = 955
...
...
analisis/plots/20230720_EspectrosCristal2iones/Espectroscpt_cristal.py
View file @
d6b158b9
...
...
@@ -131,4 +131,108 @@ plt.legend()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels_MM, GenerateNoisyCPT_MM_fit
from
scipy.optimize
import
curve_fit
from
time
import
time
as
titi
"""
Ajusto un cpt para obtener todos los parámetros relevantes primero.
I fit a cpt curve to retrieve all the relevant parameters first.
"""
phidoppler
,
titadoppler
=
0
,
90
phirepump
,
titarepump
=
0
,
0
phiprobe
=
0
titaprobe
=
90
gPS
,
gPD
,
=
2
*
np
.
pi
*
21.58e6
,
2
*
np
.
pi
*
1.35e6
alpha
=
0
noiseamplitude
=
0
T
=
0.6e-3
sg
=
0.544
sp
=
4.5
sr
=
0
DetRepump
=
0
lw
=
0.1
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
=
lw
,
lw
,
lw
#ancho de linea de los laseres
u
=
33.5e6
beta
=
0
drivefreq
=
2
*
np
.
pi
*
22.135e6
correccion
=
6
#probe de 1 a 12 y 6 es la mejor
offsetxpi
=
450
+
correccion
#DetDoppler = -20.5 -correccion
FreqsDRpi
=
[
2
*
f
*
1e-6
-
offsetxpi
for
f
in
IR1_Freqs
[
0
][
1
:]]
CountsDRpi
=
CountsRois
[
0
][
1
:]
freqslongpi
=
np
.
arange
(
min
(
FreqsDRpi
),
max
(
FreqsDRpi
)
+
FreqsDRpi
[
1
]
-
FreqsDRpi
[
0
],
0.1
*
(
FreqsDRpi
[
1
]
-
FreqsDRpi
[
0
]))
#[1.71811842e+04 3.34325038e-17]
def
FitEITpi
(
freqs
,
DetDoppler
,
SG
,
SP
,
temp
,
BETA
):
#temp = 1e-3
#BETA=0
DetDoppler
MeasuredFreq
,
MeasuredFluo
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
temp
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA
,
drivefreq
,
min
(
freqs
),
max
(
freqs
),
freqs
[
1
]
-
freqs
[
0
])
scale
=
2.77115328e+05
offset
=
1.43353974e+04
FinalFluo
=
[
f
*
scale
+
offset
for
f
in
MeasuredFluo
]
return
FinalFluo
t1
=
titi
()
popt_fullcpt
,
pcov_fullcpt
=
curve_fit
(
FitEITpi
,
FreqsDRpi
,
CountsDRpi
,
p0
=
[
-
21
,
0.5
,
8
,
1e-3
,
1
],
bounds
=
((
-
40
,
0
,
0
,
0
,
0
),
(
0
,
2
,
20
,
15e-3
,
5
)))
t2
=
titi
()
#print(f'Temperatura: ({round(1e3*popt_fullcpt[-1],2)} +- {round(1e3*np.sqrt(pcov_fullcpt[-1][-1]),2)}) mK')
print
(
'done'
,
correccion
,
f
', took {round(t2-t1)} seconds'
)
#popt_fullcpt = array([1.17888250e+05, 1.92746338e+03, 6.15041437e-01, 7.41895643e+00, 1.97990392e-04, 7.14734207e-01]) #este anda bien
#FittedEITpi = FitEITpi(freqslongpi, 3.4e4, 1.6e4, 0.5, 8, 1e-3, 0)
FittedEITpi
=
FitEITpi
(
freqslongpi
,
*
popt_fullcpt
)
"""
Ploteo la CPT de referencia junto al ajuste y a la resonancia oscura de interes
I plot the reference CPT along with the fit to the model and the dark resonance of interest
"""
#i_DR = 955
DRs
=
[
-
42.5
,
-
33.5
,
-
27
,
-
19
]
plt
.
figure
()
plt
.
errorbar
(
FreqsDRpi
,
CountsDRpi
,
yerr
=
0.1
*
np
.
sqrt
(
CountsDRpi
),
color
=
'purple'
,
alpha
=
0.6
,
fmt
=
'o'
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslongpi
,
FittedEITpi
[
1
:],
linewidth
=
2
,
color
=
'purple'
)
# for dr in DRs:
# dr = dr
# plt.axvline(dr, color='black',alpha=0.5)
# plt.axvline(dr+22.135, color='blue',alpha=0.3)
# plt.axvline(dr-22.135, color='red',alpha=0.3)
#plt.axvline(DetDoppler-22.135)
#plt.axvline(DetDoppler+22.135)
#plt.plot(freqslongpi[i_DR], FittedEITpi[i_DR],'o', color='red', markersize=12)
plt
.
xlabel
(
'Detuning (MHz)'
,
fontsize
=
15
)
plt
.
ylabel
(
'Counts'
,
fontsize
=
15
)
plt
.
grid
()
#plt.title(f'correccion: {correccion}')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
analisis/plots/20230906_CPTconmicromocion2/CPT_plotter_20230906.py
View file @
d6b158b9
...
...
@@ -12,7 +12,7 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230421_CPTconmicromocion
/Data/')
os
.
chdir
(
'/home/nico/Documents/artiq_experiments/analisis/plots/20230906_CPTconmicromocion2
/Data/'
)
CPT_FILES
=
"""000015243-IR_Scan_withcal_optimized
"""
...
...
@@ -73,14 +73,15 @@ plt.ylabel('counts')
plt
.
grid
()
for
dr
in
drs
:
plt
.
axvline
(
dr
)
plt
.
axvline
(
dr
+
drive
)
#
plt.axvline(dr+drive)
plt
.
legend
()
#%%
from
EITfit.MM_eightLevel_2repumps_AnalysisFunctions
import
PerformExperiment_8levels_MM
,
GenerateNoisyCPT_MM_fit
#
from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels_MM, GenerateNoisyCPT_MM_fit
from
scipy.optimize
import
curve_fit
from
time
import
time
as
titi
"""
Ajusto un cpt para obtener todos los parámetros relevantes primero.
...
...
@@ -112,11 +113,20 @@ u = 33.5e6
beta
=
0
drivefreq
=
22.135e6
drivefreq
=
2
*
np
.
pi
*
2
2.135e6
correccion
=
-
12
correccion
=
6
#probe de 1 a 12 y 6 es la mejor
offsetxpi
=
458
+
correccion
SGs
=
[]
SPs
=
[]
Temps
=
[]
Betas
=
[]
Scales
=
[]
Offsets
=
[]
ErrorBetas
=
[]
offsetxpi
=
423
+
correccion
DetDoppler
=
-
20.5
-
correccion
FreqsDRpi
=
[
2
*
f
*
1e-6
-
offsetxpi
for
f
in
Freqs
[
0
]]
...
...
@@ -126,49 +136,64 @@ freqslongpi = np.arange(min(FreqsDRpi), max(FreqsDRpi)+FreqsDRpi[1]-FreqsDRpi[0]
#[1.71811842e+04 3.34325038e-17]
def
FitEITpi
(
freqs
,
SG
,
SP
,
scale
,
offset
):
temp
=
1e-3
BETA
=
0
def
FitEITpi
(
freqs
,
scale
,
offset
,
SG
,
SP
,
temp
,
BETA
):
#
temp = 1e-3
#
BETA=0
MeasuredFreq
,
MeasuredFluo
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
temp
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA
,
drivefreq
,
min
(
freqs
),
max
(
freqs
),
freqs
[
1
]
-
freqs
[
0
])
#
scale = 0.3*2
e+04
#
offset = 0.3*2
e+03
#
scale = 5.69952745
e+04
#
offset = 2.91686628
e+03
FinalFluo
=
[
f
*
scale
+
offset
for
f
in
MeasuredFluo
]
return
FinalFluo
popt_fullcpt
,
pcov_fullcpt
=
curve_fit
(
FitEITpi
,
FreqsDRpi
,
CountsDRpi
[
1
:],
p0
=
[
0.5
,
4.5
,
1e4
,
4e3
],
bounds
=
((
0
,
0
,
1e1
,
0
),
(
2
,
10
,
1e5
,
1e5
)))
t1
=
titi
()
popt_fullcpt
,
pcov_fullcpt
=
curve_fit
(
FitEITpi
,
FreqsDRpi
,
CountsDRpi
,
p0
=
[
5e4
,
3e3
,
0.5
,
8
,
5e-3
,
1
],
bounds
=
((
0
,
0
,
0
,
0
,
0
,
0
),
(
1e6
,
1e5
,
2
,
20
,
15e-3
,
5
)))
t2
=
titi
()
Scales
.
append
(
popt_fullcpt
[
0
])
Offsets
.
append
(
popt_fullcpt
[
1
])
SGs
.
append
(
popt_fullcpt
[
2
])
SPs
.
append
(
popt_fullcpt
[
3
])
Temps
.
append
(
1e3
*
popt_fullcpt
[
4
])
Betas
.
append
(
popt_fullcpt
[
5
])
ErrorBetas
.
append
(
np
.
sqrt
(
pcov_fullcpt
[
5
,
5
]))
#print(f'Temperatura: ({round(1e3*popt_fullcpt[-1],2)} +- {round(1e3*np.sqrt(pcov_fullcpt[-1][-1]),2)}) mK')
print
(
popt_fullcpt
)
print
(
'done'
,
correccion
,
f
', took {round(t2-t1)} seconds'
)
#popt_fullcpt = array([1.17888250e+05, 1.92746338e+03, 6.15041437e-01, 7.41895643e+00, 1.97990392e-04, 7.14734207e-01]) #este anda bien
FittedEITpi
=
FitEITpi
(
freqslongpi
,
popt_fullcpt
[
0
],
popt_fullcpt
[
1
],
20
,
popt_fullcpt
[
3
],
popt_fullcpt
[
4
]
)
#FittedEITpi = FitEITpi(freqslongpi, *popt_fullcpt
)
#FittedEITpi = FitEITpi(freqslongpi, 0.5, 8, 6e4, 4e3
)
FittedEITpi
=
FitEITpi
(
freqslongpi
,
popt_fullcpt
[
0
],
popt_fullcpt
[
1
],
popt_fullcpt
[
2
],
popt_fullcpt
[
3
],
popt_fullcpt
[
4
],
popt_fullcpt
[
5
]
)
"""
Ploteo la CPT de referencia junto al ajuste y a la resonancia oscura de interes
I plot the reference CPT along with the fit to the model and the dark resonance of interest
"""
#%%
#i_DR = 955
DRs
=
[
-
31
,
-
22
,
-
16.5
,
-
8
]
DRs
=
[
-
42.5
,
-
33.5
,
-
27
,
-
19
]
plt
.
figure
()
plt
.
errorbar
(
FreqsDRpi
,
CountsDRpi
,
yerr
=
2
*
np
.
sqrt
(
CountsDRpi
),
fmt
=
'o'
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslongpi
[:
-
1
],
FittedEITpi
)
for
dr
in
DRs
:
dr
=
dr
+
4.7
plt
.
axvline
(
dr
,
color
=
'red'
,
alpha
=
0.2
)
plt
.
axvline
(
dr
+
22.1
,
color
=
'green'
,
alpha
=
0.2
)
plt
.
axvline
(
dr
-
22.1
,
color
=
'black'
,
alpha
=
0.2
)
#plt.axvline(DetDoppler-22.1)
#plt.axvline(DetDoppler+22.1)
plt
.
errorbar
(
FreqsDRpi
,
CountsDRpi
,
yerr
=
2
*
np
.
sqrt
(
CountsDRpi
),
color
=
'purple'
,
alpha
=
0.6
,
fmt
=
'o'
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslongpi
,
FittedEITpi
,
linewidth
=
2
,
color
=
'purple'
)
#
for dr in DRs:
# dr = dr
# plt.axvline(dr, color='black',alpha=0.5
)
# plt.axvline(dr+22.135, color='blue',alpha=0.3
)
# plt.axvline(dr-22.135, color='red',alpha=0.3
)
#plt.axvline(DetDoppler-22.1
35
)
#plt.axvline(DetDoppler+22.1
35
)
#plt.plot(freqslongpi[i_DR], FittedEITpi[i_DR],'o', color='red', markersize=12)
plt
.
xlabel
(
'Detuning (MHz)'
)
plt
.
ylabel
(
'Counts'
)
plt
.
xlabel
(
'Detuning (MHz)'
,
fontsize
=
15
)
plt
.
ylabel
(
'Counts'
,
fontsize
=
15
)
plt
.
grid
()
#plt.title(f'correccion: {correccion}')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
...
...
analisis/plots/20230906_CPTconmicromocion2/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
View file @
d6b158b9
...
...
@@ -12,7 +12,7 @@ import numpy as np
import
time
import
matplotlib.pyplot
as
plt
from
scipy.signal
import
argrelextrema
from
EITfit.MM_eightLevel_2repumps_python_scripts
import
CPTspectrum8levels_MM
#
from EITfit.MM_eightLevel_2repumps_python_scripts import CPTspectrum8levels_MM
import
random
from
scipy.signal
import
savgol_filter
as
sf
...
...
@@ -22,9 +22,9 @@ def PerformExperiment_8levels_MM(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLi
solvemode=1: resuelve con np.linalg.solve
solvemode=2: resuelve invirtiendo L con la funcion np.linalg.inv
"""
tinicial
=
time
.
time
()
#
tinicial = time.time()
ProbeDetuningVectorL
,
Fluovector
=
CPTspectrum8levels_MM
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
circularityprobe
,
beta
,
drivefreq
,
freqMin
=
freqMin
,
freqMax
=
freqMax
,
freqStep
=
freqStep
,
plot
=
False
,
solvemode
=
1
)
tfinal
=
time
.
time
()
#
tfinal = time.time()
#print('Done, Total time: ', round((tfinal-tinicial), 2), "s")
...
...
analisis/plots/20230906_CPTconmicromocion2/Data/EITfit/MM_eightLevel_2repumps_python_scripts.py
View file @
d6b158b9
...
...
@@ -88,7 +88,8 @@ def LtempCalculus(beta, drivefreq, forma=1):
Hint
=
np
.
zeros
((
8
,
8
),
dtype
=
np
.
complex_
)
ampg
=
beta
*
drivefreq
ampr
=
beta
*
drivefreq
ampr
=
beta
*
drivefreq
*
(
397
/
866
)
#ampr=beta*drivefreq
Hint
[
0
,
0
]
=
ampg
Hint
[
1
,
1
]
=
ampg
...
...
@@ -283,6 +284,7 @@ def FullL_MM(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, l
#ESTA PARTE ES CUANDO AGREGAS MICROMOCION
nmax
=
3
#print(nmax)
Ltemp
,
Omega
=
LtempCalculus
(
beta
,
drivefreq
)
#print(factor)
...
...
@@ -319,7 +321,7 @@ def CPTspectrum8levels_MM(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phid
phidoppler
,
titadoppler
=
phidoppler
*
(
np
.
pi
/
180
),
titadoppler
*
(
np
.
pi
/
180
)
phiprobe
,
titaprobe
=
phiprobe
*
(
np
.
pi
/
180
),
titaprobe
*
(
np
.
pi
/
180
)
DetProbeVector
=
2
*
np
.
pi
*
np
.
arange
(
freqMin
*
1e6
,
freqMax
*
1e6
,
freqStep
*
1e6
)
DetProbeVector
=
2
*
np
.
pi
*
np
.
arange
(
freqMin
*
1e6
,
freqMax
*
1e6
+
0
*
freqStep
*
1e6
,
freqStep
*
1e6
)
Detg
=
2
*
np
.
pi
*
Detg
*
1e6
#lwg, lwr, lwp = 2*np.pi*lwg*1e6, 2*np.pi*lwr*1e6, 2*np.pi*lwp*1e6
lwg
,
lwp
=
lwg
*
1e6
,
lwp
*
1e6
...
...
@@ -359,7 +361,7 @@ def CPTspectrum8levels_MM(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phid
return
DetProbeVectorMHz
,
Fluovector
#%%
if
__name__
==
"__main__"
:
ub
=
9.27e-24
h
=
6.63e-34
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment