2016-01-26 07:03:01 +08:00
|
|
|
from artiq.experiment import *
|
2014-05-17 20:08:50 +08:00
|
|
|
|
2014-09-05 12:03:22 +08:00
|
|
|
|
2015-07-14 04:08:20 +08:00
|
|
|
class AluminumSpectroscopy(EnvExperiment):
|
2015-03-08 22:43:04 +08:00
|
|
|
"""Aluminum spectroscopy (simulation)"""
|
2015-02-22 11:34:31 +08:00
|
|
|
|
2015-07-14 04:08:20 +08:00
|
|
|
def build(self):
|
2015-10-04 00:18:21 +08:00
|
|
|
self.setattr_device("core")
|
|
|
|
self.setattr_device("mains_sync")
|
|
|
|
self.setattr_device("laser_cooling")
|
|
|
|
self.setattr_device("spectroscopy")
|
|
|
|
self.setattr_device("spectroscopy_b")
|
|
|
|
self.setattr_device("state_detection")
|
|
|
|
self.setattr_device("pmt")
|
2015-10-12 17:18:23 +08:00
|
|
|
self.setattr_dataset("spectroscopy_freq", 432*MHz)
|
2015-12-27 11:57:13 +08:00
|
|
|
self.setattr_argument("photon_limit_low", NumberValue(10))
|
|
|
|
self.setattr_argument("photon_limit_high", NumberValue(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)
|
2016-02-24 01:39:02 +08:00
|
|
|
with parallel:
|
2014-09-05 12:03:22 +08:00
|
|
|
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)
|
2016-02-24 01:39:02 +08:00
|
|
|
with parallel:
|
2014-09-05 12:03:22 +08:00
|
|
|
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
|