Pulse programs are text files that specify the pulse sequence for a single shot of an experiment. They conventionally use the file suffix .pp
. These text files are run sequentially, line by line, starting from the top.
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
#!/usr/bin/python | |
''' | |
A call to this script | |
multi-bibtex [options] texfile[.aux] | |
will result in the commands | |
bibtex [options] file.aux | |
being called for every file in the folder of texfile which | |
starts with "texfile". | |
This is useful, for example, when you want to use bibtex | |
(as opposed to biber which does what we want automatically) |
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
#!/usr/bin/python | |
from __future__ import division | |
import numpy as np | |
def tuple_encode(x): | |
""" | |
If x is a tuple of non-negative integers, outputs a single non-negative | |
integer which is unique for that tuple, based on Cantor's bijection | |
argument. | |
""" |
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
# This is working pretty nice for me, and has basically paid itself off. | |
# In retrospect, there are some better design layouts that would be more elegant, | |
# if this ever becomes more than a gist: headers and footers should be their own | |
# class, and there should be a generic class which sandwiches the matrix with | |
# such. LatexTabularX should be two of such sandwiches. Functionality for saving | |
# to disk and compiling the master tex file would be nice. | |
import warnings | |
class TexMatrix(object): |
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
def lighten_color(color, amount=0.5): | |
""" | |
Lightens the given color by multiplying (1-luminosity) by the given amount. | |
Input can be matplotlib color string, hex string, or RGB tuple. | |
Examples: | |
>> lighten_color('g', 0.3) | |
>> lighten_color('#F034A3', 0.6) | |
>> lighten_color((.3,.55,.1), 0.5) | |
""" |
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
from __future__ import division | |
import numpy as np | |
from scipy.special import expit, logit | |
def complex_contract(x, y): | |
""" | |
Shrinks z=x+iy to the unit disk using half-expit. | |
""" | |
r = np.sqrt(x**2 + y**2) | |
phi = np.arctan2(y, x) |
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/awesomethon | |
import adh as brother | |
from mad import skillz | |
import hopefully_not as too_hard | |
from dickens import major_work | |
message_ascii = skillz.ascii_array(message) | |
dickens_ascii = skillz.ascii_array(major_work.get_chapter(brother.get_age())) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# mimics the ctrl+shift+m behaviour in texmaker | |
atom.commands.add 'atom-text-editor', | |
'custom:insert-inline-latex-eqn': -> | |
return unless editor = atom.workspace.getActiveTextEditor() | |
selection = editor.getLastSelection() | |
selection.insertText("$#{selection.getText()}$") | |
if not editor.getSelectedText() | |
editor.moveLeft() | |
# puts selected text in a new align environment |
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
def random_choice(mat, n_samples=None, axis=0): | |
""" | |
Replaces the given axis with n_samples random choices (with replacement) | |
of values already along that axis. | |
A=np.arange(15).reshape(3,5) | |
print(A) | |
print(random_choice(A, n_samples=6, axis=1)) | |
print(random_choice(A, axis=0)) | |
OlderNewer