Skip to content

Instantly share code, notes, and snippets.

View goerz's full-sized avatar

Michael Goerz goerz

View GitHub Profile
@goerz
goerz / 2022-03-19_ChainRulesComplexDet.ipynb
Last active March 20, 2022 03:54
Analytical Reverse-AD for the determinant of a complex matrix (https://github.com/JuliaDiff/ChainRules.jl/issues/600)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@goerz
goerz / extract_textblocks.py
Created March 24, 2022 03:05
Python script for extracting textblocks from Beamer presentations
#!/usr/bin/env python
"""Extract textblocks from a Beamer presentation.
This is useful for making Powerpoint slides from Beamer presentations.
"""
import logging
import click
from pathlib import Path
PREAMBLE = r"""\documentclass[compress, aspectratio=169]{beamer}
@goerz
goerz / profile_propagate.jl
Created March 26, 2022 22:45
Profile Newton Propagation
# Include this file in a devrepl of
module TransmonModel
using LinearAlgebra
using SparseArrays
using QuantumControl.Shapes: flattop
const GHz = 2π
const MHz = 0.001GHz
const ns = 1.0
@goerz
goerz / animation-sketch.jl
Created June 8, 2023 18:31 — forked from cormullion/animation-sketch.jl
an animated something
using Luxor, Thebes, MathTeXEngine
function frame(scene, framenumber)
background("white")
sethue("black")
fontsize(15)
eased_n = scene.easingfunction(framenumber, 0, 1, scene.framerange.stop)
helloworld()
eyepoint(200, 200, 100)
setline(0.5)
using Pkg
Pkg.activate(temp=true)
Pkg.add("MarkdownAST")
import MarkdownAST
"""
replace(f::Function, root::Node)
@goerz
goerz / mwe.jl
Created March 20, 2024 21:24
Julia Parametrization MWE
# This MWE is to explore the use of RecursiveArrayTools for optimizing
# parameters for control functions.
#
# We want two things:
#
# * Extract control parameters that might occur in a set of Hamiltonians, each
# Hamiltonian containing multiple controls, and each control containing an
# AbstractVector of parameters (a ComponentArray seems very useful, but it
# could be any AbstractVector). This should be done with a function
# `get_parameters()` that collects all control parameters in a
@goerz
goerz / 3-level_mod.svg
Last active March 26, 2024 02:36
Three-Wave Mixing AutoDiff Example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@goerz
goerz / check_inventory.jl
Created March 27, 2024 21:54
Testing an `objects.inv` inventory file in Julia
# Assumptions
#
# * current working directory is the root directory of the project ("DocInventories") in this case
# * the documentation for the project has been built locally in `docs/build/`
# * the documentation has also been deployed online and is available at the `root_url` hard-coded in the script. Otherwise, do not call `check_url`
# * running on Unix (otherwise: adjust that path separator)
using HTTP
using URIs
using DocInventories
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@goerz
goerz / light.js
Last active October 8, 2024 18:14
Light Color Scheme for Blink
black = '#000000';
red = '#B9211B';
green = '#429429#';
yellow = '#96942D';
blue = '#081B90';
magenta = '#8A2E90';
cyan = '#419295';
white = '#C7C7C7';
lightBlack = '#686868';
lightRed = '#ED776D';