repo stringclasses 900
values | file stringclasses 754
values | content stringlengths 4 215k |
|---|---|---|
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from math import cos, pi, acos
print("cosine of 90 degrees is zero:",cos(pi/2))
# find the degree of two unit vectors having the dot product of 0.
radian_degree = acos(0)
degree = 360*radian_degree/(2*pi)
print("the degree of two unit vectors having the dot product of 0 is",degree,"degrees")
# include our p... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # include our predefined functions
%run qlatvia.py
# draw the axes
draw_qubit()
#
# your solution is here
#
draw_quantum_state(3/5,4/5,"main")
draw_quantum_state(-4/5,3/5,"ort1")
draw_quantum_state(4/5,-3/5,"ort2")
# include our predefined functions
%run qlatvia.py
# draw the axes
draw_qubit()
... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | %run qlatvia.py
draw_qubit()
sqrttwo=2**0.5
draw_quantum_state(1,0,"")
draw_quantum_state(1/sqrttwo,1/sqrttwo,"|+>")
# drawing the angle with |0>-axis
from matplotlib.pyplot import gca, text
from matplotlib.patches import Arc
gca().add_patch( Arc((0,0),0.4,0.4,angle=0,theta1=0,theta2=45) )
text(0.08,... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | %run qlatvia.py
draw_qubit()
# line of reflection for Hadamard
from matplotlib.pyplot import arrow
arrow(-1.109,-0.459,2.218,0.918,linestyle='dotted',color='red')
sqrttwo=2**0.5
draw_quantum_state(0,1,"")
draw_quantum_state(1/sqrttwo,-1/sqrttwo,"|->")
%run qlatvia.py
draw_qubit()
# line of ref... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | %run qlatvia.py
draw_qubit()
sqrttwo=2**0.5
draw_quantum_state(1,0,"")
draw_quantum_state(1/sqrttwo,1/sqrttwo,"|+>")
# drawing the angle with |0>-axis
from matplotlib.pyplot import gca, text
from matplotlib.patches import Arc
gca().add_patch( Arc((0,0),0.4,0.4,angle=0,theta1=0,theta2=45) )
text(0.08,... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | %run qlatvia.py
draw_qubit()
[x,y]=[1,0]
draw_quantum_state(x,y,"v0")
sqrttwo = 2**0.5
oversqrttwo = 1/sqrttwo
R = [ [oversqrttwo, -1*oversqrttwo], [oversqrttwo,oversqrttwo] ]
# function for rotation R
def rotate(px,py):
newx = R[0][0]*px + R[0][1]*py
newy = R[1][0]*px + R[1][1]*py
re... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | #
# your code is here
#
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
from math import pi, cos, sin
from random import randrange
# quantum circuit with three qubits and three bits
qreg = QuantumRegister(3)
creg = ClassicalRegister(3)
mycircuit = QuantumCircuit(qreg,cr... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
from math import pi, cos, sin
from random import randrange
# quantum circuit with three qubits and three bits
qreg = QuantumRegister(3)
creg = ClassicalRegister(3)
mycircuit = QuantumCircuit(qreg,creg)
# rotate the first q... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
from math import pi
# the angle of rotation
theta = 1 * pi/16
# we read streams of length 8, 16, 24, 32, 40, 48, 56, 64
for i in [8, 16, 24, 32, 40, 48, 56, 64]:
# quantum circuit with one qubit and one bit
qreg = Qu... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
from math import pi
from random import randrange
# the angle of rotation
r = randrange(1,11)
print("the picked angle is",r,"times of 2pi/11")
print()
theta = r*2*pi/11
# we read streams of length from 1 to 11
for i in ran... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
from math import pi
# the angles of rotations
theta1 = pi/4
theta2 = pi/6
# the circuit with two qubits
qreg = QuantumRegister(2)
creg = ClassicalRegister(2)
mycircuit = QuantumCircuit(qreg,creg)
# when the second qu... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from math import pi, sin, cos
theta1 = pi/4
theta2 = pi/6
print(round(cos(theta1),3),-round(sin(theta1),3),0,0)
print(round(sin(theta1),3),-round(cos(theta1),3),0,0)
print(0,0,round(cos(theta2),3),-round(sin(theta2),3))
print(0,0,round(sin(theta2),3),-round(cos(theta2),3))
from qiskit import QuantumRegiste... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from matplotlib.pyplot import bar
labels = []
L = []
for i in range(8):
labels = labels + [i+1]
L = L + [1]
# visualize the values of elements in the list
bar(labels,L)
#
# 1st step - query
#
# 4th element is marked flip the sign
L[3] = -1 * L[3]
# visualize the values of elements in the... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from matplotlib.pyplot import bar
labels = []
L = []
for i in range(8):
labels = labels + [i+1]
L = L + [1]
# visualize the values of elements in the list
bar(labels,L)
#
# 1st step - query
#
# flip the sign of the marked element
L[3] = -1 * L[3]
# visualize the values of elements in t... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # import all necessary objects and methods for quantum circuits
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
#
# your code is here
qreg1 = QuantumRegister(2) # quantum register with 2 qubits
creg1 = ClassicalRegister(2) # classical register with 2 bits
mycircuit1 = Quan... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # import all necessary objects and methods for quantum circuits
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
qreg1 = QuantumRegister(2) # quantum register with 2 qubits
creg1 = ClassicalRegister(2) # classical register with 2 bits
mycircuit1 = QuantumCircuit(qreg1,creg1) ... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # import all necessary objects and methods for quantum circuits
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
#
# your solution is here
#
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
# Quantum Circuit with 4 qbits
qreg = QuantumRegist... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # import all necessary objects and methods for quantum circuits
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
qreg = QuantumRegister(4) # quantum register with 4 qubits
creg = ClassicalRegister(4) # classical register with 4 bits
mycircuit = QuantumCircuit(qreg,creg) # quantu... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # consider the following list with 4 elements
L = [1,-2,0,5]
print(L)
# 3 * v
v = [1,-2,0,5]
print("v is",v)
# we use the same list for the result
for i in range(len(v)):
v[i] = 3 * v[i]
print("3v is",v)
# -0.6 * u
# reinitialize the list v
v = [1,-2,0,5]
for i in range(len(v)):
v[i] = -0.6 *... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from random import randrange
dimension = 7
# create u and v as empty list
u = []
v = []
for i in range(dimension):
u.append(randrange(-10,11)) # add a randomly picked number to the list u
v.append(randrange(-10,11)) # add a randomly picked number to the list v
# print both lists
print("u is",u... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # let's define both vectors
u = [-3,-2,0,-1,4]
v = [-1,-1,2,-3,5]
uv = 0; # summation is initially zero
for i in range(len(u)): # iteratively access every pair with the same indices
print("pairwise multiplication of the entries with index",i,"is",u[i]*v[i])
uv = uv + u[i]*v[i] # i-th entries are multi... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # let's define the vectors
v=[-3,4,-5,6]
u=[4,3,6,5]
vu = 0
for i in range(len(v)):
vu = vu + v[i]*u[i]
print(v,u,vu)
u = [-3,-4]
uu = u[0]*u[0] + u[1]*u[1]
print(u,u,uu)
u = [-3,-4]
neg_u=[3,4]
v=[-4,3]
neg_v=[4,-3]
# let's define a function for inner product
def dot(v_one,v_two):
... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # we may break lines when defining our list
M = [
[8 , 0 , -1 , 0 , 2],
[-2 , -3 , 1 , 1 , 4],
[0 , 0 , 1 , -7 , 1],
[1 , 4 , -2 , 5 , 9]
]
# let's print matrix M
print(M)
# let's print M in matrix form, row by row
for i in range(4): # there are 4 rows
print(M[i])
M = [
... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from random import randrange
A = []
B = []
for i in range(3):
A.append([])
B.append([])
for j in range(4):
A[i].append(randrange(-5,6))
B[i].append(randrange(-5,6))
print("A is",A)
print("B is",B)
C = []
for i in range(3):
C.append([])
for j in range(4):
... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # vector v
v = [1,2,-3]
# vector u
u=[-2,3]
vu = []
for i in range(len(v)): # Each element of v will be replaced
for j in range(len(u)): # the vector u will come here after multiplying with the entry there
vu.append( v[i] * u[j] )
print("v=",v)
print("u=",u)
print("vu=",vu)
#
# your solu... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | u = [-2,-1,0,1]
v = [1,2,3]
uv = []
vu = []
for i in range(len(u)): # one element of u is picked
for j in range(len(v)): # now we iteratively select every element of v
uv.append(u[i]*v[j]) # this one element of u is iteratively multiplied with every element of v
print("u-tensor-v is",uv)... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | number = 5 # integer
real = -3.4 # float
name = 'Asja' # string
surname = "Sarkana" # string
boolean1 = True # Boolean
boolean2 = False # Boolean
a = 13
b = 5
print("a =",a)
print("b =",b)
print()
# basics operators
print("a + b =",a+b)
print("a - b =",a-b)
print("a * b =",a*b)
print("a / b =",... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # This is a comment
# A comment is used for explanations/descriptions/etc.
# Comments do not affect the programs
# let's define an integer variable named a
a = 5
# let's print its value
print(a)
# let's define three integer variables named a, b, and c
a = 2
b = 4
c = a + b # summation of a and b
# le... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | n1,n2,n3 = 3,-4,6
print(n1,n2,n3)
r1 = (2 * n1 + 3 * n2)*2 - 5 *n3
print(r1)
n1,n2,n3 = 3,-4,6
up = (n1-n2) * (n2-n3)
down = (n3-n1) * (n3+1)
result = up/down
print (result)
N = "Abuzer"
S = "Yakaryilmaz"
print("hello from the quantum world to",N,S)
|
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # let's print all numbers between 0 and 9
for i in range(10): print(i)
# range(n) represents the list of all numbers from 0 to n-1
# i is the variable to take the values in the range(n) iteratively: 0, 1, ..., 9 in our example
# let's write the same code in two lines
for i in range(10): # do not forget to use co... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | total1 = 0
total2 = 0
for i in range(3,52,3):
total1 = total1 + i
total2 += i # shorter form
print("The summation is",total1)
print("The summation is",total2)
T = 0
current_number = 1
for i in range(9):
T = T + current_number
print("3 to",i,"is",current_number)
current_number = 3 ... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # let's randomly pick a number between 0 and 9, and print its value if it is greater than 5
from random import randrange
r = randrange(10)
if r > 5: print(r) # when the condition (r > 5) is valid/true, the code (print(r)) will be executed
# you may need to execute your code more than once to see an outcome
#... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | from random import randrange
r = randrange(10,51)
if r % 2 ==0: print(r,"is even")
else: print(r,"is odd")
from random import randrange
for N in [100,1000,10000,100000]:
first_half=second_half=0
for i in range(N):
r = randrange(100)
if r<50:
first_half = first_half... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # here is a list holding all even numbers between 10 and 20
L = [10, 12, 14, 16, 18, 20]
# let's print the list
print(L)
# let's print each element by using its index but in reverse order
print(L[5],L[4],L[3],L[2],L[1],L[0])
# let's print the length (size) of list
print(len(L))
# let's print each elemen... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # the first and second elements are 1 and 1
F = [1,1]
for i in range(2,30):
F.append(F[i-1] + F[i-2])
# print the final list
print(F)
# define an empty list
N = []
for i in range(11):
N.append([ i , i*i , i*i*i , i*i + i*i*i ]) # a list having four elements is added to the list N
# Alterna... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # A jupyter notebook is composed by one or more cells.
# A cell is used to write and execute your codes.
# A cell is also used to write descriptions, notes, formulas, etc.
# You can format your descriptions by using HTML or LaTex codes.
# During our tutorial, you are expected to write only python codes.
# Interest... |
https://github.com/zeynepCankara/Introduction-Quantum-Programming | zeynepCankara | # I am a comment in python
print("Hello From Quantum World :-)")
# please run this cell
# import the objects from qiskit
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer
from random import randrange
# Create my circuit and register objects
qreg = QuantumRegister(2) # my... |
https://github.com/adarshisme/QiskitBiskit | adarshisme | !pip install qiskit
!pip install pylatexenc
import matplotlib.pyplot as plt
import math
import matplotlib as mpl
import numpy as np
import pandas as pd
import qiskit as q
from qiskit import Aer, assemble, QuantumRegister, ClassicalRegister
from qiskit.circuit import QuantumCircuit
import pylatexenc
from ... |
https://github.com/IBMDeveloperUK/Hello-Quantum-World. | IBMDeveloperUK |
import numpy as np
import networkx as nx
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer, assemble
from qiskit.quantum_info import Statevector
from qiskit.aqua.algorithms import NumPyEigensolver
from qiskit.quantum_info import Pauli
from qiskit.aqua.operators... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
from pprint import pprint
import pickle
import time
import datetime
%matplotlib inline
with open("e2d1_raw.pkl", "rb") as f:
raw = pickle.load(f)
with open("e2d1_qrem.pkl", "rb") as f:
qrem = pickle.load(f)
with open("e2d1_... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
from pprint import pprint
import pickle
import time
import datetime
%matplotlib inline
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, X, Y, Z, I
from qiskit.opflow.s... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
from pprint import pprint
import pickle
import time
import datetime
%matplotlib inline
with open("e2d1_raw.pkl", "rb") as f:
raw = pickle.load(f)
with open("e2d1_qrem.pkl", "rb") as f:
qrem = pickle.load(f)
with open("e2d1_... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
from pprint import pprint
import pickle
import time
import datetime
%matplotlib inline
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, X, Y, Z, I
from qiskit.opflow.s... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
from pprint import pprint
import pickle
import time
import datetime
%matplotlib inline
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, X, Y, Z, I
from qiskit.opflow.s... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
from pprint import pprint
import pickle
import time
import datetime
%matplotlib inline
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, X, Y, Z, I
from qiskit.opflow.s... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
from pprint import pprint
import pickle
import time
import datetime
%matplotlib inline
with open("e2d1_raw.pkl", "rb") as f:
raw = pickle.load(f)
with open("e2d1_qrem.pkl", "rb") as f:
qrem = pickle.load(f)
with open("e2d1_... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
from pprint import pprint
import pickle
import time
import datetime
%matplotlib inline
with open("e2d1_raw.pkl", "rb") as f:
raw = pickle.load(f)
with open("e2d1_qrem.pkl", "rb") as f:
qrem = pickle.load(f)
with open("e2d1_... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One
from qiskit import QuantumCircuit, QuantumRegister, IBMQ, execute, transpile,... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import QuantumCircuit, QuantumRegis... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import QuantumCircuit, QuantumRegis... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import QuantumCircuit, QuantumRegis... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import QuantumCircuit, QuantumRegis... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | filename = "job_ids_jakarta_100step_20220412_030333_.pkl"
import pickle
with open(filename, "rb") as f:
print(pickle.load(f))
filename = "job_ids_jakarta_100step_20220413_012425_.pkl"
with open(filename, "rb") as f:
print(pickle.load(f))
|
https://github.com/BOBO1997/osp_solutions | BOBO1997 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import Qua... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import re
import itertools
import numpy as np
import random
random.seed(42)
import mitiq
from qiskit import QuantumCircuit, QuantumRegister
from qiskit.ignis.mitigation import expectation_value
# Pauli Twirling
def pauli_twirling(circ: QuantumCircuit) -> QuantumCircuit:
"""
[internal function]
... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | filename = "job_ids_jakarta_100step_20220412_030333_.pkl"
import pickle
with open(filename, "rb") as f:
print(pickle.load(f))
filename = "job_ids_jakarta_100step_20220413_012425_.pkl"
with open(filename, "rb") as f:
print(pickle.load(f))
|
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import Qua... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import re
import itertools
import numpy as np
import random
random.seed(42)
import mitiq
from qiskit import QuantumCircuit, QuantumRegister
from qiskit.ignis.mitigation import expectation_value
# Pauli Twirling
def pauli_twirling(circ: QuantumCircuit) -> QuantumCircuit:
"""
[internal function]
... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | filename = "job_ids_jakarta_100step_20220412_030333_.pkl"
import pickle
with open(filename, "rb") as f:
print(pickle.load(f))
filename = "job_ids_jakarta_100step_20220413_012425_.pkl"
with open(filename, "rb") as f:
print(pickle.load(f))
|
https://github.com/BOBO1997/osp_solutions | BOBO1997 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import re
import itertools
import numpy as np
import random
random.seed(42)
import mitiq
from qiskit import QuantumCircuit, QuantumRegister
from qiskit.ignis.mitigation import expectation_value
# Pauli Twirling
def pauli_twirling(circ: QuantumCircuit) -> QuantumCircuit:
"""
[internal function]
... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | filename = "job_ids_jakarta_100step_20220412_030333_.pkl"
import pickle
with open(filename, "rb") as f:
print(pickle.load(f))
filename = "job_ids_jakarta_100step_20220413_012425_.pkl"
with open(filename, "rb") as f:
print(pickle.load(f))
|
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
# plt.rcParams.update({'font.size': 16}) # enlarge matplotlib fonts
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import ... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import QuantumCircuit, QuantumRegis... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import QuantumCircuit, QuantumRegis... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import QuantumCircuit, QuantumRegis... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import matplotlib.pyplot as plt
import itertools
from pprint import pprint
import pickle
import time
import datetime
# Import qubit states Zero (|0>) and One (|1>), and Pauli operators (X, Y, Z)
from qiskit.opflow import Zero, One, I, X, Y, Z
from qiskit import QuantumCircuit, QuantumRegis... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import sys, time
sys.path.append("../")
import Qconfig
qx_config = {
"APItoken": Qconfig.APItoken,
"url": Qconfig.config['url']}
print('Qconfig loaded from %s.' % Qconfig.__file__)
# Imports
import qiskit as qk
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qisk... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import pandas as pd
import itertools
import cma
import os
import sys
import argparse
import pickle
import random
import re
from pprint import pprint
import qiskit
from qiskit import *
from qiskit import Aer
from qiskit import IBMQ
from qiskit.providers.aer.noise.noise_model import No... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import pandas as pd
import itertools
import cma
import os
import sys
import argparse
import pickle
import random
import re
from pprint import pprint
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute
from qiskit import Aer
from qiskit import I... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | import numpy as np
import pandas as pd
import itertools
import cma
import os
import sys
import argparse
import pickle
import random
import re
from pprint import pprint
import qiskit
from qiskit import *
from qiskit import Aer
from qiskit import IBMQ
from qiskit.providers.aer.noise.noise_model import No... |
https://github.com/BOBO1997/osp_solutions | BOBO1997 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.