Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c18495d4849f
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 04b72642c280
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Aug 13, 2014

  1. Copy the full SHA
    fd16be6 View commit details
  2. Copy the full SHA
    110b42f View commit details
  3. Copy the full SHA
    04b7264 View commit details
Showing with 14 additions and 12 deletions.
  1. +3 −0 artiq/sim/devices.py
  2. +6 −6 examples/al_spectroscopy.py
  3. +5 −6 examples/simple_simulation.py
3 changes: 3 additions & 0 deletions artiq/sim/devices.py
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ def run(self, k_function, k_args, k_kwargs):

class Input(AutoContext):
parameters = "name"
implicit_core = False

def build(self):
self.prng = Random()
@@ -27,13 +28,15 @@ def count_gate(self, duration):

class WaveOutput(AutoContext):
parameters = "name"
implicit_core = False

def pulse(self, frequency, duration):
time.manager.event(("pulse", self.name, frequency, duration))
delay(duration)

class VoltageOutput(AutoContext):
parameters = "name"
implicit_core = False

def set(self, value):
time.manager.event(("set_voltage", self.name, value))
12 changes: 6 additions & 6 deletions examples/al_spectroscopy.py
Original file line number Diff line number Diff line change
@@ -36,12 +36,12 @@ def run(self):

exp = AluminumSpectroscopy(
core=sd.Core(),
mains_sync=sd.Input("mains_sync"),
laser_cooling=sd.WaveOutput("laser_cooling"),
spectroscopy=sd.WaveOutput("spectroscopy"),
spectroscopy_b=sd.VoltageOutput("spectroscopy_b"),
state_detection=sd.WaveOutput("state_detection"),
pmt=sd.Input("pmt"),
mains_sync=sd.Input(name="mains_sync"),
laser_cooling=sd.WaveOutput(name="laser_cooling"),
spectroscopy=sd.WaveOutput(name="spectroscopy"),
spectroscopy_b=sd.VoltageOutput(name="spectroscopy_b"),
state_detection=sd.WaveOutput(name="state_detection"),
pmt=sd.Input(name="pmt"),

spectroscopy_freq=432*MHz,
photon_limit_low=10,
11 changes: 5 additions & 6 deletions examples/simple_simulation.py
Original file line number Diff line number Diff line change
@@ -18,13 +18,12 @@ def run(self):
from artiq.sim import devices as sd
from artiq.sim import time

coredev = sd.Core()
exp = SimpleSimulation(
core=coredev,
a=sd.WaveOutput(core=coredev, name="a"),
b=sd.WaveOutput(core=coredev, name="b"),
c=sd.WaveOutput(core=coredev, name="c"),
d=sd.WaveOutput(core=coredev, name="d"),
core=sd.Core(),
a=sd.WaveOutput(name="a"),
b=sd.WaveOutput(name="b"),
c=sd.WaveOutput(name="c"),
d=sd.WaveOutput(name="d"),
)
exp.run()
print(time.manager.format_timeline())