Skip to content

Instantly share code, notes, and snippets.

View quantumjim's full-sized avatar

James Wootton quantumjim

View GitHub Profile
@quantumjim
quantumjim / GraphDecoder.ipynb
Created June 24, 2020 10:32
GraphDecoder Info
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@quantumjim
quantumjim / QuantumGame.ipynb
Created June 23, 2020 19:20
Quantum Game Demo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@quantumjim
quantumjim / biased.py
Created May 10, 2020 11:21
Testing rng
import secrets
import numpy as np
samples = 1000000
zs = 0
os = 0
number_list = []
for _ in range(samples):
@quantumjim
quantumjim / LICENSE.txt
Last active April 3, 2020 12:23
Game engine with jupyter widgets
Copyright IBM - Research 2020
Apache 2.0
from PIL import Image
import time
dark = 10
while True:
# get new this
left = {}
def execute(c,shots=1024,output='counts'):
p2s=['I','X','Y','Z']*(c.n==2)+['']*(c.n==1)
def j(p1,p2,q):
return (p1+p2)*(q==1)+(p2+p1)*(q==0)
class QuantumCircuit:
def __init__(c,n):
c.n=n
c.data = []
def x(c,q):
c.data.append(('r',pi,q))
def rx(c,T,q):
c.data.append(('r',T,q))
def h(c,q):
c.data.append(('h',q))
pi=3.14159265359
def cos(T):
T=T%(2*pi)
c=1
t=1
for j in range(1,16):
t=-t*T**2/(2*j*(2*j-1))
c+=t
return c
def sin(T):
import random
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.