Skip to content

Rename run_options to options in fidelity and gradients and fidelity bug fix#8755

Merged
mergify[bot] merged 13 commits into
Qiskit:mainfrom
ElePT:rename-run-opts-fid-grad
Sep 23, 2022
Merged

Rename run_options to options in fidelity and gradients and fidelity bug fix#8755
mergify[bot] merged 13 commits into
Qiskit:mainfrom
ElePT:rename-run-opts-fid-grad

Conversation

@ElePT
Copy link
Copy Markdown
Contributor

@ElePT ElePT commented Sep 14, 2022

Summary

This PR follows the new naming convention applied in #8719 and renames run_options to options in the state_fidelities and gradients modules.

Details and comments

Additional changes in this PR:

  • changed the type hint from dict to Options in those files where it had not been applied already
  • added the _get_local_options() method to ComputeUncopute for consistency with the gradients
  • added the options property and update_default_options method to gradients and fidelities for consistency with the primitives
  • updated unit tests for options in gradients and fidelities
  • 2 minor bug fixes in ComputeUncopute. It now:
    - checks for existing measurements in input circuits and removes measurements before composing them
    - accepts empty parameter value list ([ ]) on top of None for unparametrized circuits.
  • added corresponding unit tests for these fixes

@ElePT ElePT requested review from a team, manoelmarques and woodsp-ibm as code owners September 14, 2022 15:46
@qiskit-bot
Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

@woodsp-ibm woodsp-ibm added mod: algorithms mod: primitives Related to the Primitives module labels Sep 14, 2022
@woodsp-ibm woodsp-ibm added this to the 0.22 milestone Sep 14, 2022
Comment thread qiskit/algorithms/state_fidelities/base_state_fidelity.py Outdated
Comment thread qiskit/algorithms/state_fidelities/base_state_fidelity.py Outdated
Comment thread qiskit/algorithms/state_fidelities/compute_uncompute.py Outdated
@ElePT ElePT changed the title Rename run_options to options in fidelity and gradients Rename run_options to options in fidelity and gradients and fidelity bug fix Sep 15, 2022
@coveralls
Copy link
Copy Markdown

coveralls commented Sep 15, 2022

Pull Request Test Coverage Report for Build 3115925932

  • 92 of 92 (100.0%) changed or added relevant lines in 15 files are covered.
  • 17 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.03%) to 84.392%

Files with Coverage Reduction New Missed Lines %
src/optimize_1q_gates.rs 1 95.16%
qiskit/extensions/quantum_initializer/squ.py 2 79.78%
src/results/marginalization.rs 14 79.89%
Totals Coverage Status
Change from base Build 3115923974: 0.03%
Covered Lines: 59438
Relevant Lines: 70431

💛 - Coveralls

@a-matsuo a-matsuo mentioned this pull request Sep 15, 2022
1 task
Comment thread test/python/algorithms/state_fidelities/test_compute_uncompute.py
Comment thread test/python/algorithms/state_fidelities/test_compute_uncompute.py
@woodsp-ibm woodsp-ibm added the Changelog: None Do not include in the GitHub Release changelog. label Sep 23, 2022
@mergify mergify Bot merged commit 2cd56f4 into Qiskit:main Sep 23, 2022
ElePT added a commit to ElePT/qiskit that referenced this pull request Jun 27, 2023
…bug fix (Qiskit#8755)

* Rename run_options to options

* Update qiskit/algorithms/state_fidelities/base_state_fidelity.py

* Update qiskit/algorithms/state_fidelities/base_state_fidelity.py

* Update qiskit/algorithms/state_fidelities/compute_uncompute.py

* Fix bug

* Fix measurements, empty list

* Add check empty list

* Update test/python/algorithms/state_fidelities/test_compute_uncompute.py

* Update test/python/algorithms/state_fidelities/test_compute_uncompute.py

* Fix black

* Add options properties

* fix unit tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT added a commit to ElePT/qiskit-algorithms-test that referenced this pull request Jul 17, 2023
…bug fix (Qiskit/qiskit#8755)

* Rename run_options to options

* Update qiskit/algorithms/state_fidelities/base_state_fidelity.py

* Update qiskit/algorithms/state_fidelities/base_state_fidelity.py

* Update qiskit/algorithms/state_fidelities/compute_uncompute.py

* Fix bug

* Fix measurements, empty list

* Add check empty list

* Update test/python/algorithms/state_fidelities/test_compute_uncompute.py

* Update test/python/algorithms/state_fidelities/test_compute_uncompute.py

* Fix black

* Add options properties

* fix unit tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: None Do not include in the GitHub Release changelog. mod: primitives Related to the Primitives module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants