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

SamplerV2 options #1223

Merged
merged 43 commits into from
Nov 16, 2023
Merged

SamplerV2 options #1223

merged 43 commits into from
Nov 16, 2023

Conversation

jyu00
Copy link
Collaborator

@jyu00 jyu00 commented Nov 16, 2023

Summary

Similar to #1221 but for Sampler.

This also introduces SamplerV2 which has its own options different from V1.

Details and comments

Fixes #

jyu00 and others added 30 commits September 20, 2023 18:44
* add options

* fix mypy

* rename meas err mit

* Add additional resilience options

* Add additional execution options for twirling

* A twirling strategy option and validation

* handle default resilience options

* add _experimental

* Update default resilience options (Qiskit#1062)

* remove default resilience options

* add reno

* add logic to override default

* add test

* purge None values from options

(cherry picked from commit 76603f2)

* add finalize options

* add tests

* Update qiskit_ibm_runtime/options/resilience_options.py

* add validation

* lint

* lint again

* lint again

* Allow None values for specific options to be passed through

* Fix parameter validation, allow computational basis

* black

* Fix ZneExtrapolatorType validation

* lint

* lint again

* fix mypy

* Fix ZNE extrapolator default option

* fix level options

* black

* use _isreal

* Disable gate twirling for default lvl 1 opts

* Support for legacy options

---------

Co-authored-by: Christopher J. Wood <[email protected]>
Co-authored-by: Kevin Tian <[email protected]>
Co-authored-by: mberna <[email protected]>
Co-authored-by: Mariana C Bernagozzi <[email protected]>
* Remove min execution time check (Qiskit#1065)

* Remove min execution time check

* update unit test

* remove integration test

* Update `max_execution_time` docstrings (Qiskit#1059)

* Update max_execution_time docstrings

* add commas

* Update qiskit_ibm_runtime/options/options.py

Co-authored-by: Rebecca Dimock <[email protected]>

* Update qiskit_ibm_runtime/options/options.py

Co-authored-by: Rebecca Dimock <[email protected]>

* Update qiskit_ibm_runtime/runtime_options.py

Co-authored-by: Rebecca Dimock <[email protected]>

* Update releasenotes/notes/max-execution-time-definition-196cb6297693c0f2.yaml

Co-authored-by: Rebecca Dimock <[email protected]>

---------

Co-authored-by: Rebecca Dimock <[email protected]>

* Removed remaining code related to Schedules (Qiskit#1068)

Co-authored-by: Kevin Tian <[email protected]>

* Enable datetime parameter for backend properties (Qiskit#1070)

* enable datetime param for backend properties

* add test & reno

* improve test

* Update default resilience options (Qiskit#1062)

* remove default resilience options

* add reno

* add logic to override default

* add test

* purge None values from options

* fix test (Qiskit#1074)

* Prepare release 0.12.1 (Qiskit#1075)

* Update main branch veresion 0.12.2 (Qiskit#1076)

* use ibmq_qasm_simulator (Qiskit#1078)

* Add reason code to error message (Qiskit#1072)

* Add reason code to error message

* add reno

* Remove importing PauliSumOp, which is deprecated. (Qiskit#1079)

---------

Co-authored-by: Jake Lishman <[email protected]>
Co-authored-by: Kevin Tian <[email protected]>

* Adjusts default value for optimization_level (Qiskit#1082)

* add instance info (Qiskit#1083)

* add instance info

* Add cloud note

* Update README.md

Co-authored-by: Kevin Tian <[email protected]>

---------

Co-authored-by: Kevin Tian <[email protected]>

* Fix links to options in README.md (Qiskit#1084)

* Remove auth parameter (Qiskit#1077)

* Removed auth parameter

* Removed calls to migrate()

* black and lint

---------

Co-authored-by: Kevin Tian <[email protected]>

* Remove opflow and algorithms from serialization tests (Qiskit#1085)

* Remove opflow from tests

* Re-add test for PauliSumOp

* Fix lint

* Fix black

---------

Co-authored-by: Kevin Tian <[email protected]>

* RuntimeJobTimeoutError should inherit from JobTimeoutError (Qiskit#1090)

* RuntimeJobTimeoutError inherits from JobTimeoutError

* black

---------

Co-authored-by: Kevin Tian <[email protected]>

* Allow user to define a default account as an environment variable (Qiskit#1018)

* Allow user to define a default account as an environment variable

* Fixed test

* Fixed mistaken paste

* Cleaned up test

* Moved test to TestAccountManager

* Added ability to define default channel in save_account

* Cleaned up code, fixed bugs

* Changed name of parameter

* Added test. Cleaned up code surrounding preferences of channel selection

* black and lint

* Fixed bug when json file was empty

* Code cleanup and documentation

* Documentation

* Removed channel from condition, because unnecessary

* changed default_channel to default_account

* Changed saving and getting default channel to default account

* black

* Documentation

* Release notes

* Reverted diff that was unnecessary

---------

Co-authored-by: Kevin Tian <[email protected]>

* Skip test_job_logs (Qiskit#1094)

* Update session max_time docstring (Qiskit#1089)

* Update session max_time docstring

* Update qiskit_ibm_runtime/session.py

Co-authored-by: Rebecca Dimock <[email protected]>

---------

Co-authored-by: Rebecca Dimock <[email protected]>

* Fix unit tests against qiskit/main (Qiskit#1099)

* Add measurements to sampler

* Remove observables from sampler run

---------

Co-authored-by: Kevin Tian <[email protected]>

* fix iqp link (Qiskit#1096)

Co-authored-by: Kevin Tian <[email protected]>

* Only return channel strategy supported backends  (Qiskit#1095)

* Q-CTRL Backend filters

* add reno

* fix unit tests

* Attempt to fix terra unit tests (Qiskit#1102)

* Attempt to fix terra unit tests

* test on my fork

* revert coder_qc change

* Making account code more generic  (Qiskit#1060)

* Making account code more generic by defining subclasses for channel types

* Removed channel parameter from _assert_valid_instance

* mypy, lint and black

* Changed order of decorators

* Code cleanup

* Documentation fixes

* black

---------

Co-authored-by: Kevin Tian <[email protected]>

* Remove old deprecations (Qiskit#1106)

* removing old deprecations

* update unit tests

* Open plan updates (Qiskit#1105)

* Initial edits

* edit

* Update docs/faqs/max_execution_time.rst

* Update docs/faqs/max_execution_time.rst

* Update docs/faqs/max_execution_time.rst

* Update docs/faqs/max_execution_time.rst

* Update docs/faqs/max_execution_time.rst

* Update docs/faqs/max_execution_time.rst

Co-authored-by: Jessie Yu <[email protected]>

* Jessie comments

* Update docs/faqs/max_execution_time.rst

Co-authored-by: Jessie Yu <[email protected]>

* Update docs/faqs/max_execution_time.rst

Co-authored-by: Jessie Yu <[email protected]>

* Update docs/sessions.rst

* Update docs/faqs/max_execution_time.rst

---------

Co-authored-by: Jessie Yu <[email protected]>

* New method to create a new Session object with a given id (Qiskit#1101)

* Added the Session.from_id method

* release notes

* Added integration test

---------

Co-authored-by: Kevin Tian <[email protected]>

* fix test_session_from_id (Qiskit#1110)

* Warn users if job submitted will exceed quota (Qiskit#1100)

* Warn users if job will exceed quota

* update reno

* update reno again

* Removed support for backend as session parameter (Qiskit#1091)

Co-authored-by: Kevin Tian <[email protected]>

* Fix minor todos (Qiskit#1112)

* Change qpu complex wording (Qiskit#1109)

* Don't use QPU complex

* don't use the word 'limit'

* Update docs/faqs/max_execution_time.rst

* Update qiskit_ibm_runtime/options/options.py

* Update qiskit_ibm_runtime/runtime_job.py

* Update releasenotes/notes/0.11/job-cost-estimation-d0ba83dbc95c3f67.yaml

* Clarify usage

* reclarify reset time

* rogue comma

* fix whitespace & formatting

* job -> system execution time

---------

Co-authored-by: Kevin Tian <[email protected]>

* Add IBM Cloud channel (Qiskit#1113)

* Changes for Qiskit#1806

* Update docs/faqs/max_execution_time.rst

Co-authored-by: Jessie Yu <[email protected]>

---------

Co-authored-by: Kevin Tian <[email protected]>
Co-authored-by: Jessie Yu <[email protected]>
Co-authored-by: Kevin Tian <[email protected]>

* Prepare release 0.12.2 (Qiskit#1115)

* Update main branch 0.13.0 (Qiskit#1116)

* remove error message test (Qiskit#1125)

* Exceptions should inherit from Terra where suitable (Qiskit#1120)

* Changed RuntimeJobFailureError to inherit from JobError

* Changed error type

---------

Co-authored-by: Kevin Tian <[email protected]>

* update docstring & remove max_time (Qiskit#1137)

* Expose new session details  (Qiskit#1119)

* add session details method

* add reno

* support iqp urls

* update details mehotd, add status()

* update status() to use enum

* revert previous change, wait for impl details

* update fields returned

* update status method

* update docstring & reno

* update docstrings for both methods

* fix docs build

* address comments

* fix docs build

* fix typo

* docs build again

* fix indent

* fix indent again

* fix indent 3rd time

* Support only LocalFoldingAmplifier as noise_amplifier option (Qiskit#1093)

* Removed support for all noise_amplifier options other than LocalFoldingAmplifier. Removed deprecation warning.

* Removed tests that covered deprecation. Updated documentation

---------

Co-authored-by: Kevin Tian <[email protected]>

* Fix target_history date bug  (Qiskit#1143)

* fix target_history datetime bug

* add reno

* add test

* Fixed bug when defining shots as int64 (Qiskit#1151)

* Log instance on initialization and when running a job (Qiskit#1150)

* log instances

* add _default_instance & fix lint

* add test

* change var name to current_instance

* Move methods into class pages for docs (Qiskit#1144)

* Fix link to `Close a session` (Qiskit#1152)

[1] links to [2] but doesn't go directly to the target section.

[1] https://qiskit.org/ecosystem/ibm-runtime/sessions.html#what-happens-when-a-session-ends
[2] https://qiskit.org/ecosystem/ibm-runtime/how_to/run_session.html#close-a-session

Co-authored-by: Kevin Tian <[email protected]>

* logging instance test is IQP channel only (Qiskit#1154)

* Update deploy yml (Qiskit#1148)

* Allow users to indicate they are done submitting jobs to a session (Qiskit#1139)

* copy changes over

* clean up branch again

* address comments, update docstrings

* catch appropriate error code

* update status code to 404

* Update qiskit_ibm_runtime/session.py

Co-authored-by: Jessie Yu <[email protected]>

* set self._active & remove runtime_session

* Update releasenotes/notes/session-accepting-jobs-d7ef6b60c0f5527b.yaml

Co-authored-by: Jessie Yu <[email protected]>

---------

Co-authored-by: Jessie Yu <[email protected]>

* Prepare release 0.13 (Qiskit#1157)

* Update main branch 0.13.1 (Qiskit#1158)

* Update Sphinx theme (Qiskit#1156)

Co-authored-by: Kevin Tian <[email protected]>

* Added IBM Quantum logo (Qiskit#1164)

* sessions changes (Qiskit#1169)

* sessions changes

* add more ticks

* fix link

* fix links

* Update docs/sessions.rst

Co-authored-by: abbycross <[email protected]>

* Update docs/sessions.rst

Co-authored-by: abbycross <[email protected]>

---------

Co-authored-by: abbycross <[email protected]>

* Disallow unsupported options (Qiskit#1108)

* Disallow unsupported options

* Moved checking of unsupported options to 'flexible' decorator

* Modified the test to give TypeError where needed

* Removed empty newline

* Moved tests from test_ibm_primitives to test_options, because they don't require a primitive

* typo

* Release note

* black and lint

* black again

* Fixed test failing in CI

* Removed _flexible decorator. Moved _post_init into Options class

* lint

* lint

* Fixed bug

* lint

---------

Co-authored-by: Kevin Tian <[email protected]>

* fix merge issues

* black

* lint

---------

Co-authored-by: Kevin Tian <[email protected]>
Co-authored-by: Rebecca Dimock <[email protected]>
Co-authored-by: merav-aharoni <[email protected]>
Co-authored-by: Luciano Bello <[email protected]>
Co-authored-by: Jake Lishman <[email protected]>
Co-authored-by: Esteban Ginez <[email protected]>
Co-authored-by: Kevin Tian <[email protected]>
Co-authored-by: mberna <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Arnau Casau <[email protected]>
Co-authored-by: Matt Riedemann <[email protected]>
Co-authored-by: abbycross <[email protected]>
@jyu00 jyu00 requested review from mberna and kt474 November 16, 2023 19:00
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6895251331

  • 115 of 119 (96.64%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.0%) to 60.052%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/sampler.py 25 26 96.15%
qiskit_ibm_runtime/qiskit/primitives/base_sampler.py 28 31 90.32%
Totals Coverage Status
Change from base Build 6895093007: 1.0%
Covered Lines: 3020
Relevant Lines: 5029

💛 - Coveralls

@jyu00 jyu00 merged commit b73fdac into Qiskit:experimental-0.2 Nov 16, 2023
17 checks passed
@kt474 kt474 mentioned this pull request Jan 5, 2024
3 tasks
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.

3 participants