repo stringclasses 900
values | file stringclasses 754
values | content stringlengths 4 215k |
|---|---|---|
https://github.com/Pitt-JonesLab/clonk_transpilation | Pitt-JonesLab | import sys
sys.path.append("..")
# the following is from Qiskits two_qubit_decomp, (doesn't work as import since need to adjust parameters and return vals)
import cmath
from qiskit.quantum_info.synthesis.two_qubit_decompose import *
import scipy.linalg as la
_ipx = np.array([[0, 1j], [1j, 0]], dtype=complex... |
https://github.com/Pitt-JonesLab/clonk_transpilation | Pitt-JonesLab | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# 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.
#
# Any modifications or... |
https://github.com/Pitt-JonesLab/clonk_transpilation | Pitt-JonesLab | # from cirq import cphase
import numpy as np
import qiskit.circuit.library.standard_gates as g
import qiskit.circuit.quantumcircuit as qc
from qiskit.circuit.equivalence import EquivalenceLibrary
from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary
from qiskit.circuit.library.standard_gates.eq... |
https://github.com/Pitt-JonesLab/clonk_transpilation | Pitt-JonesLab | import sys
sys.path.append("../..")
from qiskit.quantum_info.random import random_unitary, random_clifford
from qiskit import QuantumCircuit
from clonk.utils.transpiler_passes.pass_manager_v2 import level_0_pass_manager
from clonk.backend_utils import FakeAllToAll
from clonk.utils.riswap_gates.riswap import R... |
https://github.com/Pitt-JonesLab/clonk_transpilation | Pitt-JonesLab | %reload_ext autoreload
%autoreload 2
import sys
sys.path.append("../..")
from clonk.backend_utils import FakeHatlab
backend_hatlab = FakeHatlab(dimension=1, router_as_qubits=False)
from clonk.utils.transpiler_passes import level_0_pass_manager
pm_hypercube = level_0_pass_manager(
backend_hatlab,
... |
https://github.com/Pitt-JonesLab/clonk_transpilation | Pitt-JonesLab | from typing import Optional
from qiskit.circuit.gate import Gate
from qiskit.circuit.parameterexpression import ParameterValueType
import numpy as np
class RiSwapGate(Gate):
r"""RiSWAP gate.
**Circuit Symbol:**
.. parsed-literal::
q_0: ─⨂─
R(alpha)
q_1: ─⨂─
... |
https://github.com/Pitt-JonesLab/clonk_transpilation | Pitt-JonesLab | import numpy as np
from scipy.linalg import expm
from qiskit.circuit.library import *
S = expm(
-1j
* np.pi
* (XGate().to_matrix() + YGate().to_matrix() + ZGate().to_matrix())
/ np.sqrt(33)
)
from qiskit.extensions.unitary import UnitaryGate
from qiskit import QuantumCircuit
S_gate = Un... |
https://github.com/Pitt-JonesLab/clonk_transpilation | Pitt-JonesLab | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# 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.
#
# Any modifications or... |
https://github.com/annabsouza/qft-qiskit | annabsouza | import numpy as np
from numpy import pi
from qiskit import QuantumCircuit, transpile, assemble, Aer, IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit.tools.monitor import job_monitor
from qiskit.visualization import plot_histogram, plot_bloch_multivector
qc = QuantumCircuit(3)
#Qiskit's least ... |
https://github.com/nunofernandes-plight/Qiskit_Textbook_Worstation | nunofernandes-plight | from qiskit import QuantumCircuit, execute, Aer
from qiskit.visualization import plot_histogram, plot_bloch_vector
from math import sqrt, pi
qc = QuantumCircuit(1) # Create a quantum circuit with one qubit
qc = QuantumCircuit(1) # Create a quantum circuit with one qubit
initial_state = [0,1] # Define initia... |
https://github.com/nunofernandes-plight/Qiskit_Textbook_Worstation | nunofernandes-plight | !pip install qiskit
import qiskit
import matplotlib as plt
import numpy as np
import pandas as pd
import math
from qiskit import(
QuantumCircuit,
execute,
Aer)
from qiskit.visualization import plot_histogram
# Use Aer's qasm_simulator
simulator = Aer.get_backend('qasm_simulator')
# Create... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | a= 1 + 1
a
#print(a)
a = 1
b = 0.5
a + b
an_integer = 42 # Just an integer
a_float = 0.1 # A non-integer number, up to a fixed precision
a_boolean = True # A value that can be True or False
a_string = '''just enclose text between two 's, or two "s, or do what we did for this string''' # Text
none_of_the_a... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | a= 1 + 1
a
#print(a)
a = 1
b = 0.5
a + b
an_integer = 42 # Just an integer
a_float = 0.1 # A non-integer number, up to a fixed precision
a_boolean = True # A value that can be True or False
a_string = '''just enclose text between two 's, or two "s, or do what we did for this string''' # Text
none_of_the_a... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | # initialization
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
# import basic plot tools
from qiskit.tools... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | import numpy as np
from qiskit import *
%matplotlib inline
# Create a Quantum Circuit acting on a quantum register of three qubits
circ = QuantumCircuit(3)
# Add a H gate on qubit 0, putting this qubit in superposition.
circ.h(0)
# Add a CX (CNOT) gate on control qubit 0 and target qubit 1, putting
# the qu... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | # initialization
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
# import basic plot tools
from qiskit.tools... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | # initialization
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
# import basic plot tools
from qiskit.tools... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | import numpy as np
from qiskit import *
%matplotlib inline
# Create a Quantum Circuit acting on a quantum register of three qubits
circ = QuantumCircuit(3)
# Add a H gate on qubit 0, putting this qubit in superposition.
circ.h(0)
# Add a CX (CNOT) gate on control qubit 0 and target qubit 1, putting
# the qu... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | # initialization
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
# import basic plot tools
from qiskit.tools... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | # initialization
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
# import basic plot tools
from qiskit.tools... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | # qiskit packages
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import Aer, IBMQ, execute
# visualization packages
from qiskit.tools.visualization import plot_histogram, qx_color_scheme, plot_state_city, plot_bloch_multivector, plot_state_paulivec, plot_state_hinton, plot_state... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | # useful additional packages
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# importing Qiskit
from qiskit import Aer, IBMQ
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
import qiskit as qk
#from qiskit.wrapper.jupyter import *
# import basic plot tools
from... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | import qiskit
qiskit.__qiskit_version__
# useful additional packages
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# importing Qiskit
from qiskit import BasicAer, IBMQ
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit.compiler import transpi... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | # Importing standard Qiskit libraries
from qiskit import QuantumCircuit, transpile
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *
# qiskit-ibmq-provider has been deprecated.
# Please see the Migration Guides in https://ibm.biz/provider_migration_guide for... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | #initialization
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
# import basic plot tools
from qiskit.tools.... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | import pylab
import numpy as np
from qiskit import BasicAer
from qiskit.tools.visualization import plot_histogram
from qiskit.aqua import QuantumInstance
from qiskit.aqua import run_algorithm
from qiskit.aqua.algorithms import Grover
from qiskit.aqua.components.oracles import LogicalExpressionOracle, TruthTableO... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | from hide_toggle import hide_toggle
#usage:
#1 create a cell with: hide_toggle(for_next=True)
#2 put the commented solution in the next cell
import qiskit as qk
import numpy as np
from scipy.linalg import expm
import matplotlib.pyplot as plt
import math
# definition of single qubit operators
sx = np.ar... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | from qiskit import QuantumCircuit, Aer, execute, IBMQ
from qiskit.utils import QuantumInstance
import numpy as np
from qiskit.algorithms import Shor
IBMQ.enable_account('ENTER API TOKEN HERE') # Enter your API token here
provider = IBMQ.get_provider(hub='ibm-q')
backend = Aer.get_backend('qasm_simulator')
qu... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | from hide_toggle import hide_toggle
#usage:
#1 create a cell with: hide_toggle(for_next=True)
#2 put the commented solution in the next cell
#import latex
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import execute, BasicAer
import numpy as np
%matplotlib inline
#defin... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | #initialization
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
# import basic plot tools
from qiskit.tools.... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | import pylab
import numpy as np
from qiskit import BasicAer
from qiskit.tools.visualization import plot_histogram
from qiskit.aqua import QuantumInstance
from qiskit.aqua import run_algorithm
from qiskit.aqua.algorithms import Grover
from qiskit.aqua.components.oracles import LogicalExpressionOracle, TruthTableO... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | from hide_toggle import hide_toggle
#usage:
#1 create a cell with: hide_toggle(for_next=True)
#2 put the commented solution in the next cell
import qiskit as qk
import numpy as np
from scipy.linalg import expm
import matplotlib.pyplot as plt
import math
# definition of single qubit operators
sx = np.ar... |
https://github.com/grossiM/Qiskit_workshop1019 | grossiM | from IPython.display import IFrame
IFrame("https://www.youtube.com/embed/hOlOY7NyMfs?start=75&end=126",560,315)
# Example of Brute force period finding algorithm
def find_period_classical(x, N):
n = 1
t = x
while t != 1:
t *= x
t %= N
n += 1
return n
N = 4
qrQFT =... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | from qiskit import *
from qiskit.tools.visualization import plot_histogram
%matplotlib inline
secretnumber = '11100011'
circuit = QuantumCircuit(len(secretnumber)+1,len(secretnumber))
circuit.h(range(len(secretnumber)))
circuit.x(len(secretnumber))
circuit.h(len(secretnumber))
circuit.barrier()
for i... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | from qiskit import *
from qiskit.tools.jupyter import *
from qiskit import pulse
from qiskit import IBMQ
from qiskit.ignis.mitigation.measurement import (complete_meas_cal, tensored_meas_cal,
CompleteMeasFitter, TensoredMeasFitter)
IBMQ.save_account("265951183... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | # initialization
import numpy as np
import matplotlib
# importing Qiskit
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer, IBMQ, BasicAer, assemble, transpile
from qiskit.quantum_info import Statevector
# import basic plot tools
... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | pip install pylatexenc
!pip install qiskit
from qiskit import IBMQ, Aer, QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit.providers.ibmq import least_busy
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_histogram
# Create a Quantum Register called "qr... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | # Importing Packages
from qiskit import IBMQ, Aer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, transpile, assemble, QuantumRegister, ClassicalRegister
from qiskit.visualization import plot_histogram
from qiskit_textbook.tools import simon_oracle
bb = input("Enter the input st... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | from qiskit import *
import numpy as np
from qiskit.visualization import plot_histogram
qb_Alice = QuantumRegister(1, name='qr') # Alice's qubit
qb_Bob = QuantumRegister(1, name='qr1') # Bob's qubit
Superdense_Code = QuantumCircuit(qb_Alice, qb_Bob)
def buid_Bell_pair(qc,q1,q2): #To build up the a bell pair ... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | from qiskit import *
import numpy as np
from random import random
from qiskit.extensions import Initialize
from qiskit.visualization import plot_histogram, plot_bloch_multivector
## SETUP
# Protocol uses 3 qubits and 1 classical bit in a register
qr = QuantumRegister(3, name="q") # Protocol uses 4 qubits
... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | from qiskit import *
import numpy as np
from random import random
from qiskit.extensions import Initialize
from qiskit.visualization import plot_histogram, plot_bloch_multivector
import qiskit.providers.aer.noise as noise
# Protocol uses 3 qubits and 1 classical bit in a register
qr = QuantumRegister(3, name="... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | # Import libraries for use
from qiskit import *
import numpy as np
from random import random
from qiskit.extensions import Initialize
from qiskit.visualization import plot_histogram, plot_bloch_multivector
from qiskit_textbook.tools import random_state, array_to_latex
## SETUP
# Protocol uses 4 qubits and 1 c... |
https://github.com/ichen17/Learning-Qiskit | ichen17 | # Import libraries for use
from qiskit import *
import numpy as np
from random import random
from qiskit.extensions import Initialize
from qiskit.visualization import plot_histogram, plot_bloch_multivector
from qiskit_textbook.tools import random_state, array_to_latex
## SETUP
# Protocol uses 4 qubits and 1 c... |
https://github.com/josejad42/quantum_algorithms_and_protocols | josejad42 | pip install qiskit
pip install qiskit_aer
from qiskit import QuantumCircuit
def deustch_func(value):
c = QuantumCircuit(2)
if value in [2,3]:
c.cx(0,1)
if value in [3,4]:
c.x(1)
return c
num = 2
deustch_func(num).draw()
def deustch_algorithm(func):
n = func.num... |
https://github.com/josejad42/quantum_algorithms_and_protocols | josejad42 | !pip install qiskit qiskit-aer pylatexenc --quiet
import numpy as np
from qiskit import QuantumCircuit
qc = QuantumCircuit(3,2) # QuantumCircuit(num. bits quânticos, num. bits clássicos)
qc.x(0)
qc.ccx(0,1,2)
qc.y(0)
qc.barrier()
qc.h(1)
qc.h(2)
qc.measure(1,0) # É possível medir epecificamente um qubit... |
https://github.com/josejad42/quantum_algorithms_and_protocols | josejad42 | pip install qiskit pylatexenc qiskit-aer --quiet
from qiskit import QuantumCircuit, Aer, transpile
from qiskit.visualization import plot_histogram, plot_bloch_multivector
from numpy.random import randint
from qiskit.visualization import visualize_transition
import numpy as np
import matplotlib.pyplot as plt
... |
https://github.com/levchCode/RSA-breaker | levchCode | #
# This is a toy RSA encryption breaker using Shor's algorithm (params: a = 2, N = 85)
# To use your custom alphabet, please change alphabet var
#
from qiskit import QuantumProgram
from fractions import gcd
from math import pi
qp = QuantumProgram()
qr = qp.create_quantum_register('qr', 8)
cr = qp.cre... |
https://github.com/stevvwen/QAlgoImplementation | stevvwen | # initialization
import numpy as np
import matplotlib
# importing Qiskit
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer, IBMQ, BasicAer, assemble, transpile
from qiskit.quantum_info import Statevector
# import basic plot tools
... |
https://github.com/stevvwen/QAlgoImplementation | stevvwen | import numpy as np
# Importing standard Qiskit libraries
from qiskit import QuantumCircuit, transpile, Aer, IBMQ, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *
from qiskit.providers.aer import QasmSimulator
# Loading your IBM Quantum account(... |
https://github.com/stevvwen/QAlgoImplementation | stevvwen | # Do the necessary imports
import numpy as np
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, BasicAer, IBMQ
from qiskit.visualization import plot_histogram, plot_bloch_multivector
### Creating 3 qubit and 2 classical bits in each separate register
qr = QuantumRegister(3)
crz = Cla... |
https://github.com/henotrix/quantum-practice | henotrix | from qiskit import *
from oracle_generation import generate_oracle
get_bin = lambda x, n: format(x, 'b').zfill(n)
def gen_circuits(min,max,size):
circuits = []
secrets = []
ORACLE_SIZE = size
for i in range(min,max+1):
cur_str = get_bin(i,ORACLE_SIZE-1)
(circuit, secret) = generate_oracle... |
https://github.com/LohitPotnuru/GroverAlgorithm_Qiskit | LohitPotnuru | import numpy as np
# Importing standard Qiskit libraries
from qiskit import QuantumCircuit, transpile, Aer, IBMQ
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *
from qiskit.providers.aer import QasmSimulator
# Loading your IBM Quantum account(s)
provid... |
https://github.com/pedrotelez/QuantumHelloWorld | pedrotelez | # Importing Qiskit
from qiskit import *
# Init 2 qubits and 2 classical bits
number_of_qubits = 2 # qubits
number_of_classical_bits = 2 # classical bits
Qr = QuantumRegister(number_of_qubits) # quantum register
Cr = ClassicalRegister(number_of_classical_bits) # classical register
# Building the circuit
... |
https://github.com/pedrotelez/QuantumHelloWorld | pedrotelez | from qiskit import QuantumCircuit, execute, Aer, BasicAer
from qiskit.visualization import plot_state_qsphere, plot_histogram, plot_bloch_multivector
from qiskit.quantum_info import Statevector
import numpy as np
# numero de qubits do circuito
n = 4
# inicializando o circuito
qft = QuantumCircuit(n, n, name ... |
https://github.com/0xCAB0/shor_algorithm | 0xCAB0 | from qiskit import QuantumCircuit, Aer, execute, IBMQ
from qiskit.utils import QuantumInstance
import numpy as np
from qiskit.algorithms import Shor
IBMQ.enable_account('ENTER API TOKEN HERE') # Enter your API token here
provider = IBMQ.get_provider(hub='ibm-q')
backend = Aer.get_backend('qasm_simulator')
qu... |
https://github.com/samabwhite/Grover-Search-Implementation | samabwhite | from qiskit import QuantumCircuit
from qiskit.tools.visualization import circuit_drawer
import numpy as np
from matplotlib import pyplot as plt
n=5
qc = QuantumCircuit(n)
qc.x(1)
qc.ccx(0, 1, 3)
qc.ccx(2, 3, 4)
qc.ccx(0, 1, 3)
qc.x(1)
qc.draw('mpl')
def phase_oracle(n, name = 'Uf'):
qc = QuantumC... |
https://github.com/nagarx/Quantum-KNN-Classifier-using-Qiskit | nagarx | from qiskit import QuantumCircuit, QuantumRegister
def swap_test(N):
'''
`N`: Number of qubits of the quantum registers.
'''
a = QuantumRegister(N, 'a')
b = QuantumRegister(N, 'b')
d = QuantumRegister(1, 'd')
# Quantum Circuit
qc_swap = QuantumCircuit(name = ' SWAP \nTes... |
https://github.com/nagarx/Quantum-KNN-Classifier-using-Qiskit | nagarx | # Classical computing modules
import numpy as np
import pandas as pd
import seaborn as sns
from statistics import mode
# Dataset
from sklearn import datasets, preprocessing
from sklearn.model_selection import train_test_split
# Quantum computing modules
from qiskit import QuantumCircuit, QuantumRegister, Clas... |
https://github.com/varunpalakodeti20/Grover-Algo | varunpalakodeti20 | import numpy as np
# Importing standard Qiskit libraries
from qiskit import QuantumCircuit, transpile, Aer, IBMQ
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *
from qiskit.providers.aer import QasmSimulator
# Loading your IBM Quantum account(s)
provid... |
https://github.com/Sinestro38/Shors-Algorithm | Sinestro38 | import matplotlib.pyplot as plt
import numpy as np
from qiskit import QuantumCircuit, Aer, transpile, assemble
from qiskit.visualization import plot_histogram
from math import gcd
from numpy.random import randint
import pandas as pd
from fractions import Fraction
print("Imports Successful")
def c_amod15(a, p... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | from qiskit_chemistry import FermionicOperator, QMolecule
from qiskit_chemistry.aqua_extensions.components.initial_states import HartreeFock
from qiskit_chemistry.aqua_extensions.components.variational_forms import UCCSD
from qiskit_chemistry import QMolecule as qm
from qiskit_aqua.components.optimizers import CO... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | from qiskit_chemistry import FermionicOperator, QMolecule
from qiskit_chemistry.aqua_extensions.components.initial_states import HartreeFock
from qiskit_chemistry.aqua_extensions.components.variational_forms import UCCSD
from qiskit_chemistry import QMolecule as qm
from qiskit_aqua.components.optimizers import CO... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | from qiskit_chemistry import FermionicOperator, QMolecule
from qiskit_chemistry.aqua_extensions.components.initial_states import HartreeFock
from qiskit_chemistry.aqua_extensions.components.variational_forms import UCCSD
from qiskit_chemistry import QMolecule as qm
from qiskit_aqua.components.optimizers import CO... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | from qiskit_chemistry import FermionicOperator, QMolecule
from qiskit_chemistry.aqua_extensions.components.initial_states import HartreeFock
from qiskit_chemistry.aqua_extensions.components.variational_forms import UCCSD
from qiskit_chemistry import QMolecule as qm
from qiskit_aqua.components.optimizers import CO... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | #Once debugged, put this in Jupyter notebook
from math import pi
import numpy as np
import scipy as sp
# importing Qiskit
from qiskit import Aer
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import execute
from qiskit.tools.visualization import plot_histogram, matplotli... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 |
from math import pi
import numpy as np
import scipy as sp
# importing Qiskit
from qiskit import Aer
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import execute
from qiskit.tools.visualization import plot_histogram
from qiskit.tools.monitor import job_monitor
# We fi... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | from qiskit_chemistry import FermionicOperator, QMolecule
from qiskit_chemistry.aqua_extensions.components.initial_states import HartreeFock
from qiskit_chemistry.aqua_extensions.components.variational_forms import UCCSD
from qiskit_aqua.components.optimizers import COBYLA
from qiskit_aqua import Operator
from... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | from qiskit_chemistry import FermionicOperator, QMolecule
from qiskit_chemistry.aqua_extensions.components.initial_states import HartreeFock
from qiskit_chemistry.aqua_extensions.components.variational_forms import UCCSD
from qiskit_aqua.components.optimizers import COBYLA
from qiskit_aqua import Operator
from... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | from qiskit.chemistry import FermionicOperator
from qiskit.chemistry.aqua_extensions.components.initial_states import HartreeFock
from qiskit.chemistry.aqua_extensions.components.variational_forms import UCCSD
from qiskit.chemistry import QMolecule as qm
from qiskit.aqua.components.optimizers import COBYLA
from ... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | from __future__ import print_function
from imp import reload
import matplotlib
reload(matplotlib)
matplotlib.use('nbagg')
import matplotlib.backends.backend_nbagg
reload(matplotlib.backends.backend_nbagg)
import matplotlib.backends.backend_webagg_core
reload(matplotlib.backends.backend_webagg_core)
i... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # Copyright 2019 Cambridge Quantum Computing
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # Copyright 2019 Cambridge Quantum Computing
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # Copyright 2019 Cambridge Quantum Computing
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # import common packages
import itertools
import numpy as np
from numpy import array, concatenate, zeros
import qiskit
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from qiskit.quantum_info import Pauli
# lib from Qiskit AQUA Chemistry
from qiskit.chemistry import FermionicOperator
... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # Copyright 2019 Cambridge Quantum Computing
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | import qiskit
from qiskit.dagcircuit import DAGCircuit
from qiskit.providers import BaseBackend
from qiskit.transpiler.basepasses import TransformationPass, BasePass
from qiskit.converters import circuit_to_dag, dag_to_circuit
from pytket._transform import Transform
from pytket._routing import route, Architectu... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | """Python implementation of Grovers algorithm through use of the Qiskit library to find the value 3 (|11>)
out of four possible values."""
#import numpy and plot library
import matplotlib.pyplot as plt
import numpy as np
# importing Qiskit
from qiskit import IBMQ, Aer, QuantumCircuit, ClassicalRegister, Qu... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | """The following is python code utilizing the qiskit library that can be run on extant quantum
hardware using 5 qubits for factoring the integer 15 into 3 and 5. Using period finding,
for a^r mod N = 1, where a = 11 and N = 15 (the integer to be factored) the problem is to find
r values for this identity such that... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | """Qiskit code for running Simon's algorithm on quantum hardware for 2 qubits and b = '11' """
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, execute
# import basic plot tools
from qiskit.visualization import plot_histogram
... |
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- 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/mmetcalf14/Hamiltonian_Downfolding_IBM | mmetcalf14 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 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.