Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
rename qiskit_ibm to qiskit_ibm_provider (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
daka1510 authored Mar 2, 2022
1 parent 121d9d9 commit adece22
Show file tree
Hide file tree
Showing 116 changed files with 247 additions and 251 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include LICENSE.txt README.md
include qiskit_ibm/VERSION.txt
include qiskit_ibm_provider/VERSION.txt
recursive-include test *.py
12 changes: 6 additions & 6 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ provider = IBMQ.load_account() # loads saved account from disk
```
After
```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
IBMProvider.save_account(token='MY_API_TOKEN')
provider = IBMProvider() # loads saved account from disk
```
Expand All @@ -66,7 +66,7 @@ After
export QISKIT_IBM_API_TOKEN='MY_API_TOKEN'
```
```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
provider = IBMProvider() # loads account from env variables
```

Expand All @@ -82,7 +82,7 @@ IBMQ.stored_account() # get saved account from qiskitrc file
```
After
```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
IBMProvider.saved_account() # get saved account from qiskitrc file

# {'token': 'MY_API_TOKEN',
Expand All @@ -98,7 +98,7 @@ IBMQ.delete_account() # delete saved account from qiskitrc file
```
After
```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
IBMProvider.delete_account() # delete saved account from qiskitrc file
```

Expand All @@ -111,7 +111,7 @@ provider = IBMQ.enable_account(token='MY_API_TOKEN') # enable account for curren
```
After
```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
provider = IBMProvider(token='MY_API_TOKEN') # enable account for current session
```

Expand All @@ -128,7 +128,7 @@ IBMQ.active_account() # check active account
```
After
```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
provider = IBMProvider() # load saved account
IBMProvider.active_account() # check active account

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
.PHONY: lint style test mypy test1 test2 test3 runtime_integration

lint:
pylint -rn qiskit_ibm test
tools/verify_headers.py qiskit_ibm test
pylint -rn qiskit_ibm_provider test
tools/verify_headers.py qiskit_ibm_provider test

mypy:
mypy --module qiskit_ibm
mypy --module qiskit_ibm_provider

style:
pycodestyle qiskit_ibm test
pycodestyle qiskit_ibm_provider test

test:
python -m unittest -v
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ pip install qiskit-ibm-provider
1. Take your token from step 2, here called `MY_API_TOKEN`, and save it by calling `IBMProvider.save_account()`:

```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
IBMProvider.save_account(token='MY_API_TOKEN')
```

The command above stores your credentials locally in a configuration file called `qiskitrc`. By default, this file is located in `$HOME/.qiskit`, where `$HOME` is your home directory.
Once saved you can then instantiate the provider like below and access the backends:

```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
provider = IBMProvider()

# display current supported backends
Expand All @@ -54,15 +54,15 @@ export QISKIT_IBM_API_TOKEN='MY_API_TOKEN'

Then instantiate the provider without any arguments and access the backends:
```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
provider = IBMProvider()
```

### Enable Account for Current Session
As another alternative, you can also enable an account just for the current session by instantiating the provider with the token.

```python
from qiskit_ibm import IBMProvider
from qiskit_ibm_provider import IBMProvider
provider = IBMProvider(token='MY_API_TOKEN')
```

Expand Down
4 changes: 2 additions & 2 deletions docs/apidocs/ibm_credentials.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _qiskit_ibm-credentials:
.. _qiskit_ibm_provider-credentials:

.. automodule:: qiskit_ibm.credentials
.. automodule:: qiskit_ibm_provider.credentials
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/ibm_job.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _qiskit_ibm-job:
.. _qiskit_ibm_provider-job:

.. automodule:: qiskit_ibm.job
.. automodule:: qiskit_ibm_provider.job
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/ibm_jupyter.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _qiskit_ibm-jupyter:
.. _qiskit_ibm_provider-jupyter:

.. automodule:: qiskit_ibm.jupyter
.. automodule:: qiskit_ibm_provider.jupyter
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/ibm_provider.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _qiskit_ibm:
.. _qiskit_ibm_provider:

.. automodule:: qiskit_ibm
.. automodule:: qiskit_ibm_provider
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/ibm_utils.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _qiskit_ibm-utils:
.. _qiskit_ibm_provider-utils:

.. automodule:: qiskit_ibm.utils
.. automodule:: qiskit_ibm_provider.utils
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/ibm_visualization.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _qiskit_ibm-visualization:
.. _qiskit_ibm_provider-visualization:

.. automodule:: qiskit_ibm.visualization
.. automodule:: qiskit_ibm_provider.visualization
:no-members:
:no-inherited-members:
:no-special-members:
18 changes: 9 additions & 9 deletions docs/tutorials/1_the_ibm_quantum_account.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
}
},
"source": [
"from qiskit_ibm import IBMProvider\n",
"from qiskit_ibm_provider import IBMProvider\n",
"\n",
"# IBMProvider.save_account(TOKEN)\n"
]
Expand Down Expand Up @@ -325,7 +325,7 @@
}
],
"source": [
"from qiskit_ibm import least_busy\n",
"from qiskit_ibm_provider import least_busy\n",
"\n",
"small_devices = provider.backends(min_num_qubits=5, simulator=False, operational=True)\n",
"backend = least_busy(small_devices)\n",
Expand Down Expand Up @@ -367,7 +367,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The `qiskit-ibm-provider`'s implementation of `BaseBackend` is [`IBMBackend`](https://qiskit.org/documentation/stubs/qiskit_ibm.IBMBackend.html#qiskit_ibm.IBMBackend). It accepts additional parameters to the `run()` method:\n",
"The `qiskit-ibm-provider`'s implementation of `BaseBackend` is [`IBMBackend`](https://qiskit.org/documentation/stubs/qiskit_ibm_provider.IBMBackend.html#qiskit_ibm_provider.IBMBackend). It accepts additional parameters to the `run()` method:\n",
"\n",
"- `job_name`: Custom name to be assigned to the job.\n",
"- `job_tags`: Tags to be assigned to the job.\n",
Expand All @@ -379,7 +379,7 @@
"- `remaining_jobs_count()`: Returns the number of remaining jobs that could be submitted to the backend.\n",
"- `active_jobs()`: Returns a list of unfinished jobs.\n",
"\n",
"Refer to the [`IBMBackend`](https://qiskit.org/documentation/stubs/qiskit_ibm.IBMBackend.html#qiskit_ibm.IBMBackend) documentation for a complete list of methods."
"Refer to the [`IBMBackend`](https://qiskit.org/documentation/stubs/qiskit_ibm_provider.IBMBackend.html#qiskit_ibm_provider.IBMBackend) documentation for a complete list of methods."
]
},
{
Expand Down Expand Up @@ -798,7 +798,7 @@
"source": [
"### Backend Service\n",
"\n",
"[`IBMBackendService`](https://qiskit.org/documentation/stubs/qiskit_ibm.IBMBackendService.html#qiskit_ibm.IBMBackendService) provides generic backend related services for an account without requiring a particular backend as input. The main methods it supports are:\n",
"[`IBMBackendService`](https://qiskit.org/documentation/stubs/qiskit_ibm_provider.IBMBackendService.html#qiskit_ibm_provider.IBMBackendService) provides generic backend related services for an account without requiring a particular backend as input. The main methods it supports are:\n",
"\n",
"- `jobs()`: Returns a list of previously submitted jobs in the account.\n",
"- `job(JOB_ID)`: Returns a job by its job ID.\n"
Expand Down Expand Up @@ -891,7 +891,7 @@
"- `cancel()`: Cancels the job.\n",
"- `result()`: Gets the results from the circuit run.\n",
"\n",
"Some of the methods that are only available to \"IBM Job\"([`IBMJob`](https://qiskit.org/documentation/stubs/qiskit_ibm.job.IBMJob.html#qiskit_ibm.job.IBMJob)) include:\n",
"Some of the methods that are only available to \"IBM Job\"([`IBMJob`](https://qiskit.org/documentation/stubs/qiskit_ibm_provider.job.IBMJob.html#qiskit_ibm_provider.job.IBMJob)) include:\n",
"\n",
"- `creation_date()`: Gives the date at which the job was created.\n",
"- `queue_info()`: Returns queue information for this job, including queue position, estimated start and end time, and dynamic priorities for the hub, group, and project.\n",
Expand All @@ -900,7 +900,7 @@
"- `properties()`: Returns the backend properties for this job.\n",
"- `time_per_step()`: Returns the time spent for each step (job creation, validation, etc).\n",
"\n",
"Refer to the [`IBMJob`](https://qiskit.org/documentation/stubs/qiskit_ibm.job.IBMJob.html#qiskit_ibm.job.IBMJob) documentation for a complete list of methods."
"Refer to the [`IBMJob`](https://qiskit.org/documentation/stubs/qiskit_ibm_provider.job.IBMJob.html#qiskit_ibm_provider.job.IBMJob) documentation for a complete list of methods."
]
},
{
Expand Down Expand Up @@ -1134,7 +1134,7 @@
"\n",
"`qiskit-ibmq-provider`, which is the predecessor of `qiskit-ibm-provider`, has a convenience function called Job Manager that splits circuits into multiple jobs, if the number exceeds the backend limit. In `qiskit-ibm-provider`, however, this function is now done implicitly by `backend.run()`. \n",
"\n",
"If you submit a list of circuits using `backend.run()`, and the length of the list exceeds the backend limit, you will get back an [`IBMCompositeJob`](https://qiskit.org/documentation/stubs/qiskit_ibm.job.IBMCompositeJob.html) instance. This `IBMCompositeJob` implicitly splits the circuits into multiple sub-jobs and manage them for you. When the sub-jobs are finished, it collects and presents the results in a unified view. The sub-jobs are submitted sequentially, and if `IBMCompositeJob` hits the job limit error* when submitting a sub-job, it will wait for a previous job to finish before trying to submit again.\n",
"If you submit a list of circuits using `backend.run()`, and the length of the list exceeds the backend limit, you will get back an [`IBMCompositeJob`](https://qiskit.org/documentation/stubs/qiskit_ibm_provider.job.IBMCompositeJob.html) instance. This `IBMCompositeJob` implicitly splits the circuits into multiple sub-jobs and manage them for you. When the sub-jobs are finished, it collects and presents the results in a unified view. The sub-jobs are submitted sequentially, and if `IBMCompositeJob` hits the job limit error* when submitting a sub-job, it will wait for a previous job to finish before trying to submit again.\n",
"\n",
"`IBMCompositeJob` is a subclass of `IBMJob`, and you can use it the same way you do with a traditional job. For example, you can continue to use methods like `status()` and `result()` to get the job status and result, respectively. You can also retrieve a previously executed `IBMCompositeJob` using the `provider.backend.job()` and `provider.backend.jobs()` methods, like you would with traditional jobs.\n",
"\n",
Expand Down Expand Up @@ -1411,7 +1411,7 @@
}
],
"source": [
"from qiskit_ibm.version import __version__\n",
"from qiskit_ibm_provider.version import __version__\n",
"print(\"qiskit-ibm-provider version: {}\".format(__version__))"
]
},
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/2_jupyter_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"outputs": [],
"source": [
"from qiskit import *\n",
"from qiskit_ibm import IBMProvider\n",
"import qiskit_ibm.jupyter # This is the where the magic happens (literally)."
"from qiskit_ibm_provider import IBMProvider\n",
"import qiskit_ibm_provider.jupyter # This is the where the magic happens (literally)."
]
},
{
Expand Down Expand Up @@ -181,7 +181,7 @@
},
"outputs": [],
"source": [
"from qiskit_ibm import least_busy\n",
"from qiskit_ibm_provider import least_busy\n",
"backend = least_busy(provider.backends(simulator=False, filters=lambda b: b.configuration().n_qubits >= 5))\n",
"\n",
"qc = QuantumCircuit(2, 2)\n",
Expand Down Expand Up @@ -319,7 +319,7 @@
}
],
"source": [
"from qiskit_ibm.version import __version__\n",
"from qiskit_ibm_provider.version import __version__\n",
"print(\"qiskit-ibm-provider version: {}\".format(__version__))"
]
},
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions qiskit_ibm/__init__.py → qiskit_ibm_provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@

"""
===================================================
IBM Quantum Provider (:mod:`qiskit_ibm`)
IBM Quantum Provider (:mod:`qiskit_ibm_provider`)
===================================================
.. currentmodule:: qiskit_ibm
.. currentmodule:: qiskit_ibm_provider
Modules representing the IBM Quantum Provider.
Logging
=====================
The IBM Quantum Provider uses the ``qiskit_ibm`` logger.
The IBM Quantum Provider uses the ``qiskit_ibm_provider`` logger.
Two environment variables can be used to control the logging:
Expand All @@ -39,7 +39,7 @@
to ``WARNING``::
import logging
logging.getLogger('qiskit_ibm').setLevel(logging.WARNING)
logging.getLogger('qiskit_ibm_provider').setLevel(logging.WARNING)
Functions
=========
Expand Down Expand Up @@ -97,7 +97,7 @@
setup_logger(logger)

# Constants used by the IBM Quantum logger.
QISKIT_IBM_PROVIDER_LOGGER_NAME = 'qiskit_ibm'
QISKIT_IBM_PROVIDER_LOGGER_NAME = 'qiskit_ibm_provider'
"""The name of the IBM Quantum logger."""
QISKIT_IBM_PROVIDER_LOG_LEVEL = 'QISKIT_IBM_PROVIDER_LOG_LEVEL'
"""The environment variable name that is used to set the level for the IBM Quantum logger."""
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from typing import List, Dict, Any, Optional, Union
from datetime import datetime

from qiskit_ibm.apiconstants import API_JOB_FINAL_STATES, ApiJobStatus
from qiskit_ibm.utils.utils import RefreshQueue
from qiskit_ibm.credentials import Credentials
from qiskit_ibm_provider.apiconstants import API_JOB_FINAL_STATES, ApiJobStatus
from qiskit_ibm_provider.utils.utils import RefreshQueue
from qiskit_ibm_provider.credentials import Credentials

from ..exceptions import (RequestsApiError, WebsocketError,
WebsocketTimeoutError, UserTimeoutExceededError)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

from websocket import WebSocketApp, STATUS_NORMAL

from qiskit_ibm.apiconstants import ApiJobStatus, API_JOB_FINAL_STATES
from qiskit_ibm.utils.utils import filter_data
from qiskit_ibm_provider.apiconstants import ApiJobStatus, API_JOB_FINAL_STATES
from qiskit_ibm_provider.utils.utils import filter_data
from ..exceptions import (WebsocketError,
WebsocketIBMProtocolError,
WebsocketAuthenticationError)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import logging
from typing import Dict, Optional, Any, List

from qiskit_ibm.utils.utils import filter_data
from qiskit_ibm_provider.utils.utils import filter_data

from .base import RestAdapterBase
from .backend import Backend
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from typing import Union, Dict, List, Any

from qiskit_ibm.utils import json_encoder
from qiskit_ibm_provider.utils import json_encoder

from .base import RestAdapterBase
from ..session import RetrySession
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from requests.auth import AuthBase
from urllib3.util.retry import Retry

from qiskit_ibm.utils.utils import filter_data
from qiskit_ibm_provider.utils.utils import filter_data

from .exceptions import RequestsApiError
from ..version import __version__ as ibm_provider_version
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

"""
======================================================
Credentials (:mod:`qiskit_ibm.credentials`)
Credentials (:mod:`qiskit_ibm_provider.credentials`)
======================================================
.. currentmodule:: qiskit_ibm.credentials
.. currentmodule:: qiskit_ibm_provider.credentials
Utilities for working with IBM Quantum account credentials.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

from qiskit.providers.backend import BackendV1 as Backend
from qiskit.providers.models import PulseBackendConfiguration, QasmBackendConfiguration
from qiskit_ibm import ibm_provider # pylint: disable=unused-import
from qiskit_ibm.exceptions import IBMInputValueError
from qiskit_ibm_provider import ibm_provider # pylint: disable=unused-import
from qiskit_ibm_provider.exceptions import IBMInputValueError

from .utils.json_decoder import decode_backend_configuration
from .ibm_backend import IBMBackend, IBMSimulator
Expand Down
Loading

0 comments on commit adece22

Please sign in to comment.