Skip to content

Instantly share code, notes, and snippets.

View blakejohnson's full-sized avatar

Blake Johnson blakejohnson

View GitHub Profile
@blakejohnson
blakejohnson / Coupled Duffing oscillators.ipynb
Created June 6, 2014 18:30
Coupled Duffing oscillators.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blakejohnson
blakejohnson / analysis.ipynb
Created December 1, 2014 17:21
Basic single-shot analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blakejohnson
blakejohnson / openlibs.txt
Created November 30, 2012 01:33
Open libraries on Winston plot() segfault
julia-rel 96300 bjohnson txt REG 14,4 324108 1139085099 /Users/bjohnson/src/julia/usr/bin/julia-release-readline
julia-rel 96300 bjohnson txt REG 14,4 13883724 1139084854 /Users/bjohnson/src/julia/usr/lib/libjulia-release.dylib
julia-rel 96300 bjohnson txt REG 14,4 27232 1139060250 /Users/bjohnson/src/julia/usr/lib/librandom.dylib
julia-rel 96300 bjohnson txt REG 14,4 35328 277367858 /usr/X11/lib/libxcb-shm.0.dylib
julia-rel 96300 bjohnson txt REG 14,4 26016 277367828 /usr/X11/lib/libX11-xcb.1.dylib
julia-rel 96300 bjohnson txt REG 14,4 43968 277367830 /usr/X11/lib/libXau.6.dylib
julia-rel 96300 bjohnson txt REG 14,4 76272 277367853 /usr/X11/lib/libxcb-render.0.dylib
julia-rel 96300 bjohnson txt REG 14,4 15008 1132371938 /usr/local/Cellar/glib/2.34.2/lib/libgmodule-2.0.0.dylib
julia-rel 96300 bjohnson txt REG
@blakejohnson
blakejohnson / SimSpeedTest.jl
Last active December 10, 2015 04:48
Unitary propagator speed test
require("profile")
using Profile
@profile begin
function expm_eigen(A::Matrix{Complex128}, t)
#Calculates expm(t*A) via eigenvalue decomposition and assuming Hermitian matrix
D, V = eig(A, true)
# V * diagm(exp(t*D)) * V'
return diagmm(V, exp(t*D)) * V'
@blakejohnson
blakejohnson / loadGaussian.m
Created January 17, 2013 20:59
Loads a Gaussian waveform onto the APS
aps = deviceDrivers.APS();
aps.connect(0);
aps.init();
% configure the APS
% set up channel 1
aps.setAmplitude(1, 1.0);
aps.setOffset(1, 0);
aps.setEnabled(1, true);
@blakejohnson
blakejohnson / SimSpeedTest.jl
Created May 17, 2013 15:57
Unitary evolution code in Julia
function expm_eigen(A::Matrix, t)
#Calculates expm(t*A) via eigenvalue decomposition and assuming Hermitian matrix
F = eigfact(Hermitian(A))
# V * diagm(exp(t*D)) * V'
return scale(F[:vectors], exp(t*F[:values])) * F[:vectors]'
end
function evolution_unitary(Hnat::Matrix{Complex128}, controlHams::Array{Complex128, 3}, controlFields::Matrix{Float64}, controlFreqs::Vector{Float64})
@blakejohnson
blakejohnson / Makefile
Last active December 18, 2015 19:18
Minimal example of BLAS + libunwind on OS X
all: test test2 test3 test4 test5
JULIADIR = /Users/bjohnson/src/julia
JULIALIB = $(JULIADIR)/usr/lib
OPENBLASDIR = $(JULIADIR)/deps/openblas-develop
# LDFLAGS = -Wl,-no_compact_unwind
LDFLAGS =
test: unwind.c
clang -g -DAPPLEBLAS -framework vecLib -lblas $(LDFLAGS) unwind.c -o test
@blakejohnson
blakejohnson / test1.ipynb
Created August 21, 2013 15:32
Unresponsive IJulia notebook.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function expm_eigen(A::Matrix, t)
#Calculates expm(t*A) via eigenvalue decomposition and assuming Hermitian matrix
F = eigfact(Hermitian(A))
# V * diagm(exp(t*D)) * V'
return scale(F[:vectors], exp(t*F[:values])) * F[:vectors]'
end
function evolution_unitary(Hnat::Matrix{Complex128}, controlHams::Array{Complex128, 3}, controlFields::Matrix{Float64}, controlFreqs::Vector{Float64})
@blakejohnson
blakejohnson / compare.ipynb
Created October 10, 2013 15:39
Thresholding vs Soft-averaging --Marcus, Blake, and Colm
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.