repo
stringclasses
885 values
file
stringclasses
741 values
content
stringlengths
4
215k
https://github.com/DmitriiNabok/QuantumKitchenSinks
DmitriiNabok
import numpy as np from matplotlib import pyplot as plt from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler from matplotlib.colors import ListedColormap seed = 12345 def plot_dataset(X, y, ax, axes=[-1, 1, -1, 1], marker='o', size=50, alpha=1.0, stepsize=0.5, gr...
https://github.com/jdellaverson19/qiskit2020
jdellaverson19
# -*- 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/abhik-99/Qiskit-Summer-School
abhik-99
!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/2lambda123/Qiskit-qiskit
2lambda123
# 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. # # Any modifications or deriv...
https://github.com/drnickallgood/simonqiskit
drnickallgood
from qiskit import QuantumCircuit, execute, Aer, IBMQ from qiskit.providers.aer import noise import pprint # Choose a real device to simulate IBMQ.load_account() provider = IBMQ.get_provider(hub='ibm-q') device = provider.get_backend('ibmq_vigo') properties = device.properties() coupling_map = device.configur...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
import qiskit.qasm3 program = """ OPENQASM 3.0; include "stdgates.inc"; input float[64] a; qubit[3] q; bit[2] mid; bit[3] out; let aliased = q[0:1]; gate my_gate(a) c, t { gphase(a / 2); ry(a) c; cx c, t; } gate my_phase(a) c { ctrl ...
https://github.com/Gopal-Dahale/qiskit-qulacs
Gopal-Dahale
"""Variational Quantum Eigensolver (VQE) tutorial.""" from IPython.display import clear_output import matplotlib.pyplot as plt import numpy as np from qiskit_nature.units import DistanceUnit from qiskit_nature.second_q.drivers import PySCFDriver from qiskit_nature.second_q.mappers import JordanWignerMapper f...
https://github.com/swe-bench/Qiskit__qiskit
swe-bench
# 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. # # Any modifications or...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import BasicAer, transpile, QuantumRegister, ClassicalRegister, QuantumCircuit qr = QuantumRegister(1) cr = ClassicalRegister(1) qc = QuantumCircuit(qr, cr) qc.h(0) qc.measure(0, 0) qc.x(0).c_if(cr, 0) qc.measure(0, 0) qc.draw('mpl')
https://github.com/drithidavuluri/Implementation-of-Algorithm-using-Qiskit
drithidavuluri
# Importing Libraries import torch from torch import cat, no_grad, manual_seed from torch.utils.data import DataLoader from torchvision import transforms import torch.optim as optim from torch.nn import ( Module, Conv2d, Linear, Dropout2d, NLLLoss ) import torch.nn.functional as F impo...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import QuantumCircuit, transpile from qiskit.providers.fake_provider import FakeBoeblingen backend = FakeBoeblingen() ghz = QuantumCircuit(5) ghz.h(0) ghz.cx(0,range(1,5)) circ = transpile(ghz, backend, scheduling_method="asap") circ.draw(output='mpl')
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit_optimization import QuadraticProgram problem = QuadraticProgram("sample") problem.binary_var("x") problem.binary_var("y") problem.maximize(linear={"x": 1, "y": -2}) print(problem.prettyprint()) from qiskit.algorithms import NumPyMinimumEigensolver from qiskit_optimization.algorithms import Mini...
https://github.com/GabrielPontolillo/QiskitPBT
GabrielPontolillo
from qiskit import QuantumCircuit import random from QiskitPBT.input_generators import InputGenerator class RandomGroversOracleMarkedStatesPairGenerator(InputGenerator): def __init__(self, low: int, high: int, marked_states: str | int = "random"): if low < 2: raise ValueError("Low mu...
https://github.com/SanNare/qiskit-notebooks
SanNare
from qiskit import QuantumCircuit from qiskit.tools.visualization import plot_histogram from qiskit.extensions import UnitaryGate import numpy as np def logicalAnd(circuit,input_qubits,output_qubit): circuit.mcx(input_qubits,output_qubit) def logicalOr(circuit,input_qubits,output_qubit): for i in...
https://github.com/swe-bench/Qiskit__qiskit
swe-bench
# 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. # # Any modifications or...
https://github.com/rubenandrebarreiro/summer-school-on-quantum-computing-software-for-near-term-quantum-devices-2020
rubenandrebarreiro
import numpy as np import numpy.fft import matplotlib.pyplot as plt from qiskit.aqua.circuits import StateVectorCircuit from qiskit.circuit.library import QFT, Barrier from qiskit import QuantumCircuit, QuantumRegister, execute, Aer def normalize(ψ): n = np.linalg.norm(ψ) return ψ if n == 0 else ψ / n...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
# Necessary imports import numpy as np import matplotlib.pyplot as plt from torch import Tensor from torch.nn import Linear, CrossEntropyLoss, MSELoss from torch.optim import LBFGS from qiskit import QuantumCircuit from qiskit.utils import algorithm_globals from qiskit.circuit import Parameter from qiski...
https://github.com/Tojarieh97/VQE
Tojarieh97
from openfermion.chem import MolecularData from openfermion.transforms import get_fermion_operator, jordan_wigner from openfermion.linalg import get_ground_state, get_sparse_operator import numpy import scipy import scipy.linalg # Load saved file for H2. diatomic_bond_length = 1.2 geometry = [('H', (0., 0., 0...
https://github.com/mspronesti/qlearnkit
mspronesti
import numbers from abc import ABC from typing import List, Dict, Optional, Union import numpy as np import logging from qiskit import QuantumCircuit from qiskit.providers import Backend from qiskit.result import Result from qiskit.tools import parallel_map from qiskit.utils import QuantumInstance from ...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
import numpy as np from qiskit import QuantumCircuit from qiskit.quantum_info import DensityMatrix from qiskit.visualization import plot_state_hinton qc = QuantumCircuit(2) qc.h([0, 1]) qc.cz(0,1) qc.ry(np.pi/3 , 0) qc.rx(np.pi/5, 1) state = DensityMatrix(qc) plot_state_hinton(state, title="New Hinton Plo...
https://github.com/swe-bench/Qiskit__qiskit
swe-bench
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 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 modifications or...
https://github.com/DLR-RB/QUEASARS
DLR-RB
from pathlib import Path import os import sys main_directory = Path(os.path.abspath("")).parent sys.path.append(str(main_directory)) from queasars.job_shop_scheduling.problem_instances import Machine, Operation, Job, JobShopSchedulingProblemInstance machines = (Machine(name="m0"), Machine(name="m1")) j0o...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import QuantumCircuit from qiskit.quantum_info import DensityMatrix from qiskit.visualization import plot_state_city qc = QuantumCircuit(2) qc.h(0) qc.cx(0,1) # plot using a DensityMatrix state = DensityMatrix(qc) plot_state_city(state)
https://github.com/ronitd2002/IBM-Quantum-challenge-2024
ronitd2002
# -*- 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/Axect/QuantumAlgorithms
Axect
import numpy as np from qiskit import BasicAer from qiskit.aqua import QuantumInstance from qiskit.aqua.algorithms import Simon from qiskit.aqua.components.oracles import TruthTableOracle bitmaps = [ '01101001', '10011001', '01100110' ] oracle = TruthTableOracle(bitmaps) def compute_mask(in...
https://github.com/Z-928/Bugs4Q
Z-928
from qiskit import * qc = QuantumCircuit(2) qc.h(i) qc.crz (PI/4, 0, 1)
https://github.com/swe-train/qiskit__qiskit
swe-train
# This code is part of Qiskit. # # (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 modifications or deriv...
https://github.com/2lambda123/Qiskit-qiskit
2lambda123
# This code is part of Qiskit. # # (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 modifications or deriv...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
import numpy as np from qiskit import QuantumCircuit, transpile from qiskit.providers.fake_provider import FakeVigoV2 from qiskit.visualization import plot_circuit_layout from qiskit.tools.monitor import job_monitor from qiskit.providers.fake_provider import FakeVigoV2 import matplotlib.pyplot as plt ghz = Qua...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
import numpy as np import matplotlib.pyplot as plt from IPython.display import display, clear_output from qiskit.primitives import Estimator from qiskit.algorithms.minimum_eigensolvers import VQE from qiskit.algorithms.observables_evaluator import estimate_observables from qiskit.algorithms.optimizers import COBY...
https://github.com/zeynepCankara/Introduction-Quantum-Programming
zeynepCankara
# # your solution is here #
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit.quantum_info import SparsePauliOp H2_op = SparsePauliOp.from_list( [ ("II", -1.052373245772859), ("IZ", 0.39793742484318045), ("ZI", -0.39793742484318045), ("ZZ", -0.01128010425623538), ("XX", 0.18093119978423156), ] ) print(f"Number of qubits: {...
https://github.com/aryashah2k/Quantum-Computing-Collection-Of-Resources
aryashah2k
# import all necessary objects and methods for quantum circuits from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer all_pairs = ['00','01','10','11'] # # your code is here # # import all necessary objects and methods for quantum circuits from qiskit import QuantumRegister, Cla...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector from qiskit.visualization import plot_state_qsphere qc = QuantumCircuit(2) qc.h(0) qc.cx(0, 1) state = Statevector(qc) plot_state_qsphere(state)
https://github.com/GIRISHBELANI/QC_Benchmarks_using_dm-simulator
GIRISHBELANI
import maxcut_benchmark import auxiliary_functions as aux_fun import execute execute.set_noise_model(noise_model = None) maxcut_benchmark.verbose = False backend_id = "qasm_simulator" hub = "ibm-q" group = "open" project = "main" provider_backend = None exec_options = None num_qubits = 4 num_shots = 100...
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/biswaroopmukherjee/Quantum-Waddle
biswaroopmukherjee
import numpy as np import time import networkx as nx import matplotlib.pyplot as plt import random from qiskit import (QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer) %matplotlib qt steps = 5 n=4 def counts_to_prob_1d(counts): # Convert histogram counts to probability vector of size ...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector from qiskit.visualization import plot_state_city qc = QuantumCircuit(2) qc.h(0) qc.cx(0,1) # plot using a Statevector state = Statevector(qc) plot_state_city(state)
https://github.com/GabrielPontolillo/Quantum_Algorithm_Implementations
GabrielPontolillo
from scipy.stats import kruskal, f_oneway import pandas as pd import numpy as np #if p value less than alpha reject qiskit_data = np.full(10000, 0.25) cirq_data = np.full(10000, 0.25) qs_data = np.full(10000, 0.25) kruskal(qiskit_data, cirq_data, qs_data) #if p value less than alpha reject qiskit_d...
https://github.com/trevorpiltch/Grovers-Algorithm
trevorpiltch
from qiskit import * from math import pi def amplifier(n): """Creates a general diffuser using V and V-Dagger gates""" circuit = QuantumCircuit(n) circuit.x(range(n)) #V circuit.cu1(pi/4, 0, 3) #V-dagger circuit.cx(0, 1) circuit.cu1(-pi/4, 1, 3) circuit.cx(0, 1) ...
https://github.com/shesha-raghunathan/DATE2019-qiskit-tutorial
shesha-raghunathan
import matplotlib.pyplot as plt import numpy as np import dimod n_spins = 3 h = {v: np.random.uniform(-2, 2) for v in range(n_spins)} J = {(0, 1): np.random.uniform(-1, 1), (1, 2): np.random.uniform(-1, 1)} model = dimod.BinaryQuadraticModel(h, J, 0.0, dimod.SPIN) sampler = dimod.SimulatedAnnealingSample...
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM
mmetcalf14
# -*- 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/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit from qiskit.dagcircuit import DAGCircuit from qiskit.converters import circuit_to_dag from qiskit.circuit.library.standard_gates import CHGate, U2Gate, CXGate from qiskit.converters import dag_to_circuit q = QuantumRegister(3, 'q') c = Classi...
https://github.com/swe-train/qiskit__qiskit
swe-train
# 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/SamperQuinto/QisKit
SamperQuinto
#initialization import matplotlib.pyplot as plt import numpy as np import math # importing Qiskit from qiskit import IBMQ, Aer, transpile, assemble from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister # import basic plot tools from qiskit.visualization import plot_histogram qpe = Quantum...
https://github.com/JavaFXpert/quantum-pong
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/jonasmaziero/computacao_quantica_qiskit
jonasmaziero
%run init.ipynb c00,c01,c10,c11 = symbols('c_{00} c_{01} c_{10} c_{11}') psiAB = Matrix([[c00],[c01],[c10],[c11]]); psiAB rhoAB = psiAB*conjugate(psiAB.T); rhoAB rhoA = ptraceB(2,2,rhoAB); rhoB = ptraceA(2,2,rhoAB) rhoA, rhoB pauli(3)*pauli(1)*pauli(3), pauli(3)*pauli(2)*pauli(3), comm(pauli(3),pauli(1)),...
https://github.com/vandnaChaturvedi/Qauntum_algorithms_Qiskit
vandnaChaturvedi
#from qiskit_textbook.widgets import dj_widget #dj_widget(size="small", case="balanced") # initialization ####################################################################################################################### qiskit_edit_1 from qiskit import QuantumCircuit, execute from qiskit import Quant...
https://github.com/PayalSolanki2906/Quantum_algorithms_using_Qiskit
PayalSolanki2906
from qiskit import QuantumCircuit, assemble, Aer from qiskit.visualization import plot_histogram, plot_bloch_vector from cmath import sqrt, pi, exp sim = Aer.get_backend('aer_simulator') qc = QuantumCircuit(1) # Create a quantum circuit with one qubit initial_state = [0,1] qc.initialize(initial_state, 0) si...
https://github.com/indian-institute-of-science-qc/qiskit-aakash
indian-institute-of-science-qc
import numpy as np from qiskit import * import matplotlib qr = QuantumRegister(2) #measurements from quantum bits = use classical register cr = ClassicalRegister(2) circuit = QuantumCircuit(qr, cr) circuit.draw() # adding quantum gates to create entanglement (Hadamart gate) circuit.h(qr[0]) %ma...
https://github.com/Qiskit-Extensions/circuit-knitting-toolbox
Qiskit-Extensions
import numpy as np from qiskit import QuantumCircuit qc_0 = QuantumCircuit(7) for i in range(7): qc_0.rx(np.pi / 4, i) qc_0.cx(0, 3) qc_0.cx(1, 3) qc_0.cx(2, 3) qc_0.cx(3, 4) qc_0.cx(3, 5) qc_0.cx(3, 6) qc_0.cx(0, 3) qc_0.cx(1, 3) qc_0.cx(2, 3) qc_0.draw("mpl") from qiskit.quantum_info import S...
https://github.com/WhenTheyCry96/qiskitHackathon2022
WhenTheyCry96
%load_ext autoreload %autoreload 2 import os import warnings import numpy as np import pyEPR as epr import qiskit_metal as metal from collections import OrderedDict import scqubits as scq from scipy.constants import c, h, pi, hbar, e from qiskit_metal import designs, draw, MetalGUI, Dict, Headings from qis...
https://github.com/qclib/qclib
qclib
# Copyright 2021 qclib project. # 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 applicable law or agreed to in w...
https://github.com/Axect/QuantumAlgorithms
Axect
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/joshy91/PythonQiskit
joshy91
import numpy as np import scipy from scipy.linalg import expm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler, MinMaxScaler from sklearn.decomposition import...
https://github.com/Pitt-JonesLab/slam_decomposition
Pitt-JonesLab
from abc import ABC import numpy as np from qiskit import QuantumCircuit from qiskit.circuit.library import SwapGate from qiskit.quantum_info import * from weylchamber import J_T_LI, bell_basis, c1c2c3, canonical_gate, g1g2g3 from slam.utils.gates.custom_gates import BerkeleyGate """ Defines functions tha...
https://github.com/Qiskit/qiskit-qasm3-import
Qiskit
import qiskit_qasm3_import project = 'Qiskit OpenQASM 3 Importer' copyright = '2022, Jake Lishman' author = 'Jake Lishman' version = qiskit_qasm3_import.__version__ release = qiskit_qasm3_import.__version__ extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "reno.sphinxext", 'q...
https://github.com/Qiskit/feedback
Qiskit
import matplotlib.pyplot as plt import numpy as np from IPython.display import clear_output from qiskit import QuantumCircuit, Aer from qiskit.algorithms.optimizers import COBYLA from qiskit.circuit import ParameterVector from qiskit.circuit.library import ZFeatureMap from qiskit.opflow import AerPauliExpectatio...
https://github.com/jonasmaziero/computacao_quantica_qiskit
jonasmaziero
from sympy import * init_printing(use_unicode=True) mu_u = Matrix([[-1],[+1],[+1]]); mu_u A_R = Matrix([[1,1,-1,-1],[1,-1,1,-1],[1,-1,-1,1]]); A_R p1,p2,p3,p4 = symbols('p_1 p_2 p_3 p_4') p4 = 1-p1-p2-p3 cl = A_R[:,0]*p1 + A_R[:,1]*p2 + A_R[:,2]*p3 + A_R[:,3]*p4 mu_u - cl s1 = Matrix([[0,1],[1,0]]) s2...
https://github.com/Qubico-Hack/tutorials
Qubico-Hack
!pip install qiskit-machine-learning !pip install --upgrade matplotlib !pip install pylatexenc !pip install pillow # Necessary imports import numpy as np import matplotlib.pyplot as plt from torch import Tensor from torch.nn import Linear, CrossEntropyLoss, MSELoss from torch.optim import LBFGS from qis...
https://github.com/swe-train/qiskit__qiskit
swe-train
# This code is part of Qiskit. # # (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 modifications or deriv...
https://github.com/abbarreto/qiskit3
abbarreto
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/2lambda123/Qiskit-qiskit
2lambda123
# 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. # # Any modifications or...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import pulse d0 = pulse.DriveChannel(0) d1 = pulse.DriveChannel(1) with pulse.build() as pulse_prog: with pulse.align_right(): # this pulse will start at t=0 pulse.play(pulse.Constant(100, 1.0), d0) # this pulse will start at t=80 pulse.play(pulse.Constant(20,...
https://github.com/swe-bench/Qiskit__qiskit
swe-bench
# 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/swe-bench/Qiskit__qiskit
swe-bench
# This code is part of Qiskit. # # (C) Copyright IBM 2023. # # 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/swe-bench/Qiskit__qiskit
swe-bench
# This code is part of Qiskit. # # (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 modifications or deriv...
https://github.com/swe-bench/Qiskit__qiskit
swe-bench
# -*- 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/benkoehlL/Qiskit_Playground
benkoehlL
from qiskit import IBMQ from qiskit import * #provider = IBMQ.enable_account(<INSERT_IBM_QUANTUM_EXPERIENCE_TOKEN>) qc = QuantumCircuit(2,2) qc.h(0) qc.cx(0,1) qc.measure(1,0) backend = IBMQ.get_backend('ibmq_qasm_simulator', hub=None) job=execute(qc, backend, shots=1000) result = job.result() print(res...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
# You can set a color for all the bars. from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector from qiskit.visualization import plot_state_paulivec qc = QuantumCircuit(2) qc.h(0) qc.cx(0, 1) state = Statevector(qc) plot_state_paulivec(state, color='midnightblue', title="New PauliVec...
https://github.com/ElePT/qiskit-algorithms-test
ElePT
# This code is part of Qiskit. # # (C) Copyright IBM 2022, 2023. # # 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/QC-Hub/Examples
QC-Hub
from qiskit.providers.ibmq import least_busy from qiskit import IBMQ from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute #IBMQ.save_account("Account id") APItoken="APItoken" config = { "url": 'https://quantumexperience.ng.bluemix.net/api'} #IBMQ.backends() #Search for...
https://github.com/xtophe388/QISKIT
xtophe388
import sys, getpass try: sys.path.append("../../") # go to parent dir import Qconfig qx_config = { "APItoken": Qconfig.APItoken, "url": Qconfig.config['url']} print('Qconfig loaded from %s.' % Qconfig.__file__) except: APItoken = getpass.getpass('Please input your token and ...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import QuantumCircuit from qiskit.quantum_info import Operator from qiskit.transpiler.passes import UnitarySynthesis circuit = QuantumCircuit(1) circuit.rx(0.8, 0) unitary = Operator(circuit).data unitary_circ = QuantumCircuit(1) unitary_circ.unitary(unitary, [0]) synth = UnitarySynthesis(basi...
https://github.com/swe-bench/Qiskit__qiskit
swe-bench
# This code is part of Qiskit. # # (C) Copyright IBM 2023 # # 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 deriva...
https://github.com/swe-bench/Qiskit__qiskit
swe-bench
# -*- 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/1chooo/Quantum-Oracle
1chooo
from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector qc = QuantumCircuit(3) qc.x(0) qc.y(1) qc.z(2) print(qc) qc.draw("mpl") state = Statevector.from_instruction(qc) state.draw('bloch')
https://github.com/nahumsa/Introduction-to-IBM_Qiskit
nahumsa
#initialization import matplotlib.pyplot as plt import numpy as np import math # importing Qiskit from qiskit import IBMQ, Aer, transpile, assemble from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister # import basic plot tools from qiskit.visualization import plot_histogram qpe = Quantum...
https://github.com/oracleagent/qSHA256
oracleagent
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer from qiskit.circuit.library import XGate, RZGate, CXGate, CCXGate, U2Gate def quantum_xor(circuit, a, b, output): """Quantum XOR gate using CNOTs.""" circuit.cx(a, output) circuit.cx(b, output) def quantum_and(circ...
https://github.com/jonasmaziero/computacao_quantica_qiskit
jonasmaziero
hub=qc-spring-22-2, group=group-5 and project=recPrYILNAOsYMWIV
https://github.com/hephaex/Quantum-Computing-Awesome-List
hephaex
from qiskit import QuantumCircuit, execute, Aer from qiskit.visualization import plot_histogram, plot_bloch_vector from math import sqrt, pi %config InlineBackend.figure_format = 'svg' qc = QuantumCircuit(1) initialize_state = [1,0] qc.initialize(initialize_state, 0) qc.draw() backend = Aer.get_backend(...
https://github.com/mmetcalf14/Hamiltonian_Downfolding_IBM
mmetcalf14
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/qiskit-community/qiskit-translations-staging
qiskit-community
import numpy as np from qiskit import * # Create a Quantum Circuit acting on a quantum register of three qubits circ = QuantumCircuit(3) # Add a H gate on qubit $q_{0}$, putting this qubit in superposition. circ.h(0) # Add a CX (CNOT) gate on control qubit $q_{0}$ and target qubit $q_{1}$, putting # the qu...
https://github.com/msramalho/Teach-Me-Quantum
msramalho
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister from qiskit import execute # Choose the drawer you like best: from qiskit.tools.visualization import matplotlib_circuit_drawer as draw #from qiskit.tools.visualization import circuit_drawer as draw from qiskit import IBMQ IBMQ.load_accounts...
https://github.com/abbarreto/qiskit2
abbarreto
%run init.ipynb from qiskit import * nshots = 8192 IBMQ.load_account() provider= qiskit.IBMQ.get_provider(hub='ibm-q-research-2',group='federal-uni-sant-1',project='main') device = provider.get_backend('ibmq_bogota') simulator = Aer.get_backend('qasm_simulator') from qiskit.visualization import plot_histogram f...
https://github.com/ankitkmisra/Quantum-Computing-and-Cryptography
ankitkmisra
from qiskit import * from qiskit.tools.jupyter import * from qiskit.visualization import * import matplotlib.pyplot as plotter import numpy as np from IPython.display import display, Math, Latex %matplotlib inline # Loading your IBM Q account(s) provider = IBMQ.load_account() qr = QuantumRegister(3) crz = C...
https://github.com/scaleway/qiskit-scaleway
scaleway
# This code is part of Qiskit. # # (C) Copyright IBM 2022, 2023. # # 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/zapatacomputing/qe-qiskit
zapatacomputing
################################################################################ # © Copyright 2021 Zapata Computing Inc. ################################################################################ import json import os import subprocess import unittest import numpy as np import qiskit.providers.aer.nois...
https://github.com/swe-bench/Qiskit__qiskit
swe-bench
# This code is part of Qiskit. # # (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 modifications or deriv...
https://github.com/shesha-raghunathan/DATE2019-qiskit-tutorial
shesha-raghunathan
# You may need to trust this notebook before the button below works from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </sc...
https://github.com/Kairos-T/QRNG
Kairos-T
from flask import Flask, render_template, request, jsonify from qiskit import QuantumCircuit, Aer, transpile, assemble import matplotlib.pyplot as plt from io import BytesIO import base64 import numpy as np from scipy import stats app = Flask(__name__) # Global variables number_counts = {} total_generated...
https://github.com/JouziP/MQITE
JouziP
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 13 12:40:38 2022 @author: pejmanjouzdani """ # # from SimulateMQITE.log_config import logger import pandas as pd import numpy as np from qiskit import QuantumCircuit from MultiQubitGate.functions import multiqubit from BasicFun...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
import matplotlib.pyplot as plt from qiskit import QuantumCircuit, transpile from qiskit.providers.fake_provider import FakeAuckland backend = FakeAuckland() ghz = QuantumCircuit(15) ghz.h(0) ghz.cx(0, range(1, 15)) ghz.draw(output='mpl')
https://github.com/VedDharkar/IBM_QISKIT_EXAM_C1000-112
VedDharkar
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 import * # Loading your IBM Q account(s) #provider = IBMQ.load_account() q = Qua...
https://github.com/ElePT/qiskit-algorithms-test
ElePT
# This code is part of Qiskit. # # (C) Copyright IBM 2022, 2023. # # 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/peiyong-addwater/Hackathon-QNLP
peiyong-addwater
import collections import pickle import warnings warnings.filterwarnings("ignore") import os from random import shuffle import re import spacy from discopy.tensor import Tensor from discopy import Word from discopy.rigid import Functor import seaborn as sns import pandas as pd import matplotlib.pyplot as p...
https://github.com/2lambda123/Qiskit-qiskit
2lambda123
# 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. # # Any modifications or...
https://github.com/avkhadiev/schwinger-vqe
avkhadiev
#Assign these values as per your requirements. global min_qubits,max_qubits,skip_qubits,max_circuits,num_shots,Noise_Inclusion min_qubits=1 max_qubits=3 skip_qubits=1 max_circuits=3 num_shots=1000 use_XX_YY_ZZ_gates = True Noise_Inclusion = False saveplots = False Memory_utilization_plot = True Type_...
https://github.com/qiskit-community/qiskit-translations-staging
qiskit-community
from qiskit import QuantumCircuit top = QuantumCircuit(1) top.x(0); bottom = QuantumCircuit(2) bottom.cry(0.2, 0, 1); tensored = bottom.tensor(top) tensored.draw('mpl')