This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LightGraphs, MetaGraphs, GraphPlot, DataStructures | |
# Create the structures I need... | |
function create_graph() | |
mg = MetaDiGraph(DiGraph()) | |
stack = Stack{Any}() | |
ssastack = Stack{Any}() | |
# Add a dictionary holding all global references | |
set_prop!(mg, :global_refs, Dict()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Distributed, Random | |
addprocs(3) | |
@everywhere module Test | |
using Distributed, Random | |
# My custom weight class, a vector with a couple of views into itself | |
struct Weights{T} <: AbstractVector{T} | |
weights::Vector{T} | |
a::AbstractVector{T} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DifferentialEquations | |
L = 4; | |
U=0.1; Δ=0.1; J=0.45; F=1.57; | |
u₀ = fill(0.2+0.2im, L, 1); | |
Jmat = J.*(diagm(linspace(1,1,L-1),1)+diagm(linspace(1,1,L-1),-1)); | |
function ff(dα,α,p,t) | |
dα[:] = (-im*(Δ - U*(α .* conj(α) - 1.0)) - 1/2.0).*α + im*F -im.*(Jmat*α); | |
end | |
function gg(dα, α, p, t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class C(object): | |
def __init__(self, i, n): | |
self.i = i | |
self.n = n | |
self.psi0 = [] | |
self.tlist = [] | |
def qubit_integrate(self, epsilon, delta, g1, g2, solver): | |
import qutip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SOURCE_DIR=/home/niklas/ | |
TARGET_DIR=/media/Backup/FileBackup | |
EXCLUDE_FILE=/home/niklas/rsync_excludelist | |
rsync -avP --exclude-from=${EXCLUDE_FILE} --delete-excluded --delete --stats ${SOURCE_DIR} ${TARGET_DIR} | |
# add log entry to target dir | |
LOGFILE="$TARGET_DIR/backup_log" | |
DATE=$(date) | |
echo "Last backup on $DATE" >> $LOGFILE |
NewerOlder