Skip to content

Commit 7b303aa

Browse files
jyu00ElePTkt474merav-aharonidelapuente
authored
Fast forward experimental-0.2 (#1432)
* 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 <kevin.tian@ibm.com> * 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 <kevin.tian@ibm.com> * 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 <jessieyu@us.ibm.com> * 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 <kevin.tian@ibm.com> Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Instance & channel_strategy validation (#1233) * compare cloud instance with channel strategy * fix unit tests * error wording --------- Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * 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 <merav@il.ibm.com> * Update test/integration/test_backend.py Co-authored-by: merav-aharoni <merav@il.ibm.com> --------- Co-authored-by: merav-aharoni <merav@il.ibm.com> * 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 <kevin.tian@ibm.com> * 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 <14852634+Eric-Arellano@users.noreply.github.com> * Update CONTRIBUTING.md Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> --------- Co-authored-by: Kevin Tian <kt474@cornell.edu> Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> * 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 <kevin.tian@ibm.com> * 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 <kevin.tian@ibm.com> * 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 <kevin.tian@ibm.com> * 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 <rathishc24@gmail.com> * address comments * update date to 2023 * Update test/qctrl/test_qctrl.py Co-authored-by: Blake Johnson <blakejohnson04@gmail.com> * Update test/qctrl/test_qctrl.py Co-authored-by: Blake Johnson <blakejohnson04@gmail.com> --------- Co-authored-by: merav-aharoni <merav@il.ibm.com> Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> Co-authored-by: Blake Johnson <blakejohnson04@gmail.com> * 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 <kevin.tian@ibm.com> * 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 <kevin.tian@ibm.com> * 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 <jessieyu@us.ibm.com> * Update qiskit_ibm_runtime/sampler.py Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Update qiskit_ibm_runtime/session.py Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Update test/utils.py Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> --------- Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * 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 <66339736+beckykd@users.noreply.github.com> * 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 <kevin.tian@ibm.com> * 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 <frankharkins@users.noreply.github.com> * 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 <57907331+ElePT@users.noreply.github.com> * address comments * Update imports & docstrings --------- Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> * 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 <kevin.tian@ibm.com> * 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) * Use barrier labels to define intervals for DD (#1358) * Add transpiler tests * Named barrier to select dd intervals * reno * consistent pad arguments in PadDelay * Decouple single_pulse option * fix docsting * Add test * Fix for PadDelay * format * line too long --------- Co-authored-by: kevin-tian <kevin.tian@ibm.com> * Remove remaining qiskit.org links (#1397) * Remove remaining qiskit.org links * Update qiskit_ibm_runtime/provider_session.py Co-authored-by: Kevin Tian <kt474@cornell.edu> --------- Co-authored-by: Kevin Tian <kt474@cornell.edu> * Support Python 3.12 (#1347) * Support Python 3.12 * update requirments * update requirements * Add deprecation policy (#1405) * add deprecation file * update guide * fix wording Co-authored-by: Kevin Tian <kt474@cornell.edu> --------- Co-authored-by: Kevin Tian <kt474@cornell.edu> * Fix scheduling in control flow with instructions of non-uniform durations (#1378) * Map indices for durations in inner block * Add test * Reno * Fix docs * Missing docstring --------- Co-authored-by: Kevin Tian <kevin.tian@ibm.com> * Add deprecation warning for abstract circuits (#1404) * Add abstract circuit warning * add reno * use correct Sequence import * unit tests * Fix docs build with Qiskit 1.0 (#1411) * fix docs build * Replace qiskit.tools * Use POST /sessions endpoint (#1372) * wip use post sessions * address comments * fix mypy & lint * use private method * Add reno * attempt fix unit tests * unit tests * add logic to work with IQP * remove todo * Update releasenotes/notes/session-modes-5c22b68620f8d690.yaml Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Update docstrings, passing mode into payload * Update unit tests * address comments * Pass max_time to /sessions * unit tests * integration test --------- Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> * Use POST /sessions in backend.run sessions (#1415) * Use POST /sessions in backend.run sessions * Add reno * update tests * add test_run_after_cancel back * remove max_time arg from Session * Add max_time * Prepare release 0.20.0 (#1418) * Update main branch version 0.20.1 (#1419) * Update ISA validation (#1414) * check coupling map * restore stack level * mypy * remove layout check * check width * allow pulse gates * add release note * Fix bug with retrieving fake backends (#1402) * bug fix w retrieving fake backend * Move test * fix merge issues --------- Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> Co-authored-by: Kevin Tian <kevin.tian@ibm.com> Co-authored-by: merav-aharoni <merav@il.ibm.com> Co-authored-by: Salvador de la Puente González <neo.salvador@gmail.com> Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Co-authored-by: Sanket Panda <pandasa123@gmail.com> Co-authored-by: abbycross <across@us.ibm.com> Co-authored-by: Kevin Tian <kt474@cornell.edu> Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> Co-authored-by: Blake Johnson <blakejohnson04@gmail.com> Co-authored-by: Kevin J. Sung <kevjsung@umich.edu> Co-authored-by: Jake Lishman <jake.lishman@ibm.com> Co-authored-by: Kaelyn Ferris <43348706+kaelynj@users.noreply.github.com> Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Diego Ristè <10402430+dieris@users.noreply.github.com> Co-authored-by: Frank Harkins <frankharkins@users.noreply.github.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
1 parent f173713 commit 7b303aa

Some content is hidden

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

49 files changed

+1044
-281
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
runs-on: ${{ matrix.os }}
8282
strategy:
8383
matrix:
84-
python-version: [3.8, 3.9, '3.10', '3.11']
84+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
8585
os: [ "macOS-latest", "ubuntu-latest", "windows-latest" ]
8686
env:
8787
LOG_LEVEL: DEBUG

DEPRECATION.md

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
# Deprecation Policy
2+
3+
Many users and other packages depend on this package. We must
4+
make sure that whenever we make changes to the code, we give users ample time to
5+
adjust without breaking code that they have already written.
6+
7+
Most importantly: *do not* change any interface that is public-facing unless we
8+
absolutely have to. Adding things is ok, taking things away is annoying for
9+
users but can be handled reasonably with plenty notice, but changing behavior
10+
generally means users cannot write code that will work with two subsequent
11+
versions of qiskit-ibm-runtime, which is not acceptable.
12+
13+
Beware that users will often be using functions, classes and methods that we,
14+
the Qiskit developers, may consider internal or not widely used. Do not make
15+
assumptions that "this is buried, so nobody will be using it"; if it is public,
16+
it is subject to the policy. The only exceptions here are functions and modules
17+
that are explicitly internal, *i.e.* those whose names begin with a leading
18+
underscore (`_`).
19+
20+
The guiding principles are:
21+
22+
- we must not remove or change code without active warnings for at least three
23+
months or two complete version cycles;
24+
25+
- there must always be a way to achieve valid goals that does not issue any
26+
warnings;
27+
28+
- never assume that a function that isn't explicitly internal isn't in use;
29+
30+
- all deprecations, changes and removals are considered API changes, and can
31+
only occur in minor releases not patch releases, per the [stable branch policy](https://github.com/Qiskit/qiskit/blob/main/MAINTAINING.md#stable-branch-policy).
32+
33+
34+
## Removing a feature
35+
36+
When removing a feature (for example a class, function or function parameter),
37+
we will follow this procedure:
38+
39+
- A deprecation warning must be issued prior to any removal. The warning
40+
must indicate what the alternative path is, and the alternative path
41+
must be in place when the warning is issued. When a feature is
42+
deprecated, add a
43+
release note with a `deprecations` section listing all deprecated paths,
44+
their alternatives, and the reason for deprecation. [Update the tests to test the warnings](#testing-deprecated-functionality).
45+
46+
*Reason*: we need to give people time to swap over without breaking their
47+
code as soon as they upgrade.
48+
49+
- Set a removal date for the old feature, and remove it (and the warnings) when
50+
reached. This must be at least three months after the version with the
51+
warnings was first released, and cannot be the minor version immediately
52+
after the warnings. Add an `upgrade` release note that lists all the
53+
removals. For example, if the alternative path was provided
54+
and the warnings were added in `0.20.0`, the earliest version for removal
55+
is `0.22.0`, even if `0.21.0` was released more than three months after
56+
`0.20.0`.
57+
58+
**Note: These are _minimum_** requirements. For removal of significant or core features, give
59+
users at least an extra minor version if not longer.**
60+
61+
*Reason*: there needs to be time for users to see these messages, and to give
62+
them time to adjust. Not all users will update their version of qiskit-ibm-runtime
63+
immediately, and some may skip minor versions.
64+
65+
When a feature is marked as deprecated it is slated for removal, but users
66+
should still be able to rely on it to work correctly. We consider a feature
67+
marked "deprecated" as frozen; we commit to maintaining it with critical bug
68+
fixes until it is removed, but we won't merge new functionality to it.
69+
70+
71+
## Changing behavior
72+
73+
74+
Changing behavior without a removal is particularly difficult to manage, because
75+
we need to have both options available for two versions, and be able to issue
76+
warnings. For example, changing the type of the return value from a function
77+
will almost invariably involve making an API break, which is frustrating for
78+
users and makes it difficult for them to use this package.
79+
80+
The best solution here is often to make a new function, and then use [the procedures for removal](#removing-features) above.
81+
82+
If you absolutely must change the behavior of existing code (other than fixing
83+
bugs), you will need to use your best judgment to apply the guiding principles
84+
at the top of this document. The most appropriate warning for behavioral
85+
changes is usually `FutureWarning`. Some possibilities for how to effect a
86+
change:
87+
88+
- If you are changing the default behavior of a function, consider adding a
89+
keyword argument to select between old and new behaviors. When it comes time,
90+
you can issue a `FutureWarning` if the keyword argument is not given
91+
(*e.g.* if it is `None`), saying that the new value will soon become the
92+
default. You will need to go through the normal deprecation period for
93+
removing this keyword argument after you have made the behavior change. This
94+
will take at least six months to go through both cycles.
95+
96+
- If you need to change the return type of a function, consider adding a new
97+
function that returns the new type, and then follow the procedures for
98+
deprecating the old function.
99+
100+
- If you need to accept a new input that you cannot distinguish from an existing
101+
possibility because of its type, consider letting it be passed by a different
102+
keyword argument, or add a second function that only accepts the new form.
103+
104+
105+
106+
## Issuing deprecation warnings
107+
108+
The proper way to raise a deprecation warning is to use the `@deprecate_function` decorator, and
109+
the `deprecate_arguments` and `issue_deprecation_msg` functions
110+
from `qiskit_ibm_runtime.utils.deprecation`.
111+
These will generate a standardized message and ensure an alternative path is specified.
112+
113+
Usually, you should set `remedy: str` with the format `"Instead, use ..."` so that
114+
people know how to migrate. Read those functions' docstrings for additional arguments like
115+
`version: str`.
116+
117+
If the functions in `qiskit_ibm_runtime.utils.deprecation` cannot handle your use case, consider improving
118+
them. Otherwise, you can directly call the `warn` function
119+
from the [warnings module in the Python standard library](https://docs.python.org/3/library/warnings.html),
120+
using the category `DeprecationWarning`. For example:
121+
122+
```python
123+
import warnings
124+
125+
def deprecated_function():
126+
warnings.warn(
127+
"The function qiskit.deprecated_function() is deprecated since "
128+
"qiskit-ibm-runtime 0.14.0, and will be removed 3 months or more later. "
129+
"Instead, you should use qiskit.other_function().",
130+
category=DeprecationWarning,
131+
stacklevel=2,
132+
)
133+
# ... the rest of the function ...
134+
135+
```
136+
137+
Make sure you include the version of the package that introduced the deprecation
138+
warning (so maintainers can easily see when it is valid to remove it), and what
139+
the alternative path is.
140+
141+
Take note of the `stacklevel` argument. This controls which function is
142+
accused of being deprecated. Setting `stacklevel=1` means the
143+
warning will blame the `warn` function itself, while `stacklevel=2` (the default) will
144+
correctly blame the containing function. It is unusual to set this to anything
145+
other than `2`, but can be useful if you use a helper function to issue the
146+
same warning in multiple places.
147+
148+
149+
## Testing deprecated functionality
150+
151+
Whenever you add deprecation warnings, you will need to update tests involving
152+
the functionality. The test suite should fail otherwise, because of the new
153+
warnings. We must continue to test deprecated functionality throughout the
154+
deprecation period, to ensure that it still works.
155+
156+
To update the tests, you need to wrap each call of deprecated behavior in its
157+
own assertion block. For subclasses of `unittest.TestCase` (which all Qiskit
158+
test cases are), this is done by:
159+
160+
161+
```python
162+
class MyTestSuite(QiskitTestCase):
163+
def test_deprecated_function(self):
164+
with self.assertWarns(DeprecationWarning):
165+
output = deprecated_function()
166+
# ... do some things with output ...
167+
self.assertEqual(output, expected)
168+
```
169+
170+
## Documenting deprecations and breaking changes
171+
172+
It is important to warn the user when your breaking changes are coming.
173+
174+
Make sure to update the docstring of the function, so that it shows up in
175+
API reference.
176+
177+
You can add a [Sphinx deprecated directive](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-deprecated):
178+
179+
180+
```python
181+
def deprecated_function():
182+
"""
183+
Short description of the deprecated function.
184+
185+
.. deprecated:: 0.14.0
186+
The function qiskit_ibm_runtime.deprecated_function() is deprecated since
187+
qiskit_ibm_runtime 0.14.0, and will be removed 3 months or more later.
188+
Instead, you should use qiskit_ibm_runtime.other_function().
189+
190+
<rest of the docstring>
191+
"""
192+
# ... the rest of the function ...
193+
```
194+
195+
196+
You should also document the deprecation in the changelog by using Reno. Explain the deprecation
197+
and how to migrate.
198+
199+
In particular situations where a deprecation or change might be a major disruptor for users, a
200+
*migration guide* might be needed. Please write these guides in Qiskit's documentation at
201+
https://github.com/Qiskit/documentation/tree/main/docs/api/migration-guides. Once
202+
the migration guide is written and published, deprecation
203+
messages and documentation should link to it.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# The short X.Y version
2626
version = ''
2727
# The full version, including alpha/beta/rc tags
28-
release = '0.19.2'
28+
release = '0.20.1'
2929

3030
# -- General configuration ---------------------------------------------------
3131

docs/tutorials/Error-Suppression-and-Error-Mitigation.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,10 +1953,9 @@
19531953
}
19541954
],
19551955
"source": [
1956-
"from qiskit.tools import jupyter\n",
1956+
"import qiskit\n",
19571957
"\n",
1958-
"%qiskit_version_table\n",
1959-
"%qiskit_copyright"
1958+
"qiskit.version.get_version_info()"
19601959
]
19611960
}
19621961
],

docs/tutorials/how-to-getting-started-with-estimator.ipynb

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747
},
4848
"source": [
49-
"[Primitives](https://qiskit.org/ecosystem/ibm-runtime/primitives.html) are core functions that make it easier to build modular algorithms and applications. \n",
49+
"[Primitives](https://docs.quantum.ibm.com/run/primitives) are core functions that make it easier to build modular algorithms and applications. \n",
5050
"\n",
5151
"The initial release of Qiskit Runtime includes two primitives:\n",
5252
"\n",
@@ -115,7 +115,7 @@
115115
}
116116
},
117117
"source": [
118-
"For a basic expectation value calculation you will need at least one quantum circuit to prepare our system in a precise quantum state for study. Our examples all have circuits in them, but you can use Qiskit to create your own. To learn how to create circuits by using Qiskit, see the [Circuit basics tutorial](https://qiskit.org/documentation/tutorials/circuits/01_circuit_basics.html)."
118+
"For a basic expectation value calculation you will need at least one quantum circuit to prepare our system in a precise quantum state for study. Our examples all have circuits in them, but you can use Qiskit to create your own. To learn how to create circuits by using Qiskit, see [the documentation](https://docs.quantum.ibm.com/build/circuit-construction)."
119119
]
120120
},
121121
{
@@ -167,7 +167,7 @@
167167
}
168168
},
169169
"source": [
170-
"You will also need at least one observable to measure. Observables represent physical properties of a quantum system (such as energy or spin), and allow said properties to be measured (such as their expectation values) for a given state of our system. For simplicity, you can use the [SparsePauliOp class](https://qiskit.org/documentation/stubs/qiskit.quantum_info.SparsePauliOp.html#qiskit.quantum_info.SparsePauliOp) in Qiskit to define them, as illustrated in the following example."
170+
"You will also need at least one observable to measure. Observables represent physical properties of a quantum system (such as energy or spin), and allow said properties to be measured (such as their expectation values) for a given state of our system. For simplicity, you can use the [SparsePauliOp class](https://docs.quantum.ibm.com/api/qiskit/qiskit.quantum_info.SparsePauliOp) in Qiskit to define them, as illustrated in the following example."
171171
]
172172
},
173173
{
@@ -218,7 +218,7 @@
218218
},
219219
"source": [
220220
"<!-- vale IBMQuantum.Spelling = NO -->\n",
221-
"The next step is to create an instance of an `Estimator` class, which can be any of the subclasses that comply with the base specification. For simplicity, we will use Qiskit Terra's `qiskit.primitives.Estimator` class, based on the [Statevector construct](https://qiskit.org/documentation/stubs/qiskit.quantum_info.Statevector.html?highlight=statevector#qiskit.quantum_info.Statevector) (algebraic simulation).\n",
221+
"The next step is to create an instance of an `Estimator` class, which can be any of the subclasses that comply with the base specification. For simplicity, we will use Qiskit Terra's `qiskit.primitives.Estimator` class, based on the [Statevector construct](https://docs.quantum.ibm.com/api/qiskit/qiskit.quantum_info.Statevector) (algebraic simulation).\n",
222222
"<!-- vale IBMQuantum.Spelling = YES -->"
223223
]
224224
},
@@ -551,7 +551,7 @@
551551
"source": [
552552
"Since Qiskit Runtime `Estimator` is a managed service, you will first need to initialize your account. You can then select the simulator or real backend you want to use to calculate the expectation value.\n",
553553
"\n",
554-
"Follow the steps in the [getting started guide](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/getting_started.html) if you don't already have an account set up."
554+
"Follow the steps in the [set up documentation](https://docs.quantum.ibm.com/start/setup-channel) if you don't already have an account set up."
555555
]
556556
},
557557
{
@@ -788,7 +788,7 @@
788788
}
789789
},
790790
"source": [
791-
"You can use the [Options](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/stubs/qiskit_ibm_runtime.options.Options.html#qiskit_ibm_runtime.options.Options) class to specify different options."
791+
"You can use the [Options](https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.Options) class to specify different options."
792792
]
793793
},
794794
{
@@ -1044,7 +1044,7 @@
10441044
"\n",
10451045
"If you don't specify a timeout value, it is set to the initial job's maximum execution time and is the smaller of these values:\n",
10461046
"\n",
1047-
"- The system limit (see [What is the maximum execution time for a Qiskit Runtime job?](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/faqs/max_execution_time.html)).\n",
1047+
"- The system limit (see [What is the maximum execution time for a Qiskit Runtime job?](https://docs.quantum.ibm.com/run/max-execution-time)).\n",
10481048
"- The `max_execution_time` defined by the program.\n",
10491049
"\n",
10501050
"After this time limit is reached, the session is permanently closed."
@@ -1366,9 +1366,9 @@
13661366
"id": "bf0fe74a",
13671367
"metadata": {},
13681368
"source": [
1369-
"You can find more details about the ``Estimator`` methods in the [Estimator API reference](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/stubs/qiskit_ibm_runtime.Estimator.html#qiskit_ibm_runtime.Estimator).\n",
1369+
"You can find more details about the ``Estimator`` methods in the [Estimator API reference](https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.Estimator).\n",
13701370
"\n",
1371-
"And all the available options in the [Options API reference](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/stubs/qiskit_ibm_runtime.options.Options.html#qiskit_ibm_runtime.options.Options)."
1371+
"And all the available options in the [Options API reference](https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.Options)."
13721372
]
13731373
},
13741374
{
@@ -1426,10 +1426,9 @@
14261426
}
14271427
],
14281428
"source": [
1429-
"from qiskit.tools.jupyter import *\n",
1429+
"import qiskit\n",
14301430
"\n",
1431-
"%qiskit_version_table\n",
1432-
"%qiskit_copyright"
1431+
"qiskit.version.get_version_info()"
14331432
]
14341433
}
14351434
],

docs/tutorials/how-to-getting-started-with-sampler.ipynb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747
},
4848
"source": [
49-
"[Primitives](https://qiskit.org/ecosystem/ibm-runtime/primitives.html) are core functions that make it easier to build modular algorithms and applications. \n",
49+
"[Primitives](https://docs.quantum.ibm.com/run/primitives) are core functions that make it easier to build modular algorithms and applications. \n",
5050
"\n",
5151
"The initial release of Qiskit Runtime includes two primitives:\n",
5252
"\n",
@@ -115,7 +115,7 @@
115115
}
116116
},
117117
"source": [
118-
"You will need at least one quantum circuit to prepare our system in a precise quantum state for study. Our examples all have circuits in them, but you can use Qiskit to create your own. To learn how to create circuits by using Qiskit, see the [Circuit basics tutorial](https://qiskit.org/documentation/tutorials/circuits/01_circuit_basics.html)."
118+
"You will need at least one quantum circuit to prepare our system in a precise quantum state for study. Our examples all have circuits in them, but you can use Qiskit to create your own. To learn how to create circuits by using Qiskit, see the [circuit construction documentation](https://docs.quantum.ibm.com/build/circuit-construction)."
119119
]
120120
},
121121
{
@@ -492,7 +492,7 @@
492492
"source": [
493493
"Since Qiskit Runtime `Sampler` is a managed service, you will first need to initialize your account. You can then select the simulator or real backend you want to use to calculate the expectation value.\n",
494494
"\n",
495-
"Follow the steps in the [getting started guide](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/getting_started.html) if you don't already have an account set up."
495+
"Follow the steps in the [setup guide](https://docs.quantum.ibm.com/start/setup-channel) if you don't already have an account set up."
496496
]
497497
},
498498
{
@@ -719,7 +719,7 @@
719719
}
720720
},
721721
"source": [
722-
"You can use the [Options](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/stubs/qiskit_ibm_runtime.options.Options.html#qiskit_ibm_runtime.options.Options) class to specify different options."
722+
"You can use the [Options](https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.Options) class to specify different options."
723723
]
724724
},
725725
{
@@ -973,7 +973,7 @@
973973
"\n",
974974
"If you don't specify a timeout value, it is set to the initial job's maximum execution time and is the smaller of these values:\n",
975975
"\n",
976-
"- The system limit (see [What is the maximum execution time for a Qiskit Runtime job?](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/faqs/max_execution_time.html)).\n",
976+
"- The system limit (see [What is the maximum execution time for a Qiskit Runtime job?](https://docs.quantum.ibm.com/run/max-execution-time)).\n",
977977
"- The `max_execution_time` defined by the program.\n",
978978
"\n",
979979
"After this time limit is reached, the session is permanently closed."
@@ -1305,9 +1305,9 @@
13051305
"id": "e5827c27",
13061306
"metadata": {},
13071307
"source": [
1308-
"You can find more details about the ``Sampler`` methods in the [Sampler API reference](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/stubs/qiskit_ibm_runtime.Sampler.html#qiskit_ibm_runtime.Sampler).\n",
1308+
"You can find more details about the ``Sampler`` methods in the [Sampler API reference](https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.Sampler).\n",
13091309
"\n",
1310-
"And all the available options in the [Options API reference](https://qiskit.org/documentation/partners/qiskit_ibm_runtime/stubs/qiskit_ibm_runtime.options.Options.html#qiskit_ibm_runtime.options.Options)."
1310+
"And all the available options in the [Options API reference](https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.Options)."
13111311
]
13121312
},
13131313
{
@@ -1365,10 +1365,9 @@
13651365
}
13661366
],
13671367
"source": [
1368-
"from qiskit.tools.jupyter import *\n",
1368+
"import qiskit\n",
13691369
"\n",
1370-
"%qiskit_version_table\n",
1371-
"%qiskit_copyright"
1370+
"qiskit.version.get_version_info()"
13721371
]
13731372
}
13741373
],

0 commit comments

Comments
 (0)