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.
This file contains hidden or 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
| import secrets | |
| import numpy as np | |
| samples = 1000000 | |
| zs = 0 | |
| os = 0 | |
| number_list = [] | |
| for _ in range(samples): |
This file contains hidden or 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
| Copyright IBM - Research 2020 | |
| Apache 2.0 |
This file contains hidden or 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 PIL import Image | |
| import time | |
| dark = 10 | |
| while True: | |
| # get new this | |
| left = {} |
This file contains hidden or 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 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) |
This file contains hidden or 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
| 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)) |
This file contains hidden or 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
| 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): |
This file contains hidden or 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
| import random |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.