Skip to content

Instantly share code, notes, and snippets.

########################################################################################################################
# ParallelForLoopTest
#
# Connectivity
# * TTL4 [output] -> MSOX2024A Channel 1 (trigger)
# * TTL7 [output] -> MSOX2024A Channel 2
# * Urukul0_ch0 [output] -> MSOX2024A Channel 3
#
# Description
# * Depending on the order of operations the TTL pulses can silently fail
@mfe5003
mfe5003 / dds_lockup.py
Created April 25, 2019 00:03
trying to break 2 dds card system to produce AUX_DAC mismatch
from artiq.experiment import *
class SetDDSProfile(object):
def __init__(self, device, frequency, amplitude, phase, switch_state):
self._device = device
self._ftw = self._device.frequency_to_ftw(frequency)
self._asf = self._device.amplitude_to_asf(amplitude)
self._pow = self._device.turns_to_pow(phase)
self._sw = switch_state
@mfe5003
mfe5003 / parallel_sequential_error_no_deps.py
Created April 24, 2019 18:25
artiq for loop converted to sequential
########################################################################################################################
# ParallelForLoopTest
#
# Connectivity
# * TTL4 [output] -> MSOX2024A Channel 1 (trigger)
# * TTL7 [output] -> MSOX2024A Channel 2
#
# Description
#
########################################################################################################################
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\n\$ '
@mfe5003
mfe5003 / mebert.vim
Created September 26, 2018 19:01
vim color scheme for servers, based on pablo (no blue!)
" local syntax file - set colors on a per-machine basis:
" vim: tw=0 ts=4 sw=4
" Vim color file
" Maintainer: mebert
" Last Change: 2018 Sept 26
hi clear
set background=dark
if exists("syntax_on")
syntax reset
@mfe5003
mfe5003 / .vimrc
Created September 26, 2018 19:00
.vimrc for servers
syntax on
colorscheme mebert
set nu
map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
@mfe5003
mfe5003 / led.py
Created September 20, 2018 18:11
minimal artiq kasli experiment
from artiq.experiment import *
class LED(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("led0")
self.setattr_device("led1")
@kernel
@mfe5003
mfe5003 / device_db.py
Created September 17, 2018 22:24
modified device database
# This is an example device database that needs to be adapted to your setup.
# The list of devices here is not exhaustive.
core_addr = "192.168.1.150"
device_db = {
"core": {
"type": "local",
"module": "artiq.coredevice.core",
"class": "Core",
def answer(map, git_gud=True):
"""Find the shortest path in a binary 2D map where a wall can be removed.
The algorithm uses a modified Dijstra's algorithm to find the shortest path
from the start vertex (0,0) to the end vertex (w-1,h-1) in a 2D binary map.
A single wall can be removed from the map to make the shortest path, if
necessary. The first wall in any path can be ignored easily, but if a wall
is necessary to be removed for a valid solution to exist the simple
algorithm does not remember the minimum path that does not pass through a
wall to arrive at the mandatory wall vertex. Therefore we modify the
@mfe5003
mfe5003 / dds_ram_test.py
Created August 25, 2018 15:47
dds RAM mode test experiment
from artiq.experiment import *
import numpy as np
class DDSTest(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("core_dma")
self.setattr_device("led0")
self.setattr_device("ttl4")