Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
dfc79aa
Migrate fake backends from `qiskit.providers.fake_provider` (#1140)
ElePT Nov 16, 2023
5b66120
Fix BYOB job results bytes typing issue (#1220)
kt474 Nov 16, 2023
b778615
Fix fake backends integration test (#1225)
ElePT Nov 17, 2023
0fe20cd
Added deprecation warning when using qiskitrc file (#1219)
merav-aharoni Nov 17, 2023
8fa0472
Update session.from_id() (#1163)
kt474 Nov 17, 2023
5271642
Prepare release 0.15.0 (#1226)
kt474 Nov 17, 2023
2c6c427
Update main branch 0.16.0 (#1227)
kt474 Nov 17, 2023
8205a37
Revert `Session.from_id 0.15.0` changes (#1229)
kt474 Nov 17, 2023
0b64fb0
Prepare release 0.15.1 (#1230)
kt474 Nov 17, 2023
c8eb7c9
Update main branch to 0.16.0 again (#1232)
kt474 Nov 17, 2023
ea7872b
Remove all code related to custom programs (#1192)
kt474 Nov 28, 2023
0902c98
Make sessions thread safe (#1196)
delapuente Nov 28, 2023
fb8732d
Instance & channel_strategy validation (#1233)
kt474 Nov 28, 2023
ef06c1a
Prepare release 0.16.1 (#1239)
jyu00 Nov 28, 2023
8f23c9d
update to 0.17 (#1240)
jyu00 Nov 28, 2023
a9350ac
Stop referring to qiskit.org in API docs (#1242)
Eric-Arellano Nov 28, 2023
af432b7
Add job.properties() method (#1252)
kt474 Dec 4, 2023
a618de6
Remove non-API docs and translations (#1256)
Eric-Arellano Dec 4, 2023
5010416
Raise error if backend retrieved not in current instance (#1249)
kt474 Dec 5, 2023
6cb18d0
Fix backend_converter `faulty_qubit` name error (#1257)
kt474 Dec 5, 2023
d0600cb
Update Tutorial section names (#1241)
pandasa123 Dec 5, 2023
e9faa57
make test_backend_wrong_instance IQP only (#1258)
kt474 Dec 5, 2023
40b3076
Add pointer to qiskit/documentation issues (#1260)
abbycross Dec 5, 2023
b264bf1
Update `test_backend_wrong_instance` (#1259)
kt474 Dec 5, 2023
f2e24e4
Don't block for the first job in a session (#1170)
kt474 Dec 6, 2023
f36b2a9
Add `activated_at` field to session.details() (#1266)
kt474 Dec 7, 2023
0f9cc6f
Revert "Don't block for the first job in a session (#1170)" (#1267)
kt474 Dec 7, 2023
b849c70
Prepare release 0.17.0 (#1268)
kt474 Dec 8, 2023
517694a
update main branch 0.17.1 (#1269)
kt474 Dec 8, 2023
4d06ac3
Remove test_session_no_backend (#1272)
kt474 Dec 10, 2023
dfc0fe8
Added RuntimeJob.queue_info() method (#1210)
merav-aharoni Dec 11, 2023
7173af8
Replace programs with primitives in api docs (#1281)
kt474 Dec 14, 2023
bdbbade
Deprecate service.runtime (#1278)
kt474 Dec 18, 2023
91c5a58
Removed support for qiskitrc file (#1121)
merav-aharoni Dec 18, 2023
a1f36b4
Add max_time parameter to IBMBackend.open_session() (#1274)
merav-aharoni Dec 20, 2023
86c41e0
Migrate fake backend base classes (#1270)
ElePT Dec 20, 2023
e57edb3
Add Q-CTRL integration tests (#1173)
kt474 Dec 20, 2023
9abe0c1
update grover tutorial equation (#1293)
kt474 Jan 2, 2024
2d0d5eb
Add dynamic circuits backend filter (#1291)
kt474 Jan 2, 2024
f3dbad0
switch docs from mathjax to katex (#1301)
kevinsung Jan 2, 2024
e9aa596
Remove qiskit.org links (#1302)
kt474 Jan 3, 2024
005aa9b
Update session_id docstring (#1304)
kt474 Jan 4, 2024
781295b
Update provider and qiskit versions (#1305)
kt474 Jan 8, 2024
872e391
Exclude params on job retrieval by default (#1308)
kt474 Jan 10, 2024
7fad461
Reactive the viewcode extension for docs (#1312)
Eric-Arellano Jan 12, 2024
bde88f8
Add config files to manifest (#1319)
ElePT Jan 17, 2024
542ab18
Fix pip environment resolution (#1329)
jakelishman Jan 22, 2024
8723ccf
Use IBM-Provider-vendored pub/sub mechanism (#1328)
jakelishman Jan 22, 2024
385e10e
Add transpiler tests (#1323)
kt474 Jan 25, 2024
c1453f4
Prepare release 0.18.0 (#1335)
kt474 Jan 25, 2024
3de8e82
Update main branch 0.18.1 (#1336)
kt474 Jan 25, 2024
786b494
Turn off qiskit.org docs deploy (#1340)
Eric-Arellano Jan 26, 2024
6365dd9
Remove `qiskit.test` (#1292)
kt474 Jan 29, 2024
6c2cf0e
Add missing API Refs to docs (#1343)
kaelynj Jan 29, 2024
4074347
Set use_symengine on qpy generation if symengine is installed (#1355)
mtreinish Jan 31, 2024
959b9ae
Fix for unit tests (#1356)
dieris Jan 31, 2024
d4d55e5
Update flaky integration tests (#1359)
kt474 Jan 31, 2024
9cf11bd
Fix bad Sphinx API doc Provider naming (#1360)
Eric-Arellano Jan 31, 2024
481725b
Merge qiskit-ibm-provider into qiskit-ibm-runtime (#1285)
kt474 Feb 1, 2024
5bc3b42
Update invalid token test (#1367)
kt474 Feb 1, 2024
bbfcb4f
Copy pub/sub code into qiskit-ibm-runtime (#1349)
kt474 Feb 1, 2024
7789fb3
Remove mthree from requirements-dev (#1370)
kt474 Feb 2, 2024
f4d2853
Handle Qiskit 1.0 removals (#1363)
kt474 Feb 5, 2024
bf33ce8
Copy over provider session & remove qiskit-ibm-provider (#1368)
kt474 Feb 5, 2024
482a9f0
Handle qpy serialization across versions and delete vendored fork (#1…
mtreinish Feb 5, 2024
2fb0252
Run integration tests against Qiskit main (#1376)
kt474 Feb 5, 2024
7f93470
Fix qiskit main integratino tests cron job (#1379)
kt474 Feb 5, 2024
bd7885c
Prepare release 0.19.0 (#1380)
kt474 Feb 6, 2024
bf608bd
Update main branch version 0.19.1 (#1382)
kt474 Feb 6, 2024
a78c5ed
Porting qiskit-ibm-provider/787: Fix `DynamicCircuitInstructionDurati…
1ucian0 Feb 6, 2024
7890170
Cast use_symengine input to a bool (#1385)
mtreinish Feb 7, 2024
72ed540
Prepare release 0.19.1 (#1386)
kt474 Feb 7, 2024
7548cfa
Update main branch version 0.19.2 (#1388)
kt474 Feb 7, 2024
26c4e26
Merge branch 'main' of https://github.com/Qiskit/qiskit-ibm-runtime i…
jyu00 Feb 7, 2024
e5ab415
fix import issues
jyu00 Feb 7, 2024
f8aa1cc
more import issues
jyu00 Feb 7, 2024
c977bec
disable docs warning
jyu00 Feb 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/integration-tests-qiskit-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2024.
#
# 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.

name: Integration Tests (Qiskit Main)
on:
schedule:
# run integration tests against Qiskit main once a week
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
integration-tests:
if: github.repository_owner == 'Qiskit'
name: Run integration tests - ${{ matrix.environment }}
runs-on: ${{ matrix.os }}
strategy:
# avoid cancellation of in-progress jobs if any matrix job fails
fail-fast: false
matrix:
python-version: [ 3.9 ]
os: [ "ubuntu-latest" ]
environment: [ "ibm-quantum-production", "ibm-quantum-staging", "ibm-cloud-production", "ibm-cloud-staging" ]
environment: ${{ matrix.environment }}
env:
QISKIT_IBM_TOKEN: ${{ secrets.QISKIT_IBM_TOKEN }}
QISKIT_IBM_URL: ${{ secrets.QISKIT_IBM_URL }}
QISKIT_IBM_INSTANCE: ${{ secrets.QISKIT_IBM_INSTANCE }}
LOG_LEVEL: DEBUG
STREAM_LOG: True
QISKIT_IN_PARALLEL: True
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -r requirements-dev.txt -e . git+https://github.com/Qiskit/qiskit.git
- name: Run integration tests
run: make integration-test
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ function-naming-style=snake_case
good-names=i,
j,
k,
dt,
ex,
Run,
_
Expand Down
4 changes: 4 additions & 0 deletions docs/apidocs/fake_provider.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. automodule:: qiskit_ibm_runtime.fake_provider
:no-members:
:no-inherited-members:
:no-special-members:
2 changes: 2 additions & 0 deletions docs/apidocs/ibm-runtime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ qiskit-ibm-runtime API reference

runtime_service
options
transpiler
fake_provider
4 changes: 4 additions & 0 deletions docs/apidocs/transpiler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. automodule:: qiskit_ibm_runtime.transpiler
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
docs_url_prefix = "ecosystem/ibm-runtime"
release = '0.18.1'
release = '0.19.2'

# -- General configuration ---------------------------------------------------

Expand All @@ -41,6 +40,7 @@
'reno.sphinxext',
'nbsphinx',
'sphinxcontrib.katex',
'matplotlib.sphinxext.plot_directive',
]
templates_path = ['_templates']

Expand Down
Empty file.
2 changes: 1 addition & 1 deletion qiskit_ibm_runtime/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.18.1
0.19.2
4 changes: 2 additions & 2 deletions qiskit_ibm_runtime/accounts/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from urllib.parse import urlparse

from requests.auth import AuthBase
from qiskit_ibm_provider.proxies import ProxyConfiguration
from qiskit_ibm_provider.utils.hgp import from_instance_format
from ..proxies import ProxyConfiguration
from ..utils.hgp import from_instance_format

from .exceptions import InvalidAccountError, CloudResourceNameResolutionError
from ..api.auth import QuantumAuth, CloudAuth
Expand Down
3 changes: 1 addition & 2 deletions qiskit_ibm_runtime/accounts/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
import os
from typing import Optional, Dict

from qiskit_ibm_provider.proxies import ProxyConfiguration

from ..proxies import ProxyConfiguration
from .exceptions import AccountNotFoundError
from .account import Account, ChannelType
from .storage import save_config, read_config, delete_config
Expand Down
2 changes: 1 addition & 1 deletion qiskit_ibm_runtime/api/client_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""Represent IBM Quantum account client parameters."""

from typing import Dict, Optional, Any, Union
from qiskit_ibm_provider.proxies import ProxyConfiguration
from ..proxies import ProxyConfiguration

from ..utils import get_runtime_api_base_url
from ..api.auth import QuantumAuth, CloudAuth
Expand Down
8 changes: 4 additions & 4 deletions qiskit_ibm_runtime/api/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

"""IBM Quantum API clients."""

from qiskit_ibm_provider.api.clients.base import BaseClient, WebsocketClientCloseCode
from qiskit_ibm_provider.api.clients.auth import AuthClient
from qiskit_ibm_provider.api.clients.version import VersionClient
from qiskit_ibm_provider.api.clients.runtime_ws import RuntimeWebsocketClient
from .base_websocket_client import WebsocketClientCloseCode
from .auth import AuthClient
from .version import VersionClient
from .runtime_ws import RuntimeWebsocketClient
from .runtime import RuntimeClient
172 changes: 172 additions & 0 deletions qiskit_ibm_runtime/api/clients/auth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# 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 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.

"""Client for accessing IBM Quantum authentication services."""

from typing import Dict, List, Optional, Any, Union
from requests.exceptions import RequestException

from ..auth import QuantumAuth
from ..exceptions import AuthenticationLicenseError, RequestsApiError
from ..rest import Api
from ..session import RetrySession
from ..client_parameters import ClientParameters


class AuthClient:
"""Client for accessing IBM Quantum authentication services."""

def __init__(self, client_params: ClientParameters) -> None:
"""AuthClient constructor.

Args:
client_params: Parameters used for server connection.
"""
self.api_token = client_params.token
self.auth_url = client_params.url
self._service_urls = {} # type: ignore[var-annotated]

self.auth_api = Api(RetrySession(self.auth_url, **client_params.connection_parameters()))
self.base_api = self._init_service_clients(**client_params.connection_parameters())

def _init_service_clients(self, **request_kwargs: Any) -> Api:
"""Initialize the clients used for communicating with the API.

Args:
**request_kwargs: Arguments for the request ``Session``.

Returns:
Client for the API server.
"""
# Request an access token.
self.access_token = self._request_access_token()
self.auth_api.session.auth = QuantumAuth(access_token=self.access_token)
self._service_urls = self.user_urls()

# Create the api server client, using the access token.
base_api = Api(
RetrySession(
self._service_urls["http"],
auth=QuantumAuth(access_token=self.access_token),
**request_kwargs,
)
)

return base_api

def _request_access_token(self) -> str:
"""Request a new access token from the API authentication service.

Returns:
A new access token.

Raises:
AuthenticationLicenseError: If the user hasn't accepted the license agreement.
RequestsApiError: If the request failed.
"""
try:
response = self.auth_api.login(self.api_token)
return response["id"]
except RequestsApiError as ex:
# Get the original exception that raised.
original_exception = ex.__cause__

if isinstance(original_exception, RequestException):
# Get the response from the original request exception.
error_response = (
# pylint: disable=no-member
original_exception.response
)
if error_response is not None and error_response.status_code == 401:
try:
error_code = error_response.json()["error"]["name"]
if error_code == "ACCEPT_LICENSE_REQUIRED":
message = error_response.json()["error"]["message"]
raise AuthenticationLicenseError(message)
except (ValueError, KeyError):
# the response did not contain the expected json.
pass
raise

# User account-related public functions.

def user_urls(self) -> Dict[str, str]:
"""Retrieve the API URLs from the authentication service.

Returns:
A dict with the base URLs for the services. Currently
supported keys are:

* ``http``: The API URL for HTTP communication.
* ``ws``: The API URL for websocket communication.
* ``services`: The API URL for additional services.
"""
response = self.auth_api.user_info()
return response["urls"]

def user_hubs(self) -> List[Dict[str, str]]:
"""Retrieve the hub/group/project sets available to the user.

The first entry in the list will be the default set, as indicated by
the ``isDefault`` field from the API.

Returns:
A list of dictionaries with the hub, group, and project values keyed by
``hub``, ``group``, and ``project``, respectively.
"""
response = self.base_api.hubs()

hubs = [] # type: ignore[var-annotated]
for hub in response:
hub_name = hub["name"]
for group_name, group in hub["groups"].items():
for project_name, project in group["projects"].items():
entry = {
"hub": hub_name,
"group": group_name,
"project": project_name,
}

# Move to the top if it is the default h/g/p.
if project.get("isDefault"):
hubs.insert(0, entry)
else:
hubs.append(entry)

return hubs

# Miscellaneous public functions.

def api_version(self) -> Dict[str, Union[str, bool]]:
"""Return the version of the API.

Returns:
API version.
"""
return self.base_api.version()

def current_access_token(self) -> Optional[str]:
"""Return the current access token.

Returns:
The access token in use.
"""
return self.access_token

def current_service_urls(self) -> Dict:
"""Return the current service URLs.

Returns:
A dict with the base URLs for the services, in the same
format as :meth:`user_urls()`.
"""
return self._service_urls
4 changes: 1 addition & 3 deletions qiskit_ibm_runtime/api/clients/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
from datetime import datetime as python_datetime
from abc import ABC, abstractmethod

from qiskit_ibm_provider.api.clients.base import BaseClient

logger = logging.getLogger(__name__)


class BaseBackendClient(BaseClient, ABC):
class BaseBackendClient(ABC):
"""Client for accessing backend information."""

@abstractmethod
Expand Down
Loading