Skip to content

Commit 852479b

Browse files
jyu00ElePTkt474merav-aharonidelapuente
authored
Fast forward experimental-0.2 (#1389)
* Migrate fake backends from `qiskit.providers.fake_provider` (#1140) * Migrate fake provider * fix lint * Only migrate backends and fake_provider file to minimize duplication * Add reno * Update snippet to use runtime service --------- Co-authored-by: Kevin Tian <[email protected]> * Fix BYOB job results bytes typing issue (#1220) * try/except raw result truncation * catch typeError * revert try/except, use response.text * update unit test * Fix fake backends integration test (#1225) * Clean up/fix integration test * Update test case * Fix black * Added deprecation warning when using qiskitrc file (#1219) * Added deprecation warning when using qiskitrc file * Fixed bug whereby deprecation warnings cause failure for all 'qiskit*' modules. Changed warning to deprecation warning. * Release note * Small grammer fix * black --------- Co-authored-by: Kevin Tian <[email protected]> * Update session.from_id() (#1163) * update session.from_id() * add deprecation warning * add reno * Prepare release 0.15.0 (#1226) * Update main branch 0.16.0 (#1227) * Revert `Session.from_id 0.15.0` changes (#1229) * Revert "Update session.from_id() (#1163)" This reverts commit 8fa0472. * add reno * Prepare release 0.15.1 (#1230) * Update main branch to 0.16.0 again (#1232) * Remove all code related to custom programs (#1192) * initial removal * cleanup more files * move result_decoder * fix lint * update unit tests * update integration tests * more docs changes * release note * fix path --------- Co-authored-by: Jessie Yu <[email protected]> * Make sessions thread safe (#1196) * Make sessions thread safe. The lock prevents other threads from sending new jobs to the service only if the session hasnot been setup yet. I.e.: when sending the first "session starter job", or root job. After this happens, the code is left unlocked to allow threads to access the service concurrently. Error handling is needed to ensure the lock is always released. * Allow multiple sessions to execute simultaneously * Make session test more deterministic --------- Co-authored-by: Kevin Tian <[email protected]> Co-authored-by: Jessie Yu <[email protected]> * Instance & channel_strategy validation (#1233) * compare cloud instance with channel strategy * fix unit tests * error wording --------- Co-authored-by: Jessie Yu <[email protected]> * Prepare release 0.16.1 (#1239) * release notes * fix release * update to 0.17 (#1240) * Stop referring to qiskit.org in API docs (#1242) * Add job.properties() method (#1252) * Add job.properties() method * add reno * Remove non-API docs and translations (#1256) This is the same as Qiskit/qiskit#11352. Now that qiskit.org/ecosystem/ibm-runtime redirects to docs.quantum.ibm.com, we can simplify the docs. See the PR description in Qiskit/qiskit#11352 for details on the motivation for each change. The only difference from Qiskit is that we still keep the tutorials around because learning.quantum.ibm.com uses them. I used a script with `ripgrep` to confirm that none of the images were in use. * Raise error if backend retrieved not in current instance (#1249) * Error if backend not in instance * add reno * update reno * docs build * fix docs again * docs formatting :/ * add integration test * Update test/integration/test_backend.py Co-authored-by: merav-aharoni <[email protected]> * Update test/integration/test_backend.py Co-authored-by: merav-aharoni <[email protected]> --------- Co-authored-by: merav-aharoni <[email protected]> * Fix backend_converter `faulty_qubit` name error (#1257) * fix backend_converter * add reno * Update Tutorial section names (#1241) * The transpilation tutorial has been updated to use the new runtime transpilation passes, and Batch * Fix style checker * Updated names * Updated section names for transpiled tutorial * Updated grover * Fixed consistency * Final updates --------- Co-authored-by: Kevin Tian <[email protected]> * make test_backend_wrong_instance IQP only (#1258) * Add pointer to qiskit/documentation issues (#1260) * add pointer to qiskit/documentation issues * Update .github/ISSUE_TEMPLATE/config.yml Co-authored-by: Eric Arellano <[email protected]> * Update CONTRIBUTING.md Co-authored-by: Eric Arellano <[email protected]> --------- Co-authored-by: Kevin Tian <[email protected]> Co-authored-by: Eric Arellano <[email protected]> * Update `test_backend_wrong_instance` (#1259) * wip debug wrong instance test * enable integration test * use backend names instead of obj * Don't block for the first job in a session (#1170) * don't block if backend not selected * add reno * add test * Add `activated_at` field to session.details() (#1266) * add activated_at to session.details() * add reno * Revert "Don't block for the first job in a session (#1170)" (#1267) * Revert "Don't block for the first job in a session (#1170)" This reverts commit f2e24e4. * keep test * Prepare release 0.17.0 (#1268) * update main branch 0.17.1 (#1269) * Remove test_session_no_backend (#1272) * Added RuntimeJob.queue_info() method (#1210) * Added support for RuntimeJob.queueinfo * Moved methods for consistency with main * Changed backend_status to job.status * lint * update test --------- Co-authored-by: Kevin Tian <[email protected]> * Replace programs with primitives in api docs (#1281) * programs -> primitives * address comment * Deprecate service.runtime (#1278) * Deprecate service.runtime * add reno * Removed support for qiskitrc file (#1121) * Removed support for qiskitrc file * lint --------- Co-authored-by: Kevin Tian <[email protected]> * Add max_time parameter to IBMBackend.open_session() (#1274) * Added max_time to IBMBackend.open_session. * Release note * Changed format of test * Migrate fake backend base classes (#1270) Co-authored-by: Kevin Tian <[email protected]> * Add Q-CTRL integration tests (#1173) * add initial qctrl test file * add test & decorator * add tests from Mirko * Added assertness for preciseness of results * remove print statements * move into e2e folder * setup ci * Update q-ctrl-tests.yml * add account test * add more account tests * Update test/qctrl/test_qctrl.py Co-authored-by: Rathish Cholarajan <[email protected]> * address comments * update date to 2023 * Update test/qctrl/test_qctrl.py Co-authored-by: Blake Johnson <[email protected]> * Update test/qctrl/test_qctrl.py Co-authored-by: Blake Johnson <[email protected]> --------- Co-authored-by: merav-aharoni <[email protected]> Co-authored-by: Rathish Cholarajan <[email protected]> Co-authored-by: Blake Johnson <[email protected]> * update grover tutorial equation (#1293) * Add dynamic circuits backend filter (#1291) * Add dynamic circuits backend filter * add reno * switch docs from mathjax to katex (#1301) Updates the sphinx documentation build to use KaTeX instead of MathJax because the final docs build uses KaTeX. The same change was made in Qiskit in Qiskit/qiskit#11435. * Remove qiskit.org links (#1302) * Update session_id docstring (#1304) * Update provider and qiskit versions (#1305) * Exclude params on job retrieval by default (#1308) * exclude params on job retrieval by default * add reno * add test * Reactive the viewcode extension for docs (#1312) We got source links working in API docs on docs.quantum.ibm.com! See Qiskit/documentation#620. To do this, we need to active `sphinx.ext.viewcode`. Note that we still plan to improve this implementation in the future to have more precise links by using `sphinx.ext.linkcode`, tracked by Qiskit/documentation#517. This PR is to unblock the first iteration of this source links mechanism. * Add config files to manifest (#1319) * Fix pip environment resolution (#1329) Calling `pip install` multiple times can (deeply unfortunately) allow an environment to become out-of-sync; `pip` doesn't "remember" the constraints of previous installation commands. One of the largest effects here is that doing `pip install -e .` _followed_ by `pip install git+<qiskit>@main` installs `qiskit-terra` from the initial installation (via `qiskit==0.45.2`), then installs `qiskit==1.0.0.dev0` from Git, which is an incompatible environment. Doing the whole environment resolution in a single `pip install` command fixes this, as the `qiskit` dependency is correctly resolved to be _only_ the `1.0.0.dev0` version. Co-authored-by: Kevin Tian <[email protected]> * Use IBM-Provider-vendored pub/sub mechanism (#1328) This is being removed from Qiskit 1.0, and the IBM Provider is (until deprecated) taking over brokering the IBM-Runtime-internal events. Co-authored-by: Kevin Tian <[email protected]> * Add transpiler tests (#1323) * Add transpiler tests * remove qiskittestcase * Prepare release 0.18.0 (#1335) * Update main branch 0.18.1 (#1336) * Turn off qiskit.org docs deploy (#1340) * Remove `qiskit.test` (#1292) * replace qiskit.test.ReferenceCircuits * replace BaseQiskitTest * Update qiskit_ibm_runtime/qiskit_runtime_service.py Co-authored-by: Jessie Yu <[email protected]> * Update qiskit_ibm_runtime/sampler.py Co-authored-by: Jessie Yu <[email protected]> * Update qiskit_ibm_runtime/session.py Co-authored-by: Jessie Yu <[email protected]> * Update test/utils.py Co-authored-by: Jessie Yu <[email protected]> --------- Co-authored-by: Jessie Yu <[email protected]> * Add missing API Refs to docs (#1343) ### Summary The documentation from the `transpile` and `fake_provider` modules does not appear in the rendered docs in qiskit.org/documentation or docs.quantum-computing.ibm.com. ### Details and comments Fixes [Qiskit Docs Issue #238](Qiskit/documentation#238) Replaces PR #1330. Transpiler Doc files added: - qiskit_ibm_runtime.transpiler.passes.html - qiskit_ibm_provider.transpiler.passes.basis.html - qiskit_ibm_provider.transpiler.passes.scheduling.ALAPScheduleAnalysis.html - qiskit_ibm_provider.transpiler.passes.scheduling.ASAPScheduleAnalysis.html - qiskit_ibm_provider.transpiler.passes.scheduling.BlockBasePadder.html - qiskit_ibm_provider.transpiler.passes.scheduling.DynamicCircuitInstructionDurations.html - qiskit_ibm_provider.transpiler.passes.scheduling.html - qiskit_ibm_provider.transpiler.passes.scheduling.PadDelay.html - qiskit_ibm_provider.transpiler.passes.scheduling.PadDynamicalDecoupling.html <details> <summary> Fake Provider Docs added: </summary> - qiskit_ibm_runtime.fake_provider.FakeAlmaden.html - qiskit_ibm_runtime.fake_provider.FakeAlmadenV2.html - qiskit_ibm_runtime.fake_provider.FakeArmonk.html - qiskit_ibm_runtime.fake_provider.FakeArmonkV2.html - qiskit_ibm_runtime.fake_provider.FakeAthens.html - qiskit_ibm_runtime.fake_provider.FakeAthensV2.html - qiskit_ibm_runtime.fake_provider.FakeAuckland.html - qiskit_ibm_runtime.fake_provider.FakeBelem.html - qiskit_ibm_runtime.fake_provider.FakeBelemV2.html - qiskit_ibm_runtime.fake_provider.FakeBoeblingen.html - qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2.html - qiskit_ibm_runtime.fake_provider.FakeBogota.html - qiskit_ibm_runtime.fake_provider.FakeBogotaV2.html - qiskit_ibm_runtime.fake_provider.FakeBrooklyn.html - qiskit_ibm_runtime.fake_provider.FakeBrooklynV2.html - qiskit_ibm_runtime.fake_provider.FakeBurlington.html - qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2.html - qiskit_ibm_runtime.fake_provider.FakeCairo.html - qiskit_ibm_runtime.fake_provider.FakeCairoV2.html - qiskit_ibm_runtime.fake_provider.FakeCambridge.html - qiskit_ibm_runtime.fake_provider.FakeCambridgeV2.html - qiskit_ibm_runtime.fake_provider.FakeCasablanca.html - qiskit_ibm_runtime.fake_provider.FakeCasablancaV2.html - qiskit_ibm_runtime.fake_provider.FakeEssex.html - qiskit_ibm_runtime.fake_provider.FakeEssexV2.html - qiskit_ibm_runtime.fake_provider.FakeGeneva.html - qiskit_ibm_runtime.fake_provider.FakeGuadalupe.html - qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2.html - qiskit_ibm_runtime.fake_provider.FakeHanoi.html - qiskit_ibm_runtime.fake_provider.FakeHanoiV2.html - qiskit_ibm_runtime.fake_provider.FakeJakarta.html - qiskit_ibm_runtime.fake_provider.FakeJakartaV2.html - qiskit_ibm_runtime.fake_provider.FakeJohannesburg.html - qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2.html - qiskit_ibm_runtime.fake_provider.FakeKolkata.html - qiskit_ibm_runtime.fake_provider.FakeKolkataV2.html - qiskit_ibm_runtime.fake_provider.FakeLagos.html - qiskit_ibm_runtime.fake_provider.FakeLagosV2.html - qiskit_ibm_runtime.fake_provider.FakeLima.html - qiskit_ibm_runtime.fake_provider.FakeLimaV2.html - qiskit_ibm_runtime.fake_provider.FakeLondon.html - qiskit_ibm_runtime.fake_provider.FakeLondonV2.html - qiskit_ibm_runtime.fake_provider.FakeManhattan.html - qiskit_ibm_runtime.fake_provider.FakeManhattanV2.html - qiskit_ibm_runtime.fake_provider.FakeManila.html - qiskit_ibm_runtime.fake_provider.FakeManilaV2.html - qiskit_ibm_runtime.fake_provider.FakeMelbourne.html - qiskit_ibm_runtime.fake_provider.FakeMelbourneV2.html - qiskit_ibm_runtime.fake_provider.FakeMontreal.html - qiskit_ibm_runtime.fake_provider.FakeMontrealV2.html - qiskit_ibm_runtime.fake_provider.FakeMumbai.html - qiskit_ibm_runtime.fake_provider.FakeMumbaiV2.html - qiskit_ibm_runtime.fake_provider.FakeNairobi.html - qiskit_ibm_runtime.fake_provider.FakeNairobiV2.html - qiskit_ibm_runtime.fake_provider.FakeOslo.html - qiskit_ibm_runtime.fake_provider.FakeOurense.html - qiskit_ibm_runtime.fake_provider.FakeOurenseV2.html - qiskit_ibm_runtime.fake_provider.FakeParis.html - qiskit_ibm_runtime.fake_provider.FakeParisV2.html - qiskit_ibm_runtime.fake_provider.FakePerth.html - qiskit_ibm_runtime.fake_provider.FakePoughkeepsie.html - qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2.html - qiskit_ibm_runtime.fake_provider.FakePrague.html - qiskit_ibm_runtime.fake_provider.FakeProviderForBackendV2.html - qiskit_ibm_runtime.fake_provider.FakeProvider.html - qiskit_ibm_runtime.fake_provider.FakeQuito.html - qiskit_ibm_runtime.fake_provider.FakeQuitoV2.html - qiskit_ibm_runtime.fake_provider.FakeRochester.html - qiskit_ibm_runtime.fake_provider.FakeRochesterV2.html - qiskit_ibm_runtime.fake_provider.FakeRome.html - qiskit_ibm_runtime.fake_provider.FakeRomeV2.html - qiskit_ibm_runtime.fake_provider.FakeRueschlikon.html - qiskit_ibm_runtime.fake_provider.FakeSantiago.html - qiskit_ibm_runtime.fake_provider.FakeSantiagoV2.html - qiskit_ibm_runtime.fake_provider.FakeSherbrooke.html - qiskit_ibm_runtime.fake_provider.FakeSingapore.html - qiskit_ibm_runtime.fake_provider.FakeSingaporeV2.html - qiskit_ibm_runtime.fake_provider.FakeSydney.html - qiskit_ibm_runtime.fake_provider.FakeSydneyV2.html - qiskit_ibm_runtime.fake_provider.FakeTenerife.html - qiskit_ibm_runtime.fake_provider.FakeTokyo.html - qiskit_ibm_runtime.fake_provider.FakeToronto.html - qiskit_ibm_runtime.fake_provider.FakeTorontoV2.html - qiskit_ibm_runtime.fake_provider.FakeValencia.html - qiskit_ibm_runtime.fake_provider.FakeValenciaV2.html - qiskit_ibm_runtime.fake_provider.FakeVigo.html - qiskit_ibm_runtime.fake_provider.FakeVigoV2.html - qiskit_ibm_runtime.fake_provider.FakeWashington.html - qiskit_ibm_runtime.fake_provider.FakeWashingtonV2.html - qiskit_ibm_runtime.fake_provider.FakeYorktown.html - qiskit_ibm_runtime.fake_provider.FakeYorktownV2.html </details> Co-authored-by: Rebecca Dimock <[email protected]> * Set use_symengine on qpy generation if symengine is installed (#1355) This commit sets the use_symengine flag during qpy export used during job payload generation if symengine is installed. For qiskit <1.0 symengine is a hard dependency on platforms that have support for it (x86_64, aarch64, and ppc64le linux and macOS) and an optional requirement on other qiskit supported platforms, and when available it greatly improves the runtime performance of symbolic expressions in Qiskit. By default QPY opts for the more compatible sympy representation of an unbound ParameterExpression as it's maximally compatible, and means that no matter the environment the payload will be loaded from it will be able to parse the payload. In QPY version 10 a new flag was added to the payload definition that enables users to use a native binary symengine representation of a symbolic expression that is significantly faster to generate and parse, but it still defaults to sympy as using this flag limits the compatibility of the payload. However, for runtime job submission we know that the service always has symengine available so we should be using this flag for job submission if the local environment has symengine installed as it will greatly speed up the serialization of unbound ParameterExpression objects. In Qiskit 1.0, symengine is promoted to a hard requriment for all environments and use_symengine=True is the default in Qiskit's qpy module. But, setting it like this is still a good idea as it will always be safe to do this, it's just in qiskit 1.0 symengine will always be installed. * Fix for unit tests (#1356) * Run all unit tests * Import fake providers * Format * Fake providers not used in this branch * Unused import --------- Co-authored-by: Kevin Tian <[email protected]> * Update flaky integration tests (#1359) * Fix bad Sphinx API doc Provider naming (#1360) This resulted in the imports being called `qiskit_ibm_provider` rather than `qiskit_ibm_runtime`. Co-authored-by: Frank Harkins <[email protected]> * Merge qiskit-ibm-provider into qiskit-ibm-runtime (#1285) * initial commit * more replacements * more replacements * add auth/api * add reno * add qpy module back * address comments * fix docs build * Update invalid token test (#1367) * Copy pub/sub code into qiskit-ibm-runtime (#1349) * Copy pub/sub code into qiskit-ibm-runtime * fix docs build * Remove mthree from requirements-dev (#1370) * Handle Qiskit 1.0 removals (#1363) * Handle Qiskit 1.0 removals * Remove removed qiskit modules * add both qiskit synthesis imports * fix docs build * fix lint errors from 1.0.0RC1 * update basicaer import * Update qiskit_ibm_runtime/fake_provider/fake_backend.py Co-authored-by: Elena Peña Tapia <[email protected]> * address comments * Update imports & docstrings --------- Co-authored-by: Elena Peña Tapia <[email protected]> * Copy over provider session & remove qiskit-ibm-provider (#1368) * Move provider's session & remove qiskit-ibm-provider * fix black * Handle qpy serialization across versions and delete vendored fork (#1377) * Handle qpy serialization across versions and delete vendored fork For the next qiskit-ibm-runtime release it is desired to have it support both Qiskit 0.45.x/0.46.x and Qiskit 1.0.0. To do this with QPY it means we need to emit a fixed qpy version of 10 as that's currently the maximum version the server side can parse. The easiest way to manage this across versions is actually to rely on Qiskit's qpy module again. Starting in Qiskit 1.0.0 the qiskit.qpy.dump() function a new kwarg, version exists to specify the version of qpy emitted. We can use this to control the rollout of QPY format versions as the server side is updated. For right now this is fixed to version 10 which is the same as the QPY format version emitted by 0.45.x and 0.46.0. Because the versions are the same we can just use qiskit's qpy module moving forward as either we're on qiskit 0.45.x/0.46.x and will emit version 10 (as there is no option) or we're on >=1.0.0 and we explicitly set the qpy version to one that's compatible with the server side. The qpy internals usage to serialize parameters and parameter expressions are left in place (although expanded on to include #1355 for parameter expressions) as an alternative needs to be considered for this. It is not a good idea to rely on qpy internals and explicitly private functions to do partial serialization. This commit also deletes the vendored fork as it's never been included in a released version of qiskit-ibm-runtime and nothing is using it anymore. Related to: #1375 * Fix lint * Fix lint again * Run integration tests against Qiskit main (#1376) * Fix qiskit main integratino tests cron job (#1379) * Prepare release 0.19.0 (#1380) * Prepare release 0.19 * add reno stating compatibility * Update main branch version 0.19.1 (#1382) * Porting qiskit-ibm-provider/787: Fix `DynamicCircuitInstructionDurations.from_backend` for both `Backend versions` (#1383) * porting qiskit-ibm-provider/pull/787 * porting qiskit-ibm-provider/pull/787 * black * oops * monkey patch Qiskit/qiskit#11727 * black lynt * mypy --------- Co-authored-by: Kevin Tian <[email protected]> * Cast use_symengine input to a bool (#1385) * Cast use_symengine input to a bool This commit works around a bug in Qiskit 0.45.x, 0.46.0, and 1.0.0rc1 with the `use_symengine` flag on `qpy.dump()`. The dump function has a bug when it receives a truthy value instead of a bool literal that it will generate a corrupt qpy because of a mismatch between how the encoding was processed (the encoding is incorrectly set to sympy in the file header but uses symengine encoding in the actual body of the circuit. This is being fixed in Qiskit/qiskit#11730 for 1.0.0, and will be backported to 0.46.1. But to ensure compatibility with 0.45.x, 0.46.0, and 1.0.0rc1 while waiting for those releases we can workaround this by just casting the value to a boolean. * Fix mypy failures * Mypy fixes again * Prepare release 0.19.1 (#1386) * Update main branch version 0.19.2 (#1388) * fix import issues * more import issues * disable docs warning --------- Co-authored-by: Elena Peña Tapia <[email protected]> Co-authored-by: Kevin Tian <[email protected]> Co-authored-by: merav-aharoni <[email protected]> Co-authored-by: Salvador de la Puente González <[email protected]> Co-authored-by: Eric Arellano <[email protected]> Co-authored-by: Sanket Panda <[email protected]> Co-authored-by: abbycross <[email protected]> Co-authored-by: Kevin Tian <[email protected]> Co-authored-by: Rathish Cholarajan <[email protected]> Co-authored-by: Blake Johnson <[email protected]> Co-authored-by: Kevin J. Sung <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Kaelyn Ferris <[email protected]> Co-authored-by: Rebecca Dimock <[email protected]> Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Diego Ristè <[email protected]> Co-authored-by: Frank Harkins <[email protected]> Co-authored-by: Luciano Bello <[email protected]>
1 parent f9bcb47 commit 852479b

File tree

91 files changed

+2292
-816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2292
-816
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2024.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
name: Integration Tests (Qiskit Main)
14+
on:
15+
schedule:
16+
# run integration tests against Qiskit main once a week
17+
- cron: '0 0 * * 0'
18+
workflow_dispatch:
19+
jobs:
20+
integration-tests:
21+
if: github.repository_owner == 'Qiskit'
22+
name: Run integration tests - ${{ matrix.environment }}
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
# avoid cancellation of in-progress jobs if any matrix job fails
26+
fail-fast: false
27+
matrix:
28+
python-version: [ 3.9 ]
29+
os: [ "ubuntu-latest" ]
30+
environment: [ "ibm-quantum-production", "ibm-quantum-staging", "ibm-cloud-production", "ibm-cloud-staging" ]
31+
environment: ${{ matrix.environment }}
32+
env:
33+
QISKIT_IBM_TOKEN: ${{ secrets.QISKIT_IBM_TOKEN }}
34+
QISKIT_IBM_URL: ${{ secrets.QISKIT_IBM_URL }}
35+
QISKIT_IBM_INSTANCE: ${{ secrets.QISKIT_IBM_INSTANCE }}
36+
LOG_LEVEL: DEBUG
37+
STREAM_LOG: True
38+
QISKIT_IN_PARALLEL: True
39+
steps:
40+
- uses: actions/checkout@v2
41+
with:
42+
fetch-depth: 0
43+
- name: Set up Python ${{ matrix.python-version }}
44+
uses: actions/setup-python@v2
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
- name: Install dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install -c constraints.txt -r requirements-dev.txt -e . git+https://github.com/Qiskit/qiskit.git
51+
- name: Run integration tests
52+
run: make integration-test

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ function-naming-style=snake_case
379379
good-names=i,
380380
j,
381381
k,
382+
dt,
382383
ex,
383384
Run,
384385
_

docs/apidocs/fake_provider.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. automodule:: qiskit_ibm_runtime.fake_provider
2+
:no-members:
3+
:no-inherited-members:
4+
:no-special-members:

docs/apidocs/ibm-runtime.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ qiskit-ibm-runtime API reference
99

1010
runtime_service
1111
options
12+
transpiler
13+
fake_provider

docs/apidocs/transpiler.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. automodule:: qiskit_ibm_runtime.transpiler
2+
:no-members:
3+
:no-inherited-members:
4+
:no-special-members:

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
# The short X.Y version
2626
version = ''
2727
# The full version, including alpha/beta/rc tags
28-
docs_url_prefix = "ecosystem/ibm-runtime"
29-
release = '0.18.1'
28+
release = '0.19.2'
3029

3130
# -- General configuration ---------------------------------------------------
3231

@@ -41,6 +40,7 @@
4140
'reno.sphinxext',
4241
'nbsphinx',
4342
'sphinxcontrib.katex',
43+
'matplotlib.sphinxext.plot_directive',
4444
]
4545
templates_path = ['_templates']
4646

program_source/circuit_runner/__init__.py

Whitespace-only changes.

qiskit_ibm_runtime/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.18.1
1+
0.19.2

qiskit_ibm_runtime/accounts/account.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
from urllib.parse import urlparse
1919

2020
from requests.auth import AuthBase
21-
from qiskit_ibm_provider.proxies import ProxyConfiguration
22-
from qiskit_ibm_provider.utils.hgp import from_instance_format
21+
from ..proxies import ProxyConfiguration
22+
from ..utils.hgp import from_instance_format
2323

2424
from .exceptions import InvalidAccountError, CloudResourceNameResolutionError
2525
from ..api.auth import QuantumAuth, CloudAuth

qiskit_ibm_runtime/accounts/management.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
import os
1616
from typing import Optional, Dict
1717

18-
from qiskit_ibm_provider.proxies import ProxyConfiguration
19-
18+
from ..proxies import ProxyConfiguration
2019
from .exceptions import AccountNotFoundError
2120
from .account import Account, ChannelType
2221
from .storage import save_config, read_config, delete_config

qiskit_ibm_runtime/api/client_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"""Represent IBM Quantum account client parameters."""
1414

1515
from typing import Dict, Optional, Any, Union
16-
from qiskit_ibm_provider.proxies import ProxyConfiguration
16+
from ..proxies import ProxyConfiguration
1717

1818
from ..utils import get_runtime_api_base_url
1919
from ..api.auth import QuantumAuth, CloudAuth

qiskit_ibm_runtime/api/clients/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
"""IBM Quantum API clients."""
1414

15-
from qiskit_ibm_provider.api.clients.base import BaseClient, WebsocketClientCloseCode
16-
from qiskit_ibm_provider.api.clients.auth import AuthClient
17-
from qiskit_ibm_provider.api.clients.version import VersionClient
18-
from qiskit_ibm_provider.api.clients.runtime_ws import RuntimeWebsocketClient
15+
from .base_websocket_client import WebsocketClientCloseCode
16+
from .auth import AuthClient
17+
from .version import VersionClient
18+
from .runtime_ws import RuntimeWebsocketClient
1919
from .runtime import RuntimeClient
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2021.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""Client for accessing IBM Quantum authentication services."""
14+
15+
from typing import Dict, List, Optional, Any, Union
16+
from requests.exceptions import RequestException
17+
18+
from ..auth import QuantumAuth
19+
from ..exceptions import AuthenticationLicenseError, RequestsApiError
20+
from ..rest import Api
21+
from ..session import RetrySession
22+
from ..client_parameters import ClientParameters
23+
24+
25+
class AuthClient:
26+
"""Client for accessing IBM Quantum authentication services."""
27+
28+
def __init__(self, client_params: ClientParameters) -> None:
29+
"""AuthClient constructor.
30+
31+
Args:
32+
client_params: Parameters used for server connection.
33+
"""
34+
self.api_token = client_params.token
35+
self.auth_url = client_params.url
36+
self._service_urls = {} # type: ignore[var-annotated]
37+
38+
self.auth_api = Api(RetrySession(self.auth_url, **client_params.connection_parameters()))
39+
self.base_api = self._init_service_clients(**client_params.connection_parameters())
40+
41+
def _init_service_clients(self, **request_kwargs: Any) -> Api:
42+
"""Initialize the clients used for communicating with the API.
43+
44+
Args:
45+
**request_kwargs: Arguments for the request ``Session``.
46+
47+
Returns:
48+
Client for the API server.
49+
"""
50+
# Request an access token.
51+
self.access_token = self._request_access_token()
52+
self.auth_api.session.auth = QuantumAuth(access_token=self.access_token)
53+
self._service_urls = self.user_urls()
54+
55+
# Create the api server client, using the access token.
56+
base_api = Api(
57+
RetrySession(
58+
self._service_urls["http"],
59+
auth=QuantumAuth(access_token=self.access_token),
60+
**request_kwargs,
61+
)
62+
)
63+
64+
return base_api
65+
66+
def _request_access_token(self) -> str:
67+
"""Request a new access token from the API authentication service.
68+
69+
Returns:
70+
A new access token.
71+
72+
Raises:
73+
AuthenticationLicenseError: If the user hasn't accepted the license agreement.
74+
RequestsApiError: If the request failed.
75+
"""
76+
try:
77+
response = self.auth_api.login(self.api_token)
78+
return response["id"]
79+
except RequestsApiError as ex:
80+
# Get the original exception that raised.
81+
original_exception = ex.__cause__
82+
83+
if isinstance(original_exception, RequestException):
84+
# Get the response from the original request exception.
85+
error_response = (
86+
# pylint: disable=no-member
87+
original_exception.response
88+
)
89+
if error_response is not None and error_response.status_code == 401:
90+
try:
91+
error_code = error_response.json()["error"]["name"]
92+
if error_code == "ACCEPT_LICENSE_REQUIRED":
93+
message = error_response.json()["error"]["message"]
94+
raise AuthenticationLicenseError(message)
95+
except (ValueError, KeyError):
96+
# the response did not contain the expected json.
97+
pass
98+
raise
99+
100+
# User account-related public functions.
101+
102+
def user_urls(self) -> Dict[str, str]:
103+
"""Retrieve the API URLs from the authentication service.
104+
105+
Returns:
106+
A dict with the base URLs for the services. Currently
107+
supported keys are:
108+
109+
* ``http``: The API URL for HTTP communication.
110+
* ``ws``: The API URL for websocket communication.
111+
* ``services`: The API URL for additional services.
112+
"""
113+
response = self.auth_api.user_info()
114+
return response["urls"]
115+
116+
def user_hubs(self) -> List[Dict[str, str]]:
117+
"""Retrieve the hub/group/project sets available to the user.
118+
119+
The first entry in the list will be the default set, as indicated by
120+
the ``isDefault`` field from the API.
121+
122+
Returns:
123+
A list of dictionaries with the hub, group, and project values keyed by
124+
``hub``, ``group``, and ``project``, respectively.
125+
"""
126+
response = self.base_api.hubs()
127+
128+
hubs = [] # type: ignore[var-annotated]
129+
for hub in response:
130+
hub_name = hub["name"]
131+
for group_name, group in hub["groups"].items():
132+
for project_name, project in group["projects"].items():
133+
entry = {
134+
"hub": hub_name,
135+
"group": group_name,
136+
"project": project_name,
137+
}
138+
139+
# Move to the top if it is the default h/g/p.
140+
if project.get("isDefault"):
141+
hubs.insert(0, entry)
142+
else:
143+
hubs.append(entry)
144+
145+
return hubs
146+
147+
# Miscellaneous public functions.
148+
149+
def api_version(self) -> Dict[str, Union[str, bool]]:
150+
"""Return the version of the API.
151+
152+
Returns:
153+
API version.
154+
"""
155+
return self.base_api.version()
156+
157+
def current_access_token(self) -> Optional[str]:
158+
"""Return the current access token.
159+
160+
Returns:
161+
The access token in use.
162+
"""
163+
return self.access_token
164+
165+
def current_service_urls(self) -> Dict:
166+
"""Return the current service URLs.
167+
168+
Returns:
169+
A dict with the base URLs for the services, in the same
170+
format as :meth:`user_urls()`.
171+
"""
172+
return self._service_urls

qiskit_ibm_runtime/api/clients/backend.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
from datetime import datetime as python_datetime
1818
from abc import ABC, abstractmethod
1919

20-
from qiskit_ibm_provider.api.clients.base import BaseClient
21-
2220
logger = logging.getLogger(__name__)
2321

2422

25-
class BaseBackendClient(BaseClient, ABC):
23+
class BaseBackendClient(ABC):
2624
"""Client for accessing backend information."""
2725

2826
@abstractmethod

0 commit comments

Comments
 (0)