Skip to content

Instantly share code, notes, and snippets.

View splch's full-sized avatar

Spencer Churchill splch

View GitHub Profile
@splch
splch / permuted_mirror_circuit_benchmark.ipynb
Last active September 12, 2024 19:08
A proposal for a reproducible, scalable, and holistic Adversarial Quantum Benchmark.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@splch
splch / infinite_temperature.ipynb
Created August 28, 2024 23:00
calculate the rgb of a very hot black-body
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@splch
splch / windows_setup.ps1
Last active December 17, 2023 04:57
Windows setup script
# Check for Administrator Privileges
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "This script requires Administrator privileges. Please run it as an Administrator."
Exit
}
# Run as Administrator
Set-ExecutionPolicy Bypass -Scope Process -Force -Confirm:$false
# Install Chocolatey
@splch
splch / adversarial_benchmark.ipynb
Last active November 16, 2023 23:10
The notebook describes and implements an "Adversarial Error Benchmarking" process for quantum circuits, where a specific quantum circuit is designed to evaluate the error rate on a simulated quantum device, Aria-2, with a defined noise model.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
first_key_down next_key_down freq mean std
A A 75865 415.7420473683694 211.15077174990657
A B 1004970 165.28457375000784 85.53598674842621
A C 2195967 167.4397778601112 61.035602729802285
A D 1441567 162.8665241188316 31.321963905203503
A E 3605848 405.72196709898844 208.6443786776474
A F 651427 402.95098691571224 203.15117061387028
A G 638791 395.8929611390238 198.9873950522662
A H 5849734 197.66910352690073 90.16204233255728
A I 601633 249.09574362732477 202.01115726544845
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Start with a base Ubuntu 22.04 image
# --platform=linux/amd64
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
LLVM_VERSION=c0b45fef155fbe3f17f9a6f99074682c69545488 \
LLVM_INSTALL_PATH=/opt/llvm \
CUDAQ_INSTALL_PATH=$HOME/.cudaq
@splch
splch / progress.py
Last active April 21, 2024 11:34 — forked from spava/progress.py
a simple and useful progress bar in python
import time, sys
def progress(iterable, length=33):
total, start = len(iterable), time.monotonic()
for count, it in enumerate(iterable, 1):
yield it
if count % max(1, total // 10000) == 0 or count == total:
percent = count / total
sys.stdout.write(
f'\r▕{"█" * int(length * percent) + " " * (length - int(length * percent))}▏ '
@splch
splch / isWorn.js
Created September 6, 2022 14:52
detect if a bangle watch is being worn
function isWorn() {
console.log(Bangle.isCharging(), E.getTemperature(), Bangle.getAccel().mag);
if (Bangle.isCharging())
return false;
if (E.getTemperature() >= 33.1)
// https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8266026/table/T2/
return true;
if (Bangle.getAccel().mag >= 1.02)
return true;
return false;