repo stringclasses 900
values | file stringclasses 754
values | content stringlengths 4 215k |
|---|---|---|
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | from qiskit import QuantumRegister, QuantumCircuit
# Quantum register
q = QuantumRegister(2, name='q')
# Quantum circuit
bell = QuantumCircuit(q)
# Create a Bell state
bell.x(q[0])
bell.x(q[1])
bell.h(q[0])
bell.cx(q[0], q[1])
# Draw circuit
bell.draw(output = 'mpl')
# Quantum register
q = QuantumR... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | # imports
import numpy as np
from qiskit import QuantumRegister, QuantumCircuit
####################################
# Depolarizing channel on IBMQX2 #
####################################
# Quantum register
q = QuantumRegister(4, name="q")
# Quantum circuit
depolarizing = QuantumCircuit(q)
# Depola... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | # Imports
import numpy as np
from qiskit import QuantumRegister, QuantumCircuit, Aer, execute
from qiskit.ignis.verification.tomography import state_tomography_circuits, StateTomographyFitter
import matplotlib.pyplot as plt
from qiskit.quantum_info import partial_trace
from qiskit.quantum_info.states import Densi... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | from qiskit import QuantumRegister, QuantumCircuit
from qiskit.circuit import Parameter
#############################
# Pauli channel on IBMQX2 #
#############################
# Quantum register
q = QuantumRegister(3, name="q")
# Quantum circuit
pauli = QuantumCircuit(q)
# Pauli channel acting on q_2... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import numpy as np
from scipy.optimize import fsolve, differential_evolution
# Main qiskit imports
from qiskit import QuantumRegister, ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer, IBMQ
# Tomography
from qiskit.ignis.verification.tomography import state_tomography_circuits
from qiskit.ig... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | from qiskit import QuantumRegister, QuantumCircuit
import numpy as np
#######################
# ZZ pump on IBMQX2 #
#######################
# Quantum register
q = QuantumRegister(5, name='q')
# Quantum circuit
zz = QuantumCircuit(q)
# ZZ pump acting on system qubits
## Qubit identification
system... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | # Imports
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import json
import copy
# Main qiskit imports
from qiskit import QuantumRegister, ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer, IBMQ
# Error mitigation
from qiskit.ignis.mitigation.measurement... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
import numpy as np
###########################################
# Amplitude damping channel on IBMQ_VIGO #
###########################################
# Quantum register
q = QuantumRegister(5, name='q')
# Quantum circuit
ad = QuantumCir... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | # Imports
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import json
import copy
# Main qiskit imports
from qiskit import QuantumRegister, ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer, IBMQ
# Error mitigation
from qiskit.ignis.mitigation.measurement... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | """
Circuit preparation for the amplitude damping channel
"""
from qiskit import QuantumCircuit
import numpy as np
from scipy.special import xlogy
from scipy.optimize import minimize_scalar
def initial_state(q, sys):
"""Returns a QuantumCircuit implementing the initial condition for the amplitude dampin... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | from bokeh.layouts import row, column
from bokeh.models import ColumnDataSource, Slider, CustomJS, Text, DataRange1d, Title
from bokeh.plotting import Figure, show, output_file
from bokeh.io import output_notebook
from amplitude_damping import *
R_values = np.geomspace(start=0.2, stop=500.0, num=100)
R_val... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import numpy as np
from bokeh.layouts import row, column
from bokeh.models import ColumnDataSource, Slider, CustomJS, Text
from bokeh.plotting import Figure, show, output_file
from bokeh.io import output_notebook
def c1t(t, lam = 1., R = .25, c10 = 1.):
expt = lam * t / 2
if R == .5:
... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import json
import copy
# Main qiskit imports
from qiskit import QuantumRegister, ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer, IBMQ
# Error mitigation
from qiskit.ignis.mitigation.measurement import (co... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from bokeh.layouts import layout
from bokeh.layouts import widgetbox
from bokeh.embed import file_html
from bokeh.io import show
from bokeh.io import output_notebook
from bokeh.models import Text
from bokeh.models import Plot
fr... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import numpy as np
from bokeh.layouts import row, column
from bokeh.models import ColumnDataSource, Slider, CustomJS, TextAnnotation
from bokeh.plotting import Figure, show
from bokeh.io import output_notebook
# Define data
x = [x*0.05 for x in range(0, 500)]
trigonometric_functions = {
'0': np.sin(x),
... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import numpy as np
from bokeh.layouts import row, column
from bokeh.models import ColumnDataSource, Slider, CustomJS, Text
from bokeh.plotting import Figure, show
from bokeh.io import output_notebook
def c1t(t, lam = 1., R = .25, c10 = 1.):
expt = lam * t / 2
if R == .5:
output = ... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import numpy as np
from bokeh.layouts import row, column
from bokeh.models import ColumnDataSource, Slider, CustomJS, Text
from bokeh.plotting import Figure, show
from bokeh.io import output_notebook
def c1t(t, lam = 1., R = .25, c10 = 1.):
expt = lam * t / 2
if R == .5:
output = ... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import json
import copy
# Main qiskit imports
from qiskit import QuantumRegister, ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer, IBMQ
# Error mitigation
from qiskit.ignis.mitigation.measurement import (co... |
https://github.com/matteoacrossi/oqs-jupyterbook | matteoacrossi | import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import json
import copy
# Main qiskit imports
from qiskit import QuantumRegister, ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer, IBMQ
# Error mitigation
from qiskit.ignis.mitigation.measurement import (co... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (C) Copyright IBM 2020.
#
# 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 modifi... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | # -*- 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/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
from qiskit.quantum_info import Operator
from qiskit import QuantumCircuit
import numpy as np
def phase_oracle(n, indices_to_mark, name = 'Oracle'):
# create a quantum circuit on n qubits
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (C) Copyright IBM 2020.
#
# 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 modifi... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | # -*- 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/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (C) Copyright IBM 2020.
#
# 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 modifi... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | # -*- 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/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (C) Copyright IBM 2020.
#
# 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 modifi... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | # -*- 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/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (C) Copyright IBM 2020.
#
# 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 modifi... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_bloch_multivector
excited = Statevector.from_int(1, 2)
plot_bloch_multivector(excited.data)
from qiskit.tools.jupyter import *
from qiskit import IBMQ
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q', group='open',... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (C) Copyright IBM 2020.
#
# 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 modifi... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | # import SymPy and define symbols
import sympy as sp
sp.init_printing(use_unicode=True)
wr = sp.Symbol('\omega_r') # resonator frequency
wq = sp.Symbol('\omega_q') # qubit frequency
g = sp.Symbol('g', real=True) # vacuum Rabi coupling
Delta = sp.Symbol('Delta', real=True) # wr - wq; defined later
# import oper... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
# our backend is the Pulse Simulator
from resources import helper
from qiskit.providers.aer import PulseSimulator
backend_sim = PulseSimulator()
# sample duration for pulse instructions
dt = 1e-9
... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (C) Copyright IBM 2020.
#
# 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 modifi... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SaashaJoshi/IBM-Qiskit-Summer-School-2020 | SaashaJoshi | !pip install -U -r grading_tools/requirements.txt
from IPython.display import clear_output
clear_output()
import numpy as np; pi = np.pi
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
from copy import deepcopy as make_copy
def prepare_hets_circuit(depth, ang... |
https://github.com/SimoneGasperini/qiskit-symb | SimoneGasperini | # -*- coding: utf-8 -*-
# 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.... |
https://github.com/SimoneGasperini/qiskit-symb | SimoneGasperini | """Docstring."""
from qiskit import QuantumCircuit, execute, QuantumRegister, ClassicalRegister
from qiskit_aer import Aer
class Random:
"""Demo random."""
def __init__(self):
"""Demo random."""
self.pow = 2
self.qasm = Aer.get_backend("aer_simulator")
def run(self, ... |
https://github.com/SimoneGasperini/qiskit-symb | SimoneGasperini | """Symbolic quantum base module"""
import numpy
import sympy
from sympy import Symbol, lambdify
from sympy.matrices import Matrix, matrix2numpy
from qiskit import QuantumCircuit
from qiskit.providers.basic_provider.basic_provider_tools import einsum_matmul_index
class QuantumBase:
"""Abstract symbolic... |
https://github.com/SimoneGasperini/qiskit-symb | SimoneGasperini | """Test controlled standard gates module"""
import numpy
from hypothesis import given, strategies, settings
from qiskit import QuantumCircuit
from qiskit.quantum_info import Operator
from qiskit.circuit.library import (
XGate, CXGate,
YGate, CYGate,
ZGate, CZGate,
HGate, CHGate,
SXGate, ... |
https://github.com/Qiskit-Partners/partners | Qiskit-Partners | import qiskit_qasm2
project = 'Qiskit OpenQASM 2 Tools'
copyright = '2022, Jake Lishman'
author = 'Jake Lishman'
version = qiskit_qasm2.__version__
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
]
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# Document the docstring fo... |
https://github.com/DylanLi272/QiskitFinalProject | DylanLi272 | from qiskit import BasicAer, Aer, IBMQ
from qiskit.aqua import QuantumInstance, aqua_globals
from qiskit.aqua.algorithms import VQE, ExactEigensolver, NumPyEigensolver
from qiskit.aqua.components.initial_states import Zero
from qiskit.aqua.components.optimizers import ADAM, AQGD, COBYLA, L_BFGS_B, SLSQP
from qiski... |
https://github.com/DylanLi272/QiskitFinalProject | DylanLi272 | from qiskit import BasicAer, Aer, IBMQ
from qiskit.aqua import QuantumInstance, aqua_globals
from qiskit.aqua.algorithms import VQE, ExactEigensolver, NumPyEigensolver
from qiskit.aqua.components.initial_states import Zero
from qiskit.aqua.components.optimizers import ADAM, AQGD, COBYLA, L_BFGS_B, SLSQP
from qiski... |
https://github.com/DylanLi272/QiskitFinalProject | DylanLi272 | from qiskit import BasicAer, Aer, IBMQ
from qiskit.aqua import QuantumInstance, aqua_globals
from qiskit.aqua.algorithms import VQE, ExactEigensolver, NumPyEigensolver
from qiskit.aqua.components.initial_states import Zero
from qiskit.aqua.components.optimizers import ADAM, AQGD, COBYLA, L_BFGS_B, SLSQP
from qiski... |
https://github.com/DylanLi272/QiskitFinalProject | DylanLi272 | from qiskit import BasicAer, Aer, IBMQ
from qiskit.aqua import QuantumInstance, aqua_globals
from qiskit.aqua.algorithms import VQE, ExactEigensolver, NumPyEigensolver
from qiskit.aqua.components.initial_states import Zero
from qiskit.aqua.components.optimizers import COBYLA, L_BFGS_B, SLSQP, SPSA, CRS
from qiskit... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | import warnings
warnings.filterwarnings("ignore")
from matplotlib import pyplot as plt
import numpy as np
from qiskit.circuit.library import TwoLocal
from qiskit_nature.drivers import Molecule
from qiskit_nature.drivers.second_quantization import PySCFDriver
from qiskit_nature.problems.second_quantization ... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | import warnings
warnings.filterwarnings("ignore")
import numpy as np
from matplotlib import pyplot as plt
from qiskit_nature.drivers import Molecule
from qiskit_nature.drivers.second_quantization import PySCFDriver
from qiskit_nature.problems.second_quantization import ElectronicStructureProblem
from qiski... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | import warnings
warnings.filterwarnings("ignore")
from matplotlib import pyplot as plt
import numpy as np
from qiskit.circuit.library import TwoLocal
from qiskit_nature.drivers import Molecule
from qiskit_nature.drivers.second_quantization import PySCFDriver
from qiskit_nature.problems.second_quantization ... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | import warnings
warnings.filterwarnings("ignore")
from matplotlib import pyplot as plt
import numpy as np
from qiskit.circuit.library import TwoLocal
from qiskit_nature.drivers import Molecule
from qiskit_nature.drivers.second_quantization import PySCFDriver
from qiskit_nature.problems.second_quantization ... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | import warnings
warnings.filterwarnings("ignore")
from matplotlib import pyplot as plt
import numpy as np
from qiskit.circuit.library import TwoLocal
from qiskit_nature.drivers import UnitsType, Molecule
from qiskit_nature.drivers.second_quantization import PySCFDriver
from qiskit_nature.problems.second_qu... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 deriv... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 deriv... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 deriv... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 deriv... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 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.
#
#... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 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.
#
#... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 deriv... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 deriv... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 deriv... |
https://github.com/qiskit-community/prototype-entanglement-forging | qiskit-community | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 deriv... |
https://github.com/JavaFXpert/quantum-circuit-pygame | JavaFXpert | #
# Copyright 2019 the original author or authors.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
https://github.com/JavaFXpert/quantum-circuit-pygame | JavaFXpert | #!/usr/bin/env python
#
# Copyright 2019 the original author or authors.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
https://github.com/JavaFXpert/quantum-circuit-pygame | JavaFXpert | #!/usr/bin/env python
#
# Copyright 2019 the original author or authors.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
https://github.com/JavaFXpert/quantum-circuit-pygame | JavaFXpert | #!/usr/bin/env python
#
# Copyright 2019 the original author or authors.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
https://github.com/JavaFXpert/quantum-circuit-pygame | JavaFXpert | #!/usr/bin/env python
#
# Copyright 2019 the original author or authors.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
https://github.com/quantumofme/pavia-qiskit-tutorials | quantumofme | # Welcome to qiskit
import qiskit as qk
myvers = qk.__version__
print("You are using qiskit version", myvers)
print("More details on qiskit components:",qk.__qiskit_version__)
my_token = ''
# Set up your credentials for the IBM Quantum Experience in one-time mode (easiest)
ibmq_provider = qk.IBMQ.enable_acco... |
https://github.com/quantumofme/pavia-qiskit-tutorials | quantumofme | import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
import qiskit as qk
qr0 = qk.QuantumRegister(1,name='qb') # qb for "qubit", but the name is optional
cr0 = qk.ClassicalRegister(1,name='b') # b for "bit", but the name is optional
qc0 = qk.QuantumCircuit(qr0,cr0)
qc0.draw(ou... |
https://github.com/quantumofme/pavia-qiskit-tutorials | quantumofme | import qiskit as qk
import numpy as np
from scipy.linalg import expm
import matplotlib.pyplot as plt
import math
# Single qubit operators
sx = np.array([[0.0, 1.0],[1.0, 0.0]])
sy = np.array([[0.0, -1.0*1j],[1.0*1j, 0.0]])
sz = np.array([[1.0, 0.0],[0.0, -1.0]])
idt = np.array([[1.0, 0.0],[0.0, 1.0]])
i... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import QuantumCircuit, execute, transpile, Aer
from qiskit.extensions import UnitaryGate,Initialize
from qiskit.quantum_info import Statevector
from qiskit.tools.visualization import plot_bloch_vector
from qiskit.tools.visualization import plot_histogram,plot_bloch_multivector
import numpy as np
... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import QuantumCircuit, execute, transpile, Aer
from qiskit.extensions import UnitaryGate,Initialize
from qiskit.quantum_info import Statevector
from qiskit.tools.visualization import plot_bloch_vector
from qiskit.tools.visualization import plot_histogram,plot_bloch_multivector
import numpy as np
... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import *
import matplotlib.pyplot as plt
from qiskit.extensions import UnitaryGate
from qiskit.circuit import add_control
from qiskit.tools.visualization import plot_bloch_multivector,plot_histogram
import numpy as np
import sys
sys.path.append("..")
from Modules.vanilla_qpe import QPE
U... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import *
import matplotlib.pyplot as plt
from qiskit.extensions import UnitaryGate
from qiskit.circuit import add_control
from IPython.display import display
from qiskit.tools.visualization import plot_histogram
import numpy as np
import sys
sys.path.append("..")
from Modules.faster_basic_qpe ... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import *
from qiskit import transpile
import numpy as np
import matplotlib.pyplot as plt
from qiskit.extensions import UnitaryGate
from qiskit import IBMQ
import sys
sys.path.append("..")
%matplotlib inline
qiskit.__qiskit_version__
from Modules.iterative_qpe import IQPE
U = UnitaryGate... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import *
import numpy as np
import sys
sys.path.append("..")
qiskit.__qiskit_version__
from Modules.kitaev_qpe import KQPE
U = np.array([[1, 0],
[0, np.exp(2*np.pi*1j*(1/3))]])
kqpe = KQPE(unitary=U, precision=16)
kq_circ = kqpe.get_circuit(show=True, save_circ=True,
... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import QuantumCircuit, execute, transpile, Aer
from qiskit.extensions import UnitaryGate, Initialize
import numpy as np
from qiskit.providers.ibmq.managed import IBMQJobManager
from sys import stdout
from scipy.stats import unitary_group
class bundled_SPEA_alternate:
def __init__(self, unitar... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import QuantumCircuit, execute, transpile, Aer
from qiskit.extensions import UnitaryGate, Initialize
from qiskit.providers.ibmq.managed import IBMQJobManager
import numpy as np
from sys import stdout
from scipy.stats import unitary_group
class bundled_changed_SPEA:
def __init__(self, unitary,... |
https://github.com/TheGupta2012/QPE-Algorithms | TheGupta2012 | from qiskit import QuantumCircuit, execute, transpile, Aer
from qiskit.extensions import UnitaryGate, Initialize
from qiskit.providers.ibmq.managed import IBMQJobManager
import numpy as np
from sys import stdout
from scipy.stats import unitary_group
class global_max_SPEA:
"""
This is a class which i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.