2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-27 04:08:27 +08:00
artiq/examples/sim/al_spectroscopy.py

44 lines
1.4 KiB
Python
Raw Normal View History

2014-09-30 17:38:02 +08:00
from artiq import *
2014-05-17 20:08:50 +08:00
2014-09-05 12:03:22 +08:00
class AluminumSpectroscopy(Experiment, AutoDB):
"""Aluminum spectroscopy (simulation)"""
class DBKeys:
2015-03-08 18:37:53 +08:00
core = Device()
mains_sync = Device()
laser_cooling = Device()
spectroscopy = Device()
spectroscopy_b = Device()
state_detection = Device()
pmt = Device()
spectroscopy_freq = Parameter(432*MHz)
photon_limit_low = Argument(10)
photon_limit_high = Argument(15)
2014-09-05 12:03:22 +08:00
@kernel
def run(self):
state_0_count = 0
for count in range(100):
self.mains_sync.wait_edge()
delay(10*us)
self.laser_cooling.pulse(100*MHz, 100*us)
delay(5*us)
with parallel:
self.spectroscopy.pulse(self.spectroscopy_freq, 100*us)
with sequential:
delay(50*us)
self.spectroscopy_b.set(200)
delay(5*us)
while True:
delay(5*us)
with parallel:
self.state_detection.pulse(100*MHz, 10*us)
photon_count = self.pmt.count_gate(10*us)
if (photon_count < self.photon_limit_low
or photon_count > self.photon_limit_high):
break
if photon_count < self.photon_limit_low:
state_0_count += 1
return state_0_count