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
f00f1e81
Commit
f00f1e81
authored
May 19, 2025
by
Vlatko, Carolina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compu caro
parent
4ff87a38
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
3944 additions
and
5 deletions
+3944
-5
CPT_barridoVoltajeDown.png
...s/plots/20250516_CPT_bladetrap/CPT_barridoVoltajeDown.png
+0
-0
CPT_bladetrap.py
analisis/plots/20250516_CPT_bladetrap/CPT_bladetrap.py
+2
-2
CPT_bladetrap2.py
analisis/plots/20250516_CPT_bladetrap/CPT_bladetrap2.py
+185
-3
000021360-IR_Scan_simple.h5
...16_CPT_bladetrap/Data2/EITfit/000021360-IR_Scan_simple.h5
+0
-0
MM_eightLevel_2repumps_AnalysisFunctions.py
.../Data2/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
+57
-0
MM_eightLevel_2repumps_CPTPlotter.py
...adetrap/Data2/EITfit/MM_eightLevel_2repumps_CPTPlotter.py
+153
-0
MM_eightLevel_2repumps_python_scripts.py
...rap/Data2/EITfit/MM_eightLevel_2repumps_python_scripts.py
+408
-0
lolo_modelo_full_3niveles.py
...6_CPT_bladetrap/Data2/EITfit/lolo_modelo_full_3niveles.py
+1207
-0
lolo_modelo_full_8niveles.py
...6_CPT_bladetrap/Data2/EITfit/lolo_modelo_full_8niveles.py
+549
-0
threeLevel_2repumps_AnalysisFunctions.py
...rap/Data2/EITfit/threeLevel_2repumps_AnalysisFunctions.py
+608
-0
threeLevel_2repumps_CPTPlotter.py
..._bladetrap/Data2/EITfit/threeLevel_2repumps_CPTPlotter.py
+233
-0
threeLevel_2repumps_linealpol_python_scripts.py
...a2/EITfit/threeLevel_2repumps_linealpol_python_scripts.py
+542
-0
No files found.
analisis/plots/20250516_CPT_bladetrap/CPT_barridoVoltajeDown.png
0 → 100644
View file @
f00f1e81
163 KB
analisis/plots/20250516_CPT_bladetrap/CPT_bladetrap.py
View file @
f00f1e81
...
...
@@ -15,8 +15,8 @@ Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20231123_CPTconmicromocion3/Data/')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20250516_CPT_bladetrap/Data')
os
.
chdir
(
r'C:\Users\Carolina\Documents\artiq_experiments\analisis\plots\20250516_CPT_bladetrap\Data'
)
#
os.chdir(r'C:\Users\Carolina\Documents\artiq_experiments\analisis\plots\20250516_CPT_bladetrap\Data')
os
.
chdir
(
"/home/carolina/Documents/artiq_experiments/analisis/plots/20250516_CPT_bladetrap/Data2"
)
CPT_FILES
=
"""000021278-IR_Scan_simple
000021360-IR_Scan_simple
...
...
analisis/plots/20250516_CPT_bladetrap/CPT_bladetrap2.py
View file @
f00f1e81
...
...
@@ -22,8 +22,8 @@ Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20231123_CPTconmicromocion3/Data/')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20250516_CPT_bladetrap/Data')
os
.
chdir
(
r'C:\Users\Carolina\Documents\artiq_experiments\analisis\plots\20250516_CPT_bladetrap\Data2'
)
#
os.chdir(r'C:\Users\Carolina\Documents\artiq_experiments\analisis\plots\20250516_CPT_bladetrap\Data2')
os
.
chdir
(
"/home/carolina/Documents/artiq_experiments/analisis/plots/20250516_CPT_bladetrap/Data2"
)
VDown
=
[
-
177
,
-
175
,
-
173
,
-
171
,
-
170
,
-
170
,
-
168
,
-
166
]
meds
=
[
21368
,
21367
,
21369
,
21370
,
21366
,
21390
,
21391
,
21392
]
...
...
@@ -39,12 +39,12 @@ def SeeKeys(files):
Counts
=
[]
Freqs
=
[]
AmpTisa
=
[]
UVCPTAmp
=
[]
No_measures
=
[]
Voltages
=
[]
for
i
,
fname
in
enumerate
(
CPT_FILES
):
print
(
str
(
i
)
+
' - '
+
fname
)
#print(fname)
...
...
@@ -57,8 +57,190 @@ for i, fname in enumerate(CPT_FILES):
Counts
.
append
(
np
.
array
(
data
[
'datasets'
][
'counts_spectrum'
]))
#AmpTisa.append(np.array(data['datasets']['TISA_CPT_amp']))
print
(
np
.
array
(
data
[
'datasets'
][
'no_measures'
]))
#%%
i
=
4
x
,
y
=
Freqs
[
i
]
*
2
*
1e-6
,
Counts
[
i
]
plt
.
figure
(
1
),
plt
.
clf
()
plt
.
errorbar
(
x
,
y
,
yerr
=
np
.
sqrt
(
y
),
capsize
=
3
,
fmt
=
"."
,
label
=
"Medicion "
+
str
(
meds
[
i
]))
plt
.
xlabel
(
"Frequency [MHz]"
)
plt
.
ylabel
(
"Counts"
)
plt
.
legend
()
#%%
fig
,
axes
=
plt
.
subplots
(
4
,
2
,
figsize
=
(
12
,
10
))
# 4 filas, 2 columnas
axes
=
axes
.
transpose
()
.
flatten
()
# Para poder iterar fácilmente
for
i
in
range
(
8
):
ax
=
axes
[
i
]
x
,
y
=
Freqs
[
i
]
*
2
*
1e-6
,
Counts
[
i
]
ax
.
errorbar
(
x
,
y
,
yerr
=
2
*
np
.
sqrt
(
y
),
fmt
=
"."
,
capsize
=
3
)
ax
.
set_title
(
f
'VDown = {VDown[i]} V. Medición {meds[i]}'
)
ax
.
set_xlabel
(
'Detuning [MHz]'
)
ax
.
set_ylabel
(
'Counts'
)
ax
.
grid
(
True
)
plt
.
tight_layout
()
plt
.
show
()
#%%
""" Ajustes """
from
EITfit.lolo_modelo_full_8niveles
import
PerformExperiment_8levels_MM
from
scipy.optimize
import
curve_fit
import
time
import
pandas
as
pd
"""
SUPER AJUSTE (SA)
"""
SelectedCurveVec
=
[
i
]
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
gPS
,
gPD
,
=
2
*
np
.
pi
*
21.58e6
,
2
*
np
.
pi
*
1.35e6
alpha
=
0
drivefreq
=
2
*
np
.
pi
*
7.262
*
1e6
popt_SA_vec
=
[]
pcov_SA_vec
=
[]
Detuningsshort_vec
=
[]
Counts_vec
=
[]
Detuningslong_vec
=
[]
FittedCounts_vec
=
[]
Betas_vec
=
[]
ErrorBetas_vec
=
[]
Temp_vec
=
[]
ErrorTemp_vec
=
[]
DetuningsUV_vec
=
[]
ErrorDetuningsUV_vec
=
[]
for
selectedcurve
in
SelectedCurveVec
:
FreqsDR
=
Freqs
[
selectedcurve
]
CountsDR
=
Counts
[
selectedcurve
]
freqslong
=
np
.
arange
(
min
(
FreqsDR
),
max
(
FreqsDR
)
+
FreqsDR
[
1
]
-
FreqsDR
[
0
],
0.1
*
(
FreqsDR
[
1
]
-
FreqsDR
[
0
]))
CircPr
=
1
alpha
=
0
def
FitEIT_MM_single
(
Freqs
,
offset
,
DetDoppler
,
SG
,
SP
,
SCALE1
,
OFFSET
,
BETA1
,
TEMP
,
U
,
plot
=
False
):
freqs
=
[
2
*
f
*
1e-6
-
offset
for
f
in
Freqs
]
# BETA1=0
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
])
if
plot
:
return
ScaledFluo1
,
Detunings
else
:
return
ScaledFluo1
#return ScaledFluo1
t1
=
time
.
time
()
print
(
f
'Beginning {selectedcurve}'
)
popt_3_SA
,
pcov_3_SA
=
curve_fit
(
FitEIT_MM_single
,
FreqsDR
[
1
:],
CountsDR
,
p0
=
[
440
,
-
15
,
0.3
,
10
,
1e4
,
500
,
2
,
(
np
.
pi
**
2
)
*
1e-3
,
49.5e6
],
bounds
=
((
0
,
-
50
,
0
,
0
,
0
,
0
,
0
,
0
,
48e6
),
(
1000
,
0
,
2
,
20
,
5e4
,
2e3
,
3
,
(
np
.
pi
**
2
)
*
10e-3
,
50e6
)))
print
(
f
'Ended {selectedcurve}, time elapsed: {round(time.time()-t1)} s'
)
#popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3, 32e6], bounds=((0, -50, 0, 0, 0, 0, 0, 0, 25e6), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3, 40e6)))
popt_SA_vec
.
append
(
popt_3_SA
)
pcov_SA_vec
.
append
(
pcov_3_SA
)
#offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, U
FittedEITpi_3_SA_short
,
Detunings_3_SA_short
=
FitEIT_MM_single
(
FreqsDR
,
*
np
.
array
([
popt_3_SA
[
0
],
popt_3_SA
[
1
],
popt_3_SA
[
2
],
popt_3_SA
[
3
],
popt_3_SA
[
4
],
popt_3_SA
[
5
],
popt_3_SA
[
6
],
popt_3_SA
[
7
],
popt_3_SA
[
8
]]),
plot
=
True
)
freqslong
=
np
.
arange
(
min
(
FreqsDR
),
max
(
FreqsDR
)
+
FreqsDR
[
1
]
-
FreqsDR
[
0
],
0.1
*
(
FreqsDR
[
1
]
-
FreqsDR
[
0
]))
# popt_3_SA[4]=1
# popt_3_SA[5]=0
# popt_3_SA[6]=0
FittedEITpi_3_SA_long
,
Detunings_3_SA_long
=
FitEIT_MM_single
(
freqslong
,
*
np
.
array
([
popt_3_SA
[
0
],
popt_3_SA
[
1
],
popt_3_SA
[
2
],
popt_3_SA
[
3
],
popt_3_SA
[
4
],
popt_3_SA
[
5
],
popt_3_SA
[
6
],
popt_3_SA
[
7
],
popt_3_SA
[
8
]]),
plot
=
True
)
corri
=
0
DetuningsUV_vec
.
append
(
popt_3_SA
[
1
])
ErrorDetuningsUV_vec
.
append
(
np
.
sqrt
(
pcov_3_SA
[
1
,
1
]))
Betas_vec
.
append
(
popt_3_SA
[
6
])
ErrorBetas_vec
.
append
(
np
.
sqrt
(
pcov_3_SA
[
6
,
6
]))
Temp_vec
.
append
(
popt_3_SA
[
7
])
ErrorTemp_vec
.
append
(
np
.
sqrt
(
pcov_3_SA
[
7
,
7
]))
Detuningsshort_vec
.
append
(
Detunings_3_SA_short
)
Counts_vec
.
append
(
CountsDR
)
Detuningslong_vec
.
append
(
Detunings_3_SA_long
)
FittedCounts_vec
.
append
(
FittedEITpi_3_SA_long
)
plt
.
figure
()
plt
.
errorbar
(
Detunings_3_SA_short
[:],
CountsDR
,
yerr
=
2
*
np
.
sqrt
(
CountsDR
),
fmt
=
'o'
,
color
=
'darkgreen'
,
alpha
=
0.5
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
([
c
-
corri
for
c
in
Detunings_3_SA_long
],
FittedEITpi_3_SA_long
,
color
=
'darkolivegreen'
,
linewidth
=
3
,
label
=
f
'med {selectedcurve}'
)
#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
()
print
(
f
'listo med {selectedcurve}'
)
print
(
popt_3_SA
)
# Guardar datos en .csv
df
=
pd
.
DataFrame
({
'x_data'
:
Detunings_3_SA_short
[:],
'y_data'
:
CountsDR
,
'y_error'
:
2
*
np
.
sqrt
(
CountsDR
),
})
fit_x
=
[
c
-
corri
for
c
in
Detunings_3_SA_long
]
fit_df
=
pd
.
DataFrame
({
'fit_x'
:
fit_x
,
'fit_y'
:
FittedEITpi_3_SA_long
})
max_len
=
max
(
len
(
df
),
len
(
fit_df
))
df
=
df
.
reindex
(
range
(
max_len
))
fit_df
=
fit_df
.
reindex
(
range
(
max_len
))
# Concatenar los dos DataFrames
df_combined
=
pd
.
concat
([
df
,
fit_df
],
axis
=
1
)
# Añadir los parámetros del fit al final como una nueva fila (puedes usar una fila separadora)
fit_param_labels
=
[
'offset'
,
'DetDoppler'
,
'SG'
,
'SP'
,
'SCALE1'
,
'OFFSET'
,
'BETA1'
,
'TEMP'
,
'U'
]
fit_params_row
=
pd
.
Series
([
''
]
*
df_combined
.
shape
[
1
],
index
=
df_combined
.
columns
)
param_strs
=
[
f
"{label}={val:.5g}"
for
label
,
val
in
zip
(
fit_param_labels
,
popt_3_SA
)]
fit_params_row
.
iloc
[
0
]
=
'Fit parameters:'
fit_params_row
.
iloc
[
1
]
=
'; '
.
join
(
param_strs
)
# Añadir la fila al final
df_combined
=
pd
.
concat
([
df_combined
,
pd
.
DataFrame
([
fit_params_row
])],
ignore_index
=
True
)
# Guardar en CSV
df_combined
.
to_csv
(
f
'DataAndFit_IR_Scan_simple_{meds[i]}.csv'
,
index
=
False
)
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/000021360-IR_Scan_simple.h5
0 → 100644
View file @
f00f1e81
File added
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
0 → 100644
View file @
f00f1e81
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 2 16:30:09 2020
@author: oem
"""
"""
ESTE ES EL CODIGO QUE PLOTEA CPT CON MICROMOCION BIEN
"""
import
os
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
import
random
from
scipy.signal
import
savgol_filter
as
sf
def
PerformExperiment_8levels_MM
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
beta
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
):
"""
solvemode=1: resuelve con np.linalg.solve
solvemode=2: resuelve invirtiendo L con la funcion np.linalg.inv
"""
#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()
#print('Done, Total time: ', round((tfinal-tinicial), 2), "s")
return
ProbeDetuningVectorL
,
Fluovector
def
GenerateNoisyCPT_MM
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobeVec
,
kg
,
kr
,
v0
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
,
noiseamplitude
=
0.001
):
Frequencyvector
,
Fluovector
=
PerformExperiment_8levels_MM
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobeVec
,
kg
,
kr
,
v0
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
NoisyFluovector
=
[
fluo
+
noiseamplitude
*
(
2
*
random
.
random
()
-
1
)
for
fluo
in
Fluovector
]
return
Frequencyvector
,
NoisyFluovector
def
GenerateNoisyCPT_MM_fit
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobeVec
,
beta
,
drivefreq
,
freqs
,
circularityprobe
=
1
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
,
noiseamplitude
=
0.001
):
Frequencyvector
,
Fluovector
=
PerformExperiment_8levels_MM
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobeVec
,
beta
,
drivefreq
,
freqs
[
0
],
freqs
[
-
1
],
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
#NoisyFluovector = [fluo+noiseamplitude*(2*random.random()-1) for fluo in Fluovector]
return
Frequencyvector
,
Fluovector
def
SmoothNoisyCPT
(
Fluo
,
window
=
11
,
poly
=
3
):
SmoothenFluo
=
sf
(
Fluo
,
window
,
poly
)
return
SmoothenFluo
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/MM_eightLevel_2repumps_CPTPlotter.py
0 → 100644
View file @
f00f1e81
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 17:58:39 2020
@author: nico
"""
import
os
import
numpy
as
np
#os.chdir('/home/oem/Nextcloud/G_liaf/liaf-TrampaAnular/Código General/EIT-CPT/Buenos Aires/Experiment Simulations/CPT scripts/Eight Level 2 repumps')
#from MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels, GenerateNoisyCPT, SmoothNoisyCPT
import
matplotlib.pyplot
as
plt
import
time
#from threeLevel_2repumps_AnalysisFunctions import MeasureRelativeFluorescenceFromCPT, IdentifyPolarizationCoincidences, RetrieveAbsoluteCoincidencesBetweenMaps, GetClosestIndex
import
seaborn
as
sns
#C:\Users\Usuario\Nextcloud\G_liaf\liaf-TrampaAnular\Código General\EIT-CPT\Buenos Aires\Experiment Simulations\CPT scripts\Eight Level 2 repumps
ub
=
9.27e-24
#magneton de bohr
h
=
6.63e-34
#cte de planck
c
=
(
ub
/
h
)
*
1e-4
#en unidades de MHz/G
u
=
2e6
#proportional to the magnetic field of around 5 G
B
=
(
u
/
(
2
*
np
.
pi
))
/
c
gPS
,
gPD
,
=
2
*
np
.
pi
*
21.58e6
,
2
*
np
.
pi
*
1.35e6
#anchos de linea de las transiciones
lw
=
0.
#linewidth of the lasers, 0.1 MHz are the actual linewidths of both lasers
DopplerLaserLinewidth
,
ProbeLaserLinewidth
=
lw
,
lw
#ancho de linea de los laseres
TempVec
=
[
0e-3
]
#Temperature vector
alpha
=
0
#angle between lasers, which is zero
#Polarization angles (we can keep it fixed in 90)
phidoppler
,
titadoppler
=
0
,
90
titaprobe
=
90
phiprobe
=
0
#este es el desfasaje exp(i.phi) de la componente de la polarizacion y respecto a la x. Con 1 la polarizacion es lineal
CircPr
=
1
#this has to do with the circularity of the polarizations and since both are linear it is one
#Simulation parameters
center
=
-
10
span
=
200
freqMin
=
center
-
span
*
0.5
freqMax
=
center
+
span
*
0.5
freqStep
=
2e-1
noiseamplitude
=
0
#i dont know what it is
#parametros de saturacion de los laseres. g: doppler. p: probe (un rebombeo que scanea), r: repump (otro rebombeo fijo)
"""
Good case: sg=0.6, sp=9, DetDoppler=-15
"""
DetDoppler
=
-
25
#nice range: -30 to 0
sgvec
=
[
0.6
]
#nice range: 0.1 to 10 #g is for green but is the doppler
sp
=
8
#nice range: 0.1 to 20 #p is for probe but is the repump
drivefreq
=
2
*
np
.
pi
*
22.135
*
1e6
#ignore it
#betavec = np.arange(0,1.1,0.1) #ignore it
betavec
=
[
0
]
#ignore it
alphavec
=
[
0
]
#ignore it
fig1
,
ax1
=
plt
.
subplots
()
FrequenciesVec
=
[]
FluorescencesVec
=
[]
for
sg
in
sgvec
:
for
T
in
TempVec
:
for
alpha
in
alphavec
:
for
beta
in
betavec
:
Frequencies
,
Fluorescence
=
PerformExperiment_8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
beta
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
FrequenciesVec
.
append
(
Frequencies
)
FluorescencesVec
.
append
(
Fluorescence
)
ax1
.
plot
(
Frequencies
,
[
100
*
f
for
f
in
Fluorescence
],
label
=
fr
'$
\a
lpha={int(alpha*180/np.pi)}°$'
)
ax1
.
set_xlabel
(
'Detuning Rebombeo (MHz)'
)
ax1
.
set_ylabel
(
'Fluorescencia (AU)'
)
ax1
.
set_title
(
f
'Sdop: {sg}, Spr: {sp}, Temp: {int(T*1e3)} mK'
)
#ax1.legend()
ax1
.
grid
()
#%%
import
seaborn
as
sns
paleta
=
sns
.
color_palette
(
'mako'
)
plt
.
figure
()
plt
.
plot
(
Frequencies
,
[
100
*
f
for
f
in
Fluorescence
],
color
=
paleta
[
1
],
linewidth
=
3
)
plt
.
grid
()
plt
.
axvline
(
-
25
,
color
=
paleta
[
2
],
linestyle
=
'dashed'
)
plt
.
xlabel
(
r'$\Delta_2$ (MHz)'
,
fontsize
=
25
,
fontname
=
'STIXgeneral'
)
plt
.
ylabel
(
'Fluorescence'
,
fontsize
=
18
,
fontname
=
'STIXgeneral'
)
#%%
#Este bloque ajusta a las curvas con un beta de micromocion de 0
from
scipy.optimize
import
curve_fit
def
FitEIT_MM
(
freqs
,
Temp
):
BETA
=
0
scale
=
1
offset
=
0
Detunings
,
Fluorescence
=
PerformExperiment_8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
Temp
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
ScaledFluo
=
[
f
*
scale
+
offset
for
f
in
Fluorescence
]
return
ScaledFluo
TempMedidas
=
[]
FittedEIT_fluosVec
=
[]
for
j
in
range
(
len
(
betavec
)):
SelectedFluo
=
FluorescencesVec
[
j
]
SelectedFreqs
=
FrequenciesVec
[
j
]
popt_mm
,
pcov_mm
=
curve_fit
(
FitEIT_MM
,
SelectedFreqs
,
SelectedFluo
,
p0
=
[
1e-3
],
bounds
=
((
0
),
(
10e-3
)))
TempMedidas
.
append
(
1e3
*
popt_mm
[
2
])
print
(
popt_mm
)
FittedEIT_fluo
=
FitEIT_MM
(
SelectedFreqs
,
*
popt_mm
)
FittedEIT_fluosVec
.
append
(
FittedEIT_fluo
)
plt
.
figure
()
plt
.
plot
(
SelectedFreqs
,
SelectedFluo
,
'o'
)
plt
.
plot
(
SelectedFreqs
,
FittedEIT_fluo
)
plt
.
figure
()
for
i
in
range
(
len
(
FluorescencesVec
)):
plt
.
plot
(
SelectedFreqs
,
FluorescencesVec
[
i
],
'o'
,
markersize
=
3
)
plt
.
plot
(
SelectedFreqs
,
FittedEIT_fluosVec
[
i
])
plt
.
figure
()
plt
.
plot
(
betavec
,
TempMedidas
,
'o'
,
markersize
=
10
)
plt
.
xlabel
(
'Beta'
)
plt
.
ylabel
(
'Temperatura medida (mK)'
)
plt
.
axhline
(
T
*
1e3
,
label
=
'Temperatura real'
,
linestyle
=
'--'
,
color
=
'red'
)
plt
.
legend
()
plt
.
grid
()
\ No newline at end of file
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/MM_eightLevel_2repumps_python_scripts.py
0 → 100644
View file @
f00f1e81
This diff is collapsed.
Click to expand it.
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/lolo_modelo_full_3niveles.py
0 → 100644
View file @
f00f1e81
This diff is collapsed.
Click to expand it.
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/lolo_modelo_full_8niveles.py
0 → 100644
View file @
f00f1e81
This diff is collapsed.
Click to expand it.
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/threeLevel_2repumps_AnalysisFunctions.py
0 → 100644
View file @
f00f1e81
This diff is collapsed.
Click to expand it.
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/threeLevel_2repumps_CPTPlotter.py
0 → 100644
View file @
f00f1e81
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 17:58:39 2020
@author: oem
"""
import
os
import
numpy
as
np
#os.chdir('/home/oem/Nextcloud/G_liaf/liaf-TrampaAnular/Código General/EIT-CPT/Buenos Aires/Experiment Simulations/CPT scripts/Eight Level 2 repumps')
from
threeLevel_2repumps_AnalysisFunctions
import
CalculoTeoricoDarkResonances_8levels
,
GetMinimaInfo
,
GetPlotsofFluovsAngle_8levels
,
PerformExperiment_8levels
,
FindDRFrequencies
,
FindRelativeFluorescencesOfDR
,
GenerateNoisyCPT
,
SmoothNoisyCPT
,
GetFinalMaps
,
GenerateNoisyCPT_fixedRabi
,
GenerateNoisyCPT_fit
import
matplotlib.pyplot
as
plt
import
time
from
threeLevel_2repumps_AnalysisFunctions
import
MeasureRelativeFluorescenceFromCPT
,
IdentifyPolarizationCoincidences
,
RetrieveAbsoluteCoincidencesBetweenMaps
,
GetClosestIndex
#C:\Users\Usuario\Nextcloud\G_liaf\liaf-TrampaAnular\Código General\EIT-CPT\Buenos Aires\Experiment Simulations\CPT scripts\Eight Level 2 repumps
ub
=
9.27e-24
h
=
6.63e-34
c
=
(
ub
/
h
)
*
1e-4
#en unidades de MHz/G
#u = 1e6
u
=
33.5e6
B
=
(
u
/
(
2
*
np
.
pi
))
/
c
#sg, sp = 0.6, 5 #parámetros de control, saturación del doppler y repump
#rabG, rabP = sg*gPS, sp*gPD #frecuencias de rabi
gPS
,
gPD
,
=
2
*
np
.
pi
*
21.58e6
,
2
*
np
.
pi
*
1.35e6
#anchos de linea de las transiciones
lw
=
0.1
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
=
lw
,
lw
,
lw
#ancho de linea de los laseres
DetDoppler
=
-
36
#42
DetRepumpVec
=
[
DetDoppler
+
29.6
]
Tvec
=
[
0.7
]
#temperatura en mK
alpha
=
0
*
(
np
.
pi
/
180
)
#angulo entre los láseres
phidoppler
,
titadoppler
=
0
,
90
phirepump
,
titarepump
=
0
,
0
phiprobe
=
0
titaprobe
=
90
#Calculo las resonancias oscuras teóricas
#ResonanciasTeoricas, DRPositivas = CalculoTeoricoDarkResonances_8levels(u/(2*np.pi*1e6), titadoppler, DetDoppler, DetRepump)
#Parametros de la simulacion cpt
center
=
-
45
span
=
80
freqMin
=
center
-
span
*
0.5
freqMax
=
center
+
span
*
0.5
""" parametros para tener espectros coherentes
freqMin = -56
freqMax = 14
"""
freqStep
=
1e-1
noiseamplitude
=
0
RelMinMedido0Vector
=
[]
RelMinMedido1Vector
=
[]
RelMinMedido2Vector
=
[]
RelMinMedido3Vector
=
[]
RelMinMedido4Vector
=
[]
#Sr = np.arange(0, 10, 0.2)
#Sg = np.arange(0.01, 1, 0.05)
#Sp = np.arange(0.1, 6.1, 1)
#Sg = [0.6**2]
#Sp = [2.3**2]
Sg
=
[
1.4
]
Sp
=
[
6
]
Sr
=
[
11
]
i
=
0
save
=
False
showFigures
=
True
if
not
showFigures
:
plt
.
ioff
()
else
:
plt
.
ion
()
fig1
,
ax1
=
plt
.
subplots
()
offsetx
=
464
ax1
.
plot
([
f
-
offsetx
for
f
in
FreqsDR
],
CountsDR
,
'o'
)
run
=
True
Scale
=
730
Offset
=
600
#600 para 20k cuentas aprox
MaxCoherenceValue
=
[]
for
sg
in
Sg
:
for
sp
in
Sp
:
rabG
,
rabP
=
sg
*
gPS
,
sp
*
gPD
for
Ti
in
Tvec
:
T
=
Ti
*
1e-3
for
DetRepump
in
DetRepumpVec
:
print
(
T
)
for
sr
in
Sr
:
rabR
=
sr
*
gPD
#MeasuredFreq, MeasuredFluo = GenerateNoisyCPT(rabG, rabR, rabP, gPS, gPD, DetDoppler, DetRepump, u, DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, [titaprobe], phirepump, titarepump, freqMin, freqMax, freqStep, plot=False, solvemode=1, detpvec=None, noiseamplitude=noiseamplitude)
if
run
:
MeasuredFreq4
,
MeasuredFluo4
=
GenerateNoisyCPT_fixedRabi
(
sg
,
sr
,
sp
,
gPS
,
gPD
,
DetDoppler
,
DetRepump
,
u
,
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
[
titaprobe
],
phirepump
,
titarepump
,
freqMin
,
freqMax
,
freqStep
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
,
noiseamplitude
=
noiseamplitude
)
#SmoothFluo = SmoothNoisyCPT(MeasuredFluo, window=9, poly=2)
SmoothFluo4
=
MeasuredFluo4
#Scale = max(BestC)/max([100*s for s in SmoothFluo4])
ax1
.
plot
(
MeasuredFreq4
,
[
Scale
*
100
*
f
+
Offset
for
f
in
SmoothFluo4
],
label
=
f
'Sr = {sr}'
)
ax1
.
axvline
(
DetDoppler
,
linestyle
=
'--'
,
linewidth
=
1
)
#if sr != 0:
#ax1.axvline(DetRepump, linestyle='--', linewidth=1)
MaxCoherenceValue
.
append
(
np
.
max
(
SmoothFluo4
))
#print(titaprobe)
ax1
.
set_xlabel
(
'Detuning Rebombeo (MHz)'
)
ax1
.
set_ylabel
(
'Fluorescencia (AU)'
)
ax1
.
set_title
(
f
'B: {round(B, 2)} G, Sdop: {round(sg, 2)}, Sp: {round(sp, 2)}, Sr: {round(sr, 2)}, lw: {lw} MHz, T: {Ti} mK'
)
#ax1.set_ylim(0, 8)
#ax1.axvline(DetDoppler, linestyle='dashed', color='red', linewidth=1)
#ax1.axvline(DetRepump, linestyle='dashed', color='black', linewidth=1)
#ax1.set_title('Pol Doppler y Repump: Sigma+ Sigma-, Pol Probe: PI')
#ax1.legend()
ax1
.
grid
()
print
(
f
'{i+1}/{len(Sg)*len(Sp)}'
)
i
=
i
+
1
if
save
:
plt
.
savefig
(
f
'Mapa_plots_100k_1mk/CPT_SMSM_sdop{round(sg, 2)}_sp{round(sp, 2)}_sr{round(sr, 2)}.jpg'
)
ax1
.
legend
()
"""
plt.figure()
plt.plot(Sr, MaxCoherenceValue, 'o')
plt.xlabel('Sr')
plt.ylabel('Coherence')
"""
"""
plt.figure()
plt.plot(MeasuredFreq, [100*f for f in SmoothFluo], color='darkred')
plt.xlabel('Desintonía 866 (MHz)')
plt.ylabel('Fluorescencia (A.U.)')
plt.axvline(-30, color='darkblue', linewidth=1.2, linestyle='--')
plt.yticks(np.arange(0.4, 1.8, 0.2))
plt.ylim(0.5, 1.6)
plt.grid()
plt.figure()
plt.plot(MeasuredFreq4, [100*f for f in SmoothFluo4], color='darkred')
plt.xlabel('Desintonía 866 (MHz)')
plt.ylabel('Fluorescencia (A.U.)')
plt.axvline(-30, color='darkblue', linewidth=1.2, linestyle='--')
plt.yticks(np.arange(0.8, 2.4, 0.4))
plt.grid()
"""
#%%
from
scipy.optimize
import
curve_fit
T
=
0.5e-3
sg
=
0.7
sp
=
6
sr
=
0
DetDoppler
=
-
14
DetRepump
=
0
FitsSp
=
[]
FitsOffset
=
[]
Sg
=
[
0.87
]
def
FitEIT
(
freqs
,
SP
,
offset
):
MeasuredFreq
,
MeasuredFluo
=
GenerateNoisyCPT_fit
(
0.87
,
sr
,
SP
,
gPS
,
gPD
,
DetDoppler
,
DetRepump
,
u
,
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
[
titaprobe
],
phirepump
,
titarepump
,
freqs
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
,
noiseamplitude
=
noiseamplitude
)
FinalFluo
=
[
f
*
43000
+
2685
for
f
in
MeasuredFluo
]
return
FinalFluo
freqs
=
[
f
-
offsetx
+
32
for
f
in
FreqsDR
]
freqslong
=
np
.
arange
(
min
(
freqs
),
max
(
freqs
)
+
freqs
[
1
]
-
freqs
[
0
],
0.1
*
(
freqs
[
1
]
-
freqs
[
0
]))
popt
,
pcov
=
curve_fit
(
FitEIT
,
freqs
,
CountsDR
,
p0
=
[
5
,
700
],
bounds
=
(
0
,
[
10
,
1e6
]))
FitsSp
.
append
(
popt
[
0
])
FitsOffset
.
append
(
popt
[
1
])
print
(
popt
)
FittedEIT
=
FitEIT
(
freqslong
,
*
popt
)
plt
.
figure
()
plt
.
errorbar
(
freqs
,
CountsDR
,
yerr
=
2
*
np
.
sqrt
(
CountsDR
),
fmt
=
'o'
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslong
,
FitEIT
(
freqslong
,
*
popt
))
plt
.
title
(
f
'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {T*1e3} mK, detDop: {DetDoppler} MHz'
)
np
.
savetxt
(
'CPT_measured.txt'
,
np
.
transpose
([
freqs
,
CountsDR
]))
np
.
savetxt
(
'CPT_fitted.txt'
,
np
.
transpose
([
freqslong
,
FittedEIT
]))
analisis/plots/20250516_CPT_bladetrap/Data2/EITfit/threeLevel_2repumps_linealpol_python_scripts.py
0 → 100644
View file @
f00f1e81
This diff is collapsed.
Click to expand it.
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