Package: qiskit-ibmq-provider
Qiskit IBM Quantum Provider (NOW DEPRECATED)PLEASE NOTE:As of version 0.20.0, released in January 2023,qiskit-ibmq-providerhas been deprecated
with its support ending and eventual archival being no sooner than 3 months from that date. The
function provided byqiskit-ibmq-provideris not going away rather it has being split out to separate repositories.
Please see theMigration Guidessection below for more detail. We encourage you
to migrate over at your earliest convenience.Qiskitis an open-source SDK for working with quantum computers at the level of circuits, algorithms, and application modules.This module contains a provider that allows accessing theIBM Quantumsystems and simulators.Migration GuidesAll the functionality thatqiskit-ibmq-providerprovides has been migrated to other packages:FormerlyCurrent packageDetailsMigration Guideqiskit.providers.ibmq.experimentqiskit-ibm-experiment(no docs yet)For the features related with the IBM Quantum experiment database service.guideqiskit.providers.ibmq.runtimeqiskit-ibm-runtime(docs)Use this package if you prefer getting high quality probability distribution or expectation values without having to optimize the circuits or mitigate results yourself.guideRest ofqiskit.providers.ibmqqiskit-ibm-provider(docs)Use this package if you need direct access to the backends to do experiments like device characterization.guideThese packages can be installed by themselves (via the standard pip install command, e.g.pip install qiskit-ibm-provider) and are not part of the Qiskit metapackage.InstallationWe encourage installing Qiskit via the PIP tool (a python package manager),
which installs all Qiskit elements and components, including this one.pipinstallqiskitPIP will handle all dependencies automatically for us and you will always
install the latest (and well-tested) version.To install from source, follow the instructions in thecontribution guidelines.Setting up the IBM Quantum ProviderOnce the package is installed, you can access the provider from Qiskit.Note: Since November 2019 (and with version0.4of thisqiskit-ibmq-providerpackage / version0.14of theqiskitpackage)
legacy Quantum Experience or QConsole (v1) accounts are no longer supported.
If you are still using a v1 account, please follow the steps described inupdate instructionsto update your account.Configure your IBM Quantum credentialsCreate an IBM Quantum account or log in to your existing account by visiting
theIBM Quantum login page.Copy (and/or optionally regenerate) your API token from yourIBM Quantum account page.Take your token from step 2, here calledMY_API_TOKEN, and run:fromqiskitimportIBMQIBMQ.save_account('MY_API_TOKEN')The command above stores your credentials locally in a configuration file calledqiskitrc.
By default, this file is located in$HOME/.qiskit, where$HOMEis your home directory. If
you are still usingQconfig.py, please delete that file and run the command above.Accessing your IBM Quantum backendsAfter callingIBMQ.save_account(), your credentials will be stored on disk.
Once they are stored, at any point in the future you can load and use them
in your program simply via:fromqiskitimportIBMQprovider=IBMQ.load_account()backend=provider.get_backend('ibmq_qasm_simulator')Alternatively, if you do not want to save your credentials to disk and only
intend to use them during the current session, you can use:fromqiskitimportIBMQprovider=IBMQ.enable_account('MY_API_TOKEN')backend=provider.get_backend('ibmq_qasm_simulator')By default, all IBM Quantum accounts have access to the same, open project
(hub:ibm-q, group:open, project:main). For convenience, theIBMQ.load_account()andIBMQ.enable_account()methods will return a provider
for that project. If you have access to other projects, you can use:provider_2=IBMQ.get_provider(hub='MY_HUB',group='MY_GROUP',project='MY_PROJECT')Updating to the new IBM QuantumSince November 2019 (and with version0.4of thisqiskit-ibmq-providerpackage), the IBM Quantum Provider only supports the newIBM Quantum, dropping
support for the legacy Quantum Experience and Qconsole accounts. The new IBM Quantum is also referred asv2, whereas the legacy one and Qconsole asv1.This section includes instructions for updating your accounts and programs.
Please note that:the IBM Quantum Experiencev1credentials and the programs written for pre-0.3
versions will still be working during the0.3.xseries. From 0.4 onwards,
onlyv2credentials are supported, and it is recommended to upgrade
in order to take advantage of the new features.updating your credentials to the IBM Quantumv2implies that you
will need to update your programs. The sections below contain instructions
on how to perform the transition.Updating your IBM Quantum credentialsIf you have credentials for the legacy Quantum Experience or Qconsole stored in
disk, you can make use ofIBMQ.update_account()helper. This helper will read
your current credentials stored in disk and attempt to convert them:fromqiskitimportIBMQIBMQ.update_account()Found 2 credentials.
The credentials stored will be replaced with a single entry with token "MYTOKEN"
and the new IBM Quantum v2 URL (https://auth.quantum-computing.ibm.com/api).

In order to access the provider, please use the new "IBMQ.get_provider()" methods:

  provider0 = IBMQ.load_account()
  provider1 = IBMQ.get_provider(hub='A', group='B', project='C')

Note you need to update your programs in order to retrieve backends from a
specific provider directly:

  backends = provider0.backends()
  backend = provider0.get_backend('ibmq_qasm_simulator')

Update the credentials? [y/N]Upon confirmation, your credentials will be overwritten with a valid IBM Quantum
v2 set of credentials. For more complex cases, consider deleting your
previous credentials viaIBMQ.delete_accounts()and follow the instructions
in theIBM Quantum account page.Updating your programsThe new IBM Quantum support also introduces a more structured approach for accessing backends.
Previously, access to all backends was centralized through:IBMQ.backends()IBMQ.get_backend('ibmq_qasm_simulator')In version0.3onwards, the preferred way to access the backends is via aProviderfor one of your projects instead of via the globalIBMQinstance
directly, allowing for more granular control over
the project you are using:my_provider=IBMQ.get_provider()my_provider.backends()my_provider.get_backend('ibmq_qasm_simulator')In a similar spirit, you can check the providers that you have access to via:IBMQ.providers()In addition, since the new IBM Quantum provides only one set of
credentials, the account management methods in IBMQ are now in singular form.
For example, you should useIBMQ.load_account()instead ofIBMQ.load_accounts(). AnIBMQAccountErrorexception is raised if you
attempt to use the legacy methods with an IBM Quantum v2 account.The following tables contains a quick reference for the differences between the
two versions. Please refer to the documentation of each method for more in
depth details:Account management<0.3 / v1 credentials>=0.3 and v2 credentialsN/AIBMQ.update_account()IBMQ.save_account(token, url)IBMQ.save_account(token)IBMQ.load_accounts()provider = IBMQ.load_account()IBMQ.enable_account()provider = IBMQ.enable_account()IBMQ.disable_accounts()IBMQ.disable_account()IBMQ.active_accounts()IBMQ.active_account()IBMQ.stored_accounts()IBMQ.stored_account()IBMQ.delete_accounts()IBMQ.delete_account()Using backends<0.3 / v1 credentials>=0.3 and v2 credentialsN/Aproviders = IBMQ.providers()backend = IBMQ.get_backend(name, hub='HUB')provider = IBMQ.get_provider(hub='HUB')backend = provider.get_backend(name)backends = IBMQ.backends(hub='HUB')provider = IBMQ.get_provider(hub='HUB')backends = provider.backends()Contribution GuidelinesIf you'd like to contribute to IBM Quantum Provider, please take a look at ourcontribution guidelines. This project adheres to Qiskit'scode of conduct.
By participating, you are expect to uphold to this code.We useGitHub issuesfor tracking requests and bugs. Please use ourslackfor discussion and simple questions. To join our Slack community use the
invite link atQiskit.org. For questions that are more suited for a forum we
use theQiskittag inStack Exchange.Next StepsNow you're set up and ready to check out some of the other examples from ourQiskit Tutorialrepository.Authors and CitationThe Qiskit IBM Quantum Provider is the work ofmany peoplewho contribute to the
project at different levels. If you use Qiskit, please cite as per the includedBibTeX file.LicenseApache License 2.0.