Skip to content

Instantly share code, notes, and snippets.

View stylewarning's full-sized avatar

Robert Smith stylewarning

View GitHub Profile
@braised-babbage
braised-babbage / einsum_compiler.py
Last active November 12, 2019 17:42
Translate a pyquil program to a single einsum call
## einsum_compiler.py
##
## What it is
## ----------
##
## Numpy has a standard function, einsum, which can be used to evaluate large
## nested summations. Here we show how to translate a pyQuil program consisting
## of only gate applications to a single einsum call.
##
##
@pkhuong
pkhuong / prefetch.lisp
Created July 3, 2019 18:51
x64-64 prefetch intrinsic for sbcl
(sb-c:defknown prefetch ((member :nta :t0 :t1 :t2)
sb-sys:system-area-pointer sb-vm:signed-word
(member 2 4 8 16)
fixnum)
(values &optional)
(sb-c:any sb-c:always-translatable) :overwrite-fndb-silently t)
(sb-c:define-vop (prefetch)
(:translate prefetch)
(:policy :fast-safe)