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
e05cb655
Commit
e05cb655
authored
Jul 07, 2021
by
Lucas Giardino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sweep IR andando a medias
parent
aa80cc43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
62 deletions
+45
-62
IR_spectrum.py
artiq_master/repository/Experiments/IR_spectrum.py
+45
-62
No files found.
artiq_master/repository/Experiments/IR_spectrum.py
View file @
e05cb655
...
@@ -9,6 +9,10 @@ import numpy as np
...
@@ -9,6 +9,10 @@ import numpy as np
class
SingleChannelScan
(
EnvExperiment
):
class
SingleChannelScan
(
EnvExperiment
):
"""IR frequency sweep"""
"""IR frequency sweep"""
def
build
(
self
):
def
build
(
self
):
# Agrego kernel invariants a ver si mejoro algo de la performance
kernel_invariants
=
getattr
(
self
,
'kernel_invariants'
,
set
())
self
.
kernel_invariants
=
kernel_invariants
|
{
"no_measures"
,
"t_cool"
,
"IR_Freqs"
,
"t_trans"
,
"t_readout"
}
self
.
setattr_device
(
"core"
)
self
.
setattr_device
(
"core"
)
self
.
setattr_device
(
"ccb"
)
self
.
setattr_device
(
"ccb"
)
...
@@ -18,7 +22,7 @@ class SingleChannelScan(EnvExperiment):
...
@@ -18,7 +22,7 @@ class SingleChannelScan(EnvExperiment):
self
.
laserIR
=
UrukulCh
(
self
,
ch
=
1
,
freq
=
208.0
,
amp
=
0.35
,
name
=
"IR"
)
#corresponde a 0.8 Vpp
self
.
laserIR
=
UrukulCh
(
self
,
ch
=
1
,
freq
=
208.0
,
amp
=
0.35
,
name
=
"IR"
)
#corresponde a 0.8 Vpp
self
.
setattr_argument
(
"no_measures"
,
self
.
setattr_argument
(
"no_measures"
,
NumberValue
(
10
0
,
min
=
1
,
ndecimals
=
0
,
step
=
1
),
NumberValue
(
10
,
min
=
1
,
ndecimals
=
0
,
step
=
1
),
"Experiment params"
)
"Experiment params"
)
self
.
setattr_argument
(
f
"IR_cooling_freq"
,
self
.
setattr_argument
(
f
"IR_cooling_freq"
,
...
@@ -26,7 +30,7 @@ class SingleChannelScan(EnvExperiment):
...
@@ -26,7 +30,7 @@ class SingleChannelScan(EnvExperiment):
"Experiment params"
)
"Experiment params"
)
self
.
setattr_argument
(
f
"t_cool"
,
self
.
setattr_argument
(
f
"t_cool"
,
NumberValue
(
1
0
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
NumberValue
(
5
0
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
"Experiment params"
)
"Experiment params"
)
self
.
setattr_argument
(
f
"t_trans"
,
self
.
setattr_argument
(
f
"t_trans"
,
...
@@ -41,7 +45,7 @@ class SingleChannelScan(EnvExperiment):
...
@@ -41,7 +45,7 @@ class SingleChannelScan(EnvExperiment):
self
.
setattr_argument
(
"Comments"
,
StringValue
(
" "
),
"General comments"
)
self
.
setattr_argument
(
"Comments"
,
StringValue
(
" "
),
"General comments"
)
self
.
setattr_argument
(
"IR_Freqs"
,
Scannable
(
self
.
setattr_argument
(
"IR_Freqs"
,
Scannable
(
default
=
CenterScan
(
208
*
MHz
,
2
0
*
MHz
,
0.1
*
MHz
),
default
=
CenterScan
(
208
*
MHz
,
1
0
*
MHz
,
0.1
*
MHz
),
unit
=
"MHz"
,
unit
=
"MHz"
,
scale
=
MHz
,
scale
=
MHz
,
global_min
=
1
*
MHz
,
global_min
=
1
*
MHz
,
...
@@ -51,20 +55,9 @@ class SingleChannelScan(EnvExperiment):
...
@@ -51,20 +55,9 @@ class SingleChannelScan(EnvExperiment):
@
rpc
@
rpc
def
create_datasets
(
self
):
def
create_datasets
(
self
):
self
.
set_dataset
(
"measurements"
,
np
.
zeros
((
self
.
no_measures
,
len
(
self
.
IR_Freqs
.
sequence
)),
dtype
=
int
),
broadcast
=
False
,
archive
=
True
)
for
i
in
range
(
len
(
self
.
IR_Freqs
.
sequence
)):
self
.
set_dataset
(
"IR_frequencies"
,
self
.
IR_Freqs
.
sequence
,
broadcast
=
True
,
archive
=
True
)
if
i
<
10
:
self
.
set_dataset
(
f
"counts_00{i}"
,
np
.
zeros
(
self
.
no_measures
,
dtype
=
int
),
broadcast
=
True
,
archive
=
True
)
elif
i
<
100
:
self
.
set_dataset
(
f
"counts_0{i}"
,
np
.
zeros
(
self
.
no_measures
,
dtype
=
int
),
broadcast
=
True
,
archive
=
True
)
else
:
self
.
set_dataset
(
f
"counts_{i}"
,
np
.
zeros
(
self
.
no_measures
,
dtype
=
int
),
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"IR_frequencies"
,
self
.
IR_Freqs
.
sequence
,
dtype
=
float
),
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"t_enfriar_ion"
,
self
.
t_cool
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_enfriar_ion"
,
self
.
t_cool
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_transitory"
,
self
.
t_trans
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_transitory"
,
self
.
t_trans
,
broadcast
=
False
,
archive
=
True
)
...
@@ -75,13 +68,14 @@ class SingleChannelScan(EnvExperiment):
...
@@ -75,13 +68,14 @@ class SingleChannelScan(EnvExperiment):
self
.
set_dataset
(
"current_freq"
,
np
.
array
([
0.0
]),
self
.
set_dataset
(
"current_freq"
,
np
.
array
([
0.0
]),
broadcast
=
True
,
archive
=
False
)
broadcast
=
True
,
archive
=
False
)
self
.
set_dataset
(
"Comments"
,
self
.
Comments
)
self
.
set_dataset
(
"Comments"
,
self
.
Comments
,
broadcast
=
False
,
archive
=
True
)
self
.
laserIR
.
generate_dataset
()
self
.
laserIR
.
generate_dataset
()
self
.
laserUV
.
generate_dataset
()
self
.
laserUV
.
generate_dataset
()
@
rpc
@
rpc
(
flags
=
{
"async"
})
def
create_applets
(
self
):
def
create_applets
(
self
):
self
.
ccb
.
issue
(
"create_applet"
,
"cuentas"
,
self
.
ccb
.
issue
(
"create_applet"
,
"cuentas"
,
"${python} -m pyLIAF.artiq.applets.histogram "
"${python} -m pyLIAF.artiq.applets.histogram "
"counts "
"counts "
...
@@ -93,73 +87,62 @@ class SingleChannelScan(EnvExperiment):
...
@@ -93,73 +87,62 @@ class SingleChannelScan(EnvExperiment):
@
kernel
@
kernel
def
run
(
self
):
def
run
(
self
):
t_cool_mu
=
self
.
core
.
seconds_to_mu
(
self
.
t_cool
)
# Precomputo esto para despues
cuentas
=
0
self
.
create_datasets
()
self
.
create_datasets
()
self
.
create_applets
()
self
.
create_applets
()
self
.
init_kernel
()
self
.
init_kernel
()
delay
(
1
*
ms
)
delay
(
1
*
ms
)
self
.
laserIR
.
on
()
self
.
enfriar_i
on
()
self
.
laserUV
.
on
()
for
runN
in
range
(
self
.
no_measures
):
for
runN
in
range
(
self
.
no_measures
):
fr
=
0
# va a ser un indice de la matriz que guardo
for
freq
in
self
.
IR_Freqs
.
sequence
:
for
freq
in
self
.
IR_Freqs
.
sequence
:
self
.
mutate_dataset
(
"current_freq"
,
np
.
array
([
freq
]),
at_mu
(
self
.
core
.
get_rtio_counter_mu
())
# espero lo que haya que esperar por el mutate
broadcast
=
True
,
archive
=
False
)
delay
(
150
*
us
)
# Agrego unos forros 200us porque si no no anda
at_mu
(
self
.
core
.
get_rtio_counter_mu
()
+
self
.
core
.
seconds_to_mu
(
self
.
t_cool
)
)
delay
(
self
.
t_cool
)
# Mas el tiempo de cooling, ~ 50us
self
.
laserIR
.
set_channel
(
freq
)
delay
(
self
.
t_trans
)
self
.
laserIR
.
channel
.
set
(
freq
,
profile
=
1
)
# Cambio la frec del perfil 1 (estoy en el 0)
self
.
mutate_dataset
(
"counts"
,
runN
,
self
.
readout
())
at_mu
(
self
.
core
.
get_rtio_counter_mu
()
+
10000
)
self
.
enfriar_ion
()
cuentas
=
self
.
readout
()
# Hago la medicion y vuelvo con las cuentas
self
.
mutate_dataset
(
"measurements"
,
(
runN
,
fr
),
cuentas
)
fr
+=
1
@
kernel
@
kernel
def
init_kernel
(
self
):
def
init_kernel
(
self
):
self
.
core
.
reset
()
self
.
core
.
reset
()
self
.
pmt
.
input
()
self
.
pmt
.
input
()
self
.
pmt_state
.
output
()
self
.
laserIR
.
initialize_channel
()
self
.
laserUV
.
initialize_channel
()
self
.
laserUV
.
initialize_channel
()
# Quizas haya errores de tiempo.
self
.
laserIR
.
initialize_channel
()
# Seteo los perfiles 0 y 1 con los mismos valores
# el 0 va a ser la referencia, el 1 va a ser el que se mueve
self
.
laserIR
.
set_channel
()
self
.
laserIR
.
set_channel
()
self
.
laserUV
.
set_channel
()
self
.
laserUV
.
set_channel
()
self
.
laserIR
.
set_channel
(
profile
=
1
)
self
.
laserUV
.
set_channel
(
profile
=
1
)
# Me aseguro que todo termine antes de seguir
self
.
core
.
break_realtime
()
self
.
core
.
wait_until_mu
(
now_mu
())
self
.
core
.
wait_until_mu
(
now_mu
())
@
kernel
@
kernel
def
enfriar_ion
(
self
):
def
enfriar_ion
(
self
):
"""Preparo el ion prendiendo ambos laseres"""
"""Enfrio llevando el laser IR a una cierta frecuencia"""
self
.
laserIR
.
set_channel
(
self
.
IR_cooling_freq
)
# self.laserIR.set_frequency(self.IR_cooling_freq)
#self.laserIR.on()
self
.
laserIR
.
select_profile
(
0
)
# Pongo el laser en el perfil referencia
self
.
laserUV
.
on
()
#delay(self.t_cool)
@
kernel
@
kernel
def
readout
(
self
):
def
readout
(
self
)
->
TInt64
:
"""Registro de cuentas emitidas"""
"""Registro de cuentas emitidas"""
self
.
laserIR
.
select_profile
(
1
)
# Paso al perfil que cambia
here
=
self
.
pmt
.
gate_rising
(
self
.
t_readout
)
#delay(self.t_trans)
cuentas
=
self
.
pmt
.
count
(
here
)
here
=
self
.
pmt
.
gate_rising
(
self
.
t_readout
)
# Que mida durante t_readout
delay
(
1
*
us
)
self
.
enfriar_ion
()
# ya pongo a enfriar, asi todos los retardos estan enfriando
return
cuentas
return
self
.
pmt
.
count
(
here
)
# recupero las cuentas medidas
"""
@kernel
def run_kernel(self):
delay(10*ms)
self.salida.set_amplitude(self.amp)
self.salida.set_phase_mode(PHASE_MODE_ABSOLUTE)
self.salida.set(self.freqs.sequence[0])
for freq in self.freqs.sequence:
self.salida.sw.pulse(6*ms)
self.salida.set(freq)
self.mutate_dataset("current_freq", 0, freq)
delay(4*s)
"""
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