Skip to content

Instantly share code, notes, and snippets.

View goerz's full-sized avatar

Michael Goerz goerz

View GitHub Profile
@goerz
goerz / filter_enex.py
Created October 14, 2018 04:43
filter_enex.py
import re
import html
from lxml.etree import tostring
from ever2simple.converter import EverConverter
def my_unescape(s):
s = s.replace(""", "PROTECTEDQUOT=====")
s = html.unescape(s)
s = s.replace("PROTECTEDQUOT=====", """)
@goerz
goerz / generate_yearly_calendar.py
Created October 7, 2018 15:22
Script to generate a 3-page yearly calendar via luatex
#!/usr/bin/env python
"""Script to generate a yearly calendar via luatex.
Requires the `lualatex` executable to be in the PATH.
Requires the Rotis Semi Serif (55 Roman) and Rotis Semi Sans (55 Regular)
fonts, available at
https://www.linotype.com/49242/rotis-semi-serif-family.html
https://www.linotype.com/49198/rotis-semi-sans-family.html
@goerz
goerz / test_algebra.py
Last active April 29, 2018 05:43
Testingthe general algebraic structures in QNET
from sympy import symbols
from qnet.algebra import *
def check(checks):
for (func, args) in checks:
try:
print("%s: %s" % (func.__name__, func(*args)))
except Exception as exc_info:
print("%s: Exception %r" % (func.__name__, exc_info))
@goerz
goerz / solutions.csv
Created April 23, 2018 04:40
Local Gradient Optimization of Modular Entangling Sequences - Optimal Solutions
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 31 columns, instead of 30 in line 4.
#N=1,quasistatic_nonlocal_noise_and_no_local_noise,,,,,,,#N=1,quasistatic_nonlocal_noise_and_quasistatic_local_noise,,,,,,,#N=1,1/f_nonlocal_noise_and_no_local_noise,,,,,,,#N=1,1/f_nonlocal_noise_and_1/f_local_noise,,,,,
R_n,gamma_1,beta_1,alpha_1,gamma_2,beta_2,alpha_2,,R_n,gamma_1,beta_1,alpha_1,gamma_2,beta_2,alpha_2,,R_n,gamma_1,beta_1,alpha_1,gamma_2,beta_2,alpha_2,,R_n,gamma_1,beta_1,alpha_1,gamma_2,beta_2,alpha_2
1,0,0,0,0,0,0,,1,0.227210291,-0.519172237,4.249945784,0.659286314,1.024495102,-5.130178346,,1,0,0,0,0,0,0,,1,-0.001891645,5.899323772,-8.266042588,-0.985505191,-0.712206035,-10.80685923
#N=2,quasistatic_nonlocal_noise_and_no_local_noise,,,,,,,#N=2,quasistatic_nonlocal_noise_and_quasistatic_local_noise,,,,,,,#N=2,1/f_nonlocal_noise_and_no_local_noise,,,,,,,#N=2,1/f_nonlocal_noise_and_1/f_local_noise,,,,,
R_n,gamma_1,beta_1,alpha_1,gamma_2,beta_2,alpha_2,,R_n,gamma_1,beta_1,alpha_1,gamma_2,beta_2,alpha_2,,R_n,gamma_1,beta_1,alpha_1,gamma_2,beta_2,alpha_2,,R_n,gamma_1,beta_1,alpha_1,gamma_2,bet
@goerz
goerz / 00_README.md
Last active February 4, 2018 17:17
Blink issue #426

This is some demo Julia code with nontrivial Unicode, used to illustrate Blink issue #426

@goerz
goerz / .ctags
Created February 3, 2018 20:20 — forked from Evizero/.ctags
more comprehensive ctags definitions for the julia language based on the one in the official julia repository (inclusive vim tagbar)
--langdef=julia
--langmap=julia:.jl
--regex-julia=/^[ \t]*(@with_kw[ \t]+)?(abstract type|primitive type|struct|mutable struct|typealias)[ \t]+([^ \t({[]+).*$/\3/t,type/
--regex-julia=/^[ \t]*(macro)[ \t]+([^ \t({[]+).*$/\2/m,macro/
--regex-julia=/^[ \t]*(@inline[ \t]+|@noinline[ \t]+)?(function)[ \t]+([^ \t({[]+)[^(]*\([ \t]*([^ \t;,=)({]+).*$/\3 (\4, …)/f,function/
--regex-julia=/^[ \t]*(@inline[ \t]+|@noinline[ \t]+)?(function)[ \t]+([^ \t({[]+)[^(]*(\([ \t]*\).*|\([ \t]*)$/\3/f,function/
--regex-julia=/^[ \t]*(@inline[ \t]+|@noinline[ \t]+)?(([^@#$ \t({[]+)|\(([^@#$ \t({[]+)\)|\((\$)\))[ \t]*(\{.*\})?[ \t]*\([ \t]*\)[ \t]*=([^=].*$|$)/\3\4\5/f,function/
--regex-julia=/^[ \t]*(@inline[ \t]+|@noinline[ \t]+)?(([^@#$ \t({[]+)|\(([^@#$ \t({[]+)\)|\((\$)\))[ \t]*(\{.*\})?[ \t]*\([ \t]*([^ \t;,=)({]+).*\)[ \t]*=([^=].*$|$)/\3\4\5 (\7, …)/f,function/
--regex-julia=/^(const)[ \t]+([^ \t({[]+).*[ ]*=.*$/\2/c,const/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@goerz
goerz / revtex.tplx
Last active February 22, 2021 09:33
custom jupyter nbconvert latex template, using revtex
((*- extends 'article.tplx' -*))
% See http://blog.juliusschulz.de/blog/ultimate-ipython-notebook#templates
% for some useful tips
%===============================================================================
% Document class
%===============================================================================
((* block docclass *))
@goerz
goerz / linreg.ipynb
Created January 2, 2018 19:49
Linear Regression Notes (Notebook)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.