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

Commit

Permalink
Merge branch 'master' of github.com:Qiskit/qiskit-ibmq-provider into …
Browse files Browse the repository at this point in the history
…stable
  • Loading branch information
diego-plan9 committed Nov 12, 2019
2 parents 46f59e4 + fb12be4 commit 32a5d0f
Show file tree
Hide file tree
Showing 99 changed files with 5,874 additions and 4,678 deletions.
27 changes: 8 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ stage_osx: &stage_osx
stages:
- lint and pure python test
- test
- old api
- slow tests

# Define the job matrix explicitly, as matrix expansion causes issues when
Expand All @@ -96,6 +95,13 @@ jobs:
if: type != cron
script: make style && make lint

# Type checking using mypy
- stage: lint and pure python test
name: mypy type checking
<<: *stage_linux
if: type != cron
script: make mypy

# Run the tests against without compilation (GNU/Linux, Python 3.5)
- stage: lint and pure python test
<<: *stage_linux
Expand Down Expand Up @@ -146,24 +152,6 @@ jobs:
- MPLBACKEND=ps
- PYTHON_VERSION=3.7.2

# "old api" stage
###########################################################################
# GNU/Linux, Python 3.6, against Qconsole v1
- stage: old api
name: Python 3.6 API v1 QConsole
<<: *stage_linux
if: branch = master and repo = Qiskit/qiskit-ibmq-provider and type = push
python: 3.6
env: USE_ALTERNATE_ENV_CREDENTIALS=True

# GNU/Linux, Python 3.6, against QE v1
- stage: old api
name: Python 3.6 API v1 QE
<<: *stage_linux
if: branch = master and repo = Qiskit/qiskit-ibmq-provider and type = push
python: 3.6
env: QE_URL="https://quantumexperience.ng.bluemix.net/api"

# "slow tests" stage
###########################################################################
# GNU/Linux, Python 3.5
Expand All @@ -176,6 +164,7 @@ jobs:
# effectively increases timeout to 2h.
- travis_wait 120 make test
- if: tag IS present
language: python
python: "3.6"
env:
- TWINE_USERNAME=qiskit
Expand Down
60 changes: 59 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,63 @@ The format is based on [Keep a Changelog].
> - **Security**: in case of vulnerabilities.

## [0.4.0] - 2019-11-12

### Added

- A new `IBMQJobManager` class that takes a list of circuits or pulse schedules
as input, splits them into one or more jobs, and submits the jobs.
(\#389, \#400, \#407)
- New features to `provider.backends`:
- it contains the available backends as attributes. A user can now use
`provider.backends.<tab>` to see a list of backend names, and make
use of the attributes as regular `IBMQBackend` instances. (\#303)
- the methods `provider.backends.jobs()` and
`provider.backends.retrieve_job()` can be used for retrieving
provider-wide jobs. (\#354)

### Changed

- `IBMQBackend.run()` now accepts an optional `job_name` parameter. If
specified, the `job_name` is assigned to the job, which can also be used
as a filter in `IBMQBackend.jobs()`. (\#300, \#384)
- `IBMQBackend.run()` now accepts an optional `job_share_level`
parameter. If specified, the job could be shared with other users at the
global, hub, group, project, or none level. (\#414)
- The signature of `IBMQBackend.jobs()` is changed. `db_filter`, which was the
4th parameter, is now the 5th parameter. (\#300)
- The `backend.properties()` function now accepts an optional `datetime`
parameter. If specified, the function returns the backend properties closest
to, but older than, the specified datetime filter. (\#277)
- The `WebsocketClient.get_job_status()` method now accepts two optional
parameters: `retries` and `backoff_factor`. (\#341)
- The `IBMQJob` class has been refactored:
- The `IBMQJob` attributes are now automatically populated based on the
information contained in the remote API. As a result, the `IBMQJob`
constructor signature has changed. (\#329)
- `IBMQJob.submit()` can no longer be called directly, and jobs are expected
to be submitted via `IBMQBackend.run()`. (\#329)
- `IBMQJob.error_message()` now gives more information on why a job failed.
(\#375)
- `IBMQJob.queue_position()` now accepts an optional `refresh` parameter that
indicates whether it should query the API for the latest queue position.
(\#387)
- The `IBMQJob.result()` function now accepts an optional `partial` parameter.
If specified, `IBMQJob.result()` will return partial results for jobs with
experiments that failed. (\#399)
- The Exception hierarchy has been refined with more specialized classes, and
exception chaining is used in some cases - please inspect the complete
traceback for more informative failures. (\#395, \#396)
- Some `warnings` have been toned down to `logger.warning` messages. (\#379)

### Removed

- Support for the legacy Quantum Experience and QConsole is fully deprecated.
Only credentials from the new Quantum Experience can be used. (\#344)
- The circuits functionality has been temporarily removed from the provider. It
will be reintroduced in future versions. (\#429)


## [0.3.3] - 2019-09-30

### Fixed
Expand Down Expand Up @@ -157,7 +214,8 @@ The format is based on [Keep a Changelog].
- Support for non-qobj format has been removed. (\#26, \#28)


[UNRELEASED]: https://github.com/Qiskit/qiskit-ibmq-provider/compare/0.3.3...HEAD
[UNRELEASED]: https://github.com/Qiskit/qiskit-ibmq-provider/compare/0.4.0...HEAD
[0.4.0]: https://github.com/Qiskit/qiskit-ibmq-provider/compare/0.3.3...0.4.0
[0.3.3]: https://github.com/Qiskit/qiskit-ibmq-provider/compare/0.3.2...0.3.3
[0.3.2]: https://github.com/Qiskit/qiskit-ibmq-provider/compare/0.3.1...0.3.2
[0.3.1]: https://github.com/Qiskit/qiskit-ibmq-provider/compare/0.3.0...0.3.1
Expand Down
12 changes: 8 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,21 @@ The order of precedence in the options is right to left. For example,
### Style guide

Please submit clean code and please make effort to follow existing
conventions in order to keep it as readable as possible. We use
[Pylint](https://www.pylint.org) and [PEP
8](https://www.python.org/dev/peps/pep-0008) style guide: to ensure your
changes respect the style guidelines, run the next commands:
conventions in order to keep it as readable as possible. We use:
* [Pylint](https://www.pylint.org) linter
* [PEP 8](https://www.python.org/dev/peps/pep-0008) style
* [mypy](http://mypy-lang.org/) type hinting

To ensure your changes respect the style guidelines, you can run the following
commands:

All platforms:

``` {.sh}
$> cd out
out$> make lint
out$> make style
out$> make mypy
```

Development cycle
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include LICENSE.txt README.md
include qiskit/providers/ibmq/VERSION.txt
recursive-include test *.py
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
# that they have been altered from the originals.


.PHONY: lint style test
.PHONY: lint style test mypy

lint:
pylint -rn qiskit/providers/ibmq test

mypy:
mypy --module qiskit.providers.ibmq

style:
pycodestyle --max-line-length=100 qiskit test
pycodestyle qiskit test

test:
python -m unittest -v
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

[![License](https://img.shields.io/github/license/Qiskit/qiskit-ibmq-provider.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)[![Build Status](https://img.shields.io/travis/com/Qiskit/qiskit-ibmq-provider/master.svg?style=popout-square)](https://travis-ci.com/Qiskit/qiskit-ibmq-provider)[![](https://img.shields.io/github/release/Qiskit/qiskit-ibmq-provider.svg?style=popout-square)](https://github.com/Qiskit/qiskit-ibmq-provider/releases)[![](https://img.shields.io/pypi/dm/qiskit-ibmq-provider.svg?style=popout-square)](https://pypi.org/project/qiskit-ibmq-provider/)

Qiskit is an open-source framework for working with noisy intermediate-scale
quantum computers (NISQ) at the level of pulses, circuits, and algorithms.
**Qiskit** is an open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms.

This module contains a provider that allows accessing the **[IBM Q]** quantum
devices and simulators.
Expand All @@ -27,11 +26,11 @@ To install from source, follow the instructions in the

Once the package is installed, you can access the provider from Qiskit.

> **Note**: Since July 2019 (and with version `0.3` of this
> `qiskit-ibmq-provider` package / version `0.11` of the `qiskit` package),
> using the new IBM Q Experience (v2) is the default behavior. If you have
> been using an account for the legacy Quantum Experience or QConsole (v1),
> please check the [update instructions](#updating-to-the-new-IBM-Q-Experience).
> **Note**: Since November 2019 (and with version `0.4` of this
> `qiskit-ibmq-provider` package / version `0.14` of the `qiskit` package)
> legacy Quantum Experience or QConsole (v1) accounts are no longer supported.
> If you are still using a v1 account, please follow the steps described in
> [update instructions](#updating-to-the-new-IBM-Q-Experience) to update your account.
### Configure your IBMQ credentials

Expand All @@ -58,7 +57,7 @@ in your program simply via:
from qiskit import IBMQ

provider = IBMQ.load_account()
provider.get_backend('ibmq_qasm_simulator')
backend = provider.get_backend('ibmq_qasm_simulator')
```

Alternatively, if you do not want to save your credentials to disk and only
Expand All @@ -68,7 +67,7 @@ intend to use them during the current session, you can use:
from qiskit import IBMQ

provider = IBMQ.enable_account('MY_API_TOKEN')
provider.get_backend('ibmq_qasm_simulator')
backend = provider.get_backend('ibmq_qasm_simulator')
```

By default, all IBM Q accounts have access to the same, open project
Expand All @@ -82,17 +81,17 @@ provider_2 = IBMQ.get_provider(hub='MY_HUB', group='MY_GROUP', project='MY_PROJE

## Updating to the new IBM Q Experience

Since July 2019 (and with version `0.3` of this `qiskit-ibmq-provider` package),
the IBMQProvider defaults to using the new [IBM Q Experience], which supersedes
the legacy Quantum Experience and Qconsole. The new IBM Q Experience is also
referred as `v2`, whereas the legacy one and Qconsole as `v1`.
Since November 2019 (and with version `0.4` of this `qiskit-ibmq-provider`
package), the IBMQProvider only supports the new [IBM Q Experience], dropping
support for the legacy Quantum Experience and Qconsole accounts. The new IBM Q
Experience is also referred as `v2`, whereas the legacy one and Qconsole as `v1`.

This section includes instructions for updating your accounts and programs.
Please note that:
* the IBM Q Experience `v1` credentials and the programs written for pre-0.3
versions will still be working during the `0.3.x` series. It is not
mandatory to update your accounts and programs, but recommended in order
to take advantage of the new features.
versions will still be working during the `0.3.x` series. From 0.4 onwards,
only `v2` credentials are supported, and it is recommended to upgrade
in order to take advantage of the new features.
* updating your credentials to the IBM Q Experience `v2` implies that you
will need to update your programs. The sections below contain instructions
on how to perform the transition.
Expand Down Expand Up @@ -135,9 +134,8 @@ in the [IBM Q Experience account page].

### Updating your programs

With the introduction of support for the new IBM Q Experience support, a more
structured approach for accessing backends has been introduced. Previously,
access to all backends was centralized through:
The new IBM Q Experience support also introduces a more structured approach for accessing backends.
Previously, access to all backends was centralized through:

```python
IBMQ.backends()
Expand Down
28 changes: 28 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 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 derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
25 changes: 25 additions & 0 deletions docs/apidocs/ibmq.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. _qiskit-providers-ibmq:

*************************
qiskit.providers.ibmq
*************************

.. currentmodule:: qiskit.providers.ibmq

.. autofunction:: least_busy

.. automodapi:: qiskit.providers
:no-heading:
:no-inheritance-diagram:
:no-inherited-members:


Submodules
==========

.. toctree::
:maxdepth: 1

ibmqfactory
ibmqprovider
ibmqbackend
10 changes: 10 additions & 0 deletions docs/apidocs/ibmqbackend.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _qiskit-providers-ibmq-ibmqbackend:

***********************************
qiskit.providers.ibmq.ibmqbackend
***********************************

.. currentmodule:: qiskit.providers.ibmq.ibmqbackend

.. autoclass:: IBMQBackend
:members:
10 changes: 10 additions & 0 deletions docs/apidocs/ibmqfactory.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _qiskit-providers-ibmq-ibmqfactory:

*********************************
qiskit.providers.ibmq.ibmqfactory
*********************************

.. currentmodule:: qiskit.providers.ibmq.ibmqfactory

.. autoclass:: IBMQFactory
:members:
10 changes: 10 additions & 0 deletions docs/apidocs/ibmqprovider.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _qiskit-providers-ibmq-ibmqprovider:

***********************************
qiskit.providers.ibmq.ibmqprovider
***********************************

.. currentmodule:: qiskit.providers.ibmq.ibmqprovider

.. autoclass:: IBMQProvider
:members:
Loading

0 comments on commit 32a5d0f

Please sign in to comment.