Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast forward experimental-0.2 #1464

Merged
merged 103 commits into from
Mar 4, 2024
Merged

Conversation

jyu00
Copy link
Collaborator

@jyu00 jyu00 commented Mar 4, 2024

Summary

Hopefully the last one before the release!

Details and comments

Fixes #

ElePT and others added 30 commits November 16, 2023 12:07
)

* 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>
* try/except raw result truncation

* catch typeError

* revert try/except, use response.text

* update unit test
* Clean up/fix integration test

* Update test case

* Fix black
* 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()

* add deprecation warning

* add reno
* Revert "Update session.from_id() (Qiskit#1163)"

This reverts commit 8fa0472.

* add reno
* 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.

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>
* compare cloud instance with channel strategy

* fix unit tests

* error wording

---------

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>
* release notes

* fix release
* Add job.properties() method

* add reno
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.
* 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>
* 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>
* 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>
* wip debug wrong instance test

* enable integration test

* use backend names instead of obj
* don't block if backend not selected

* add reno

* add test
* add activated_at to session.details()

* add reno
…skit#1267)

* Revert "Don't block for the first job in a session (Qiskit#1170)"

This reverts commit f2e24e4.

* keep test
kt474 and others added 22 commits February 19, 2024 16:13
* 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

* Add reno

* update tests

* add test_run_after_cancel back

* remove max_time arg from Session

* Add max_time
* check coupling map

* restore stack level

* mypy

* remove layout check

* check width

* allow pulse gates

* add release note
* bug fix w retrieving fake backend

* Move test
* add warning if no backend provided

* add test and reno

* Update msg & add to base_primitive

* Update reno

* Update releasenotes/notes/require-cloud-backend-38a74144347c735d.yaml

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>

---------

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>
Even though we had the release note files, Reno was not including them.
* added .idea to .gitignore for Pycharm

* switched sphinx-ext-viewcode for sphinx-ext-linkcode

* remove leftover code from Azure

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>

* Update tox.ini

* remove leftover code from Azure part 2

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>

* change dashes to underscores

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>

* switch from qiskit to qiskit_ibm_runtime

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>

* remove leftover code from Azure part 3

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>

* final updates to determine_github_branch method

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>

* cha

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>

* added colon

* Fix issue with inherited methods

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Kevin Tian <kevin.tian@ibm.com>
### Summary
In recent PRs including my PR Qiskit#1431, the CI has been throwing several errors due to old versions of actions that are using node12 or node16 instead of node20. I updated the actions to use the latest versions which should eliminate the CI warnings.
* Handle control flow instructions in Target generation

This commit updates the convert_to_target() function that is used to
convert the API response objects used to describe a backend and generate
a Qiskit Target object from that to properly handle control flow
instructions. The supported control flow instructions are listed in the
`supported_instructions` field of the configuration payload. [1] This
commit updates the logic to look for the presence of known control flow
instruction names in that field and add them as appropriate to the
target as global variadic instructions to indicate to Qiskit's
transpiler and other Target object users that the backend supports the
instructions.

[1] https://github.com/Qiskit/ibm-quantum-schemas/blob/0231221082ec722cc31db09c0b41a25f441ac338/schemas/backend_configuration_schema.json#L165-L170

* Add release note

---------

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>
Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>
* A majority of these tutorials are already 1.0 ready, but were re-run to double-check

Additional changes include fixes for the ISA changes in Qiskit#794

* fix black/lint

* docs build

* fix docs build again

* docs build

---------

Co-authored-by: Kevin Tian <kevin.tian@ibm.com>
PR Qiskit#1347 added `setuptools` to `requirements-dev.txt` in an effort
to make `qiskit-ibm-runtime` work with Python 3.12.  However,
`qiskit_ibm_runtime/api/session.py` actually imports `pkg_resources`,
which is provided by setuptools, so really setuptools should have been
added to [`REQUIREMENTS`](https://github.com/Qiskit/qiskit-ibm-runtime/blob/e152d122782959a04ebf2330f776d4c4e309ad14/setup.py#L21)
in `setup.py` so that it is installed automatically for any downstream
users of Qiskit Runtime, too.

Better yet, however, is to drop this explicit dependency on setuptools,
since [`pkg_resources` is deprecated](https://setuptools.pypa.io/en/latest/pkg_resources.html)
in favor of `importlib`.  Hence, this PR migrates from `pkg_resources`
to `importlib.metadata` (there are a few more words about this
[here](googleapis/python-api-core#27 (comment))).

My investigation into this was prompted by us trying to add
Python 3.12 support to the circuit-knitting-toolbox
(Qiskit/qiskit-addon-cutting#429),
and seeing CI errors prompted by `qiskit-ibm-runtime`'s importing
of `pkg_resources`.

Co-authored-by: Kevin Tian <kevin.tian@ibm.com>
* Add fake backends for newer IBM backends

This commit adds news fake backend classes for the following newer IBM
backends: Algiers, Brisbane, Cusco, Kawasaki, Kyoto, Osaka, Peekskill, Quebec,
and Torino. This was done using a modified version of the qiskit script
to update backends [1] (to use qiskit-ibm-runtime instead of
qiskit-ibmq-provider). There is a standalone script adding this
functionality for this repo in Qiskit#1263.

[1] https://github.com/Qiskit/qiskit/blob/stable/0.46/tools/update_fake_backends.py

Fixes Qiskit#1421

* Remove unused import

* Add new backends to FakeProviderForBackendV2 too

* Don't forget FakeKyiv in docs or provider class

---------

Co-authored-by: Kevin Tian <kevin.tian@ibm.com>
* support dynamic circuits

* raise for abstract circuits

* lint

* fix test

* remove hard coded instructions

* check target is not none

* lint

* fix test

* check for error not warning

* bypass simulator
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jyu00 jyu00 requested review from kt474 and mberna March 4, 2024 20:01
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8146229614

Details

  • 151 of 151 (100.0%) changed or added relevant lines in 28 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 82.968%

Totals Coverage Status
Change from base Build 8142100720: 0.4%
Covered Lines: 5636
Relevant Lines: 6793

💛 - Coveralls

@jyu00 jyu00 merged commit 32b0dbc into Qiskit:experimental-0.2 Mar 4, 2024
20 checks passed
@jyu00 jyu00 deleted the ff-experimental branch March 4, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.