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

Split QFI into QFI and QGT #9085

Merged
merged 21 commits into from
Jan 17, 2023
Merged

Split QFI into QFI and QGT #9085

merged 21 commits into from
Jan 17, 2023

Conversation

a-matsuo
Copy link
Contributor

@a-matsuo a-matsuo commented Nov 7, 2022

[skip ci]

Summary

Close #9052

This PR introduces QGT (Quantum Geometric Tensor) and split the current QFI into QFI and QGT. QFI will only calculate the real part of QGT with a coefficient, 4 as its definition.

Details and comments

@qiskit-bot
Copy link
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:

@coveralls
Copy link

coveralls commented Nov 7, 2022

Pull Request Test Coverage Report for Build 3938577892

  • 315 of 328 (96.04%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 84.829%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/algorithms/gradients/lin_comb_qgt.py 94 96 97.92%
qiskit/algorithms/gradients/utils.py 50 53 94.34%
qiskit/algorithms/gradients/base_qgt.py 103 107 96.26%
qiskit/algorithms/gradients/qfi.py 44 48 91.67%
Totals Coverage Status
Change from base Build 3937663064: -0.03%
Covered Lines: 65621
Relevant Lines: 77357

💛 - Coveralls

@woodsp-ibm woodsp-ibm added the mod: algorithms Related to the Algorithms module label Nov 9, 2022
@a-matsuo a-matsuo changed the title [WIP] Split QFI into QFI and QGT Split QFI into QFI and QGT Jan 12, 2023
@a-matsuo a-matsuo marked this pull request as ready for review January 12, 2023 11:24
Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, I mainly left comments on renamings from QFI -> QGT (there are some in the LinCombQGT missing, too) 🙂 Once the QFI is added as special case of the QGT and the tests keep passing, I think this is good 👍🏻

qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/lin_comb_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/lin_comb_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/qgt_result.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @a-matsuo for your hard work! I have added minor comments, mostly on docstrings, so they should be fairly easy to address.

qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/lin_comb_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/lin_comb_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/qgt_result.py Show resolved Hide resolved
qiskit/algorithms/gradients/utils.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
a-matsuo and others added 5 commits January 16, 2023 11:25
Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Julien Gacon <jul@zurich.ibm.com>
@a-matsuo
Copy link
Contributor Author

@Cryoris @ElePT Thank you so much for reviewing! I reflected all the comments in the codes.

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks almost good to merge, I left some short comments below 🙂

qiskit/algorithms/gradients/__init__.py Show resolved Hide resolved
qiskit/algorithms/gradients/__init__.py Show resolved Hide resolved
qiskit/algorithms/gradients/base_estimator_gradient.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_estimator_gradient.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/base_qgt.py Outdated Show resolved Hide resolved
qiskit/algorithms/gradients/lin_comb_qfi.py Outdated Show resolved Hide resolved
a-matsuo and others added 3 commits January 17, 2023 17:11
Co-authored-by: Julien Gacon <jul@zurich.ibm.com>
Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some minor final comments, but otherwise LGTM too!

qiskit/algorithms/gradients/lin_comb_qgt.py Outdated Show resolved Hide resolved
test/python/algorithms/gradients/test_qfi.py Outdated Show resolved Hide resolved
test/python/algorithms/gradients/test_qfi.py Outdated Show resolved Hide resolved
test/python/algorithms/gradients/test_qfi.py Outdated Show resolved Hide resolved
a-matsuo and others added 2 commits January 17, 2023 20:01
Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>
@a-matsuo
Copy link
Contributor Author

@Cryoris @ElePT Thank you so much for reviewing! Sorry for that I keep forgetting to change QFI to QGT or other way around.

Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@ElePT ElePT added automerge Changelog: New Feature Include in the "Added" section of the changelog labels Jan 17, 2023
@mergify mergify bot merged commit c89b66a into Qiskit:main Jan 17, 2023
ElePT added a commit to ElePT/qiskit that referenced this pull request Jun 27, 2023
* wip skelton

* add lin_comb_qgt

* reflected comments

Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Julien Gacon <jul@zurich.ibm.com>

* added unittests

* fix a copyright year

* fix

* fix doc

* added qfi as an entry point

* fix lint

* fix lint

* updated qfi

* reflected comments

Co-authored-by: Julien Gacon <jul@zurich.ibm.com>

* fix doc

* add qfi_result into init.py

* reflected comments

Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>

Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Julien Gacon <jul@zurich.ibm.com>
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
* wip skelton

* add lin_comb_qgt

* reflected comments

Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Julien Gacon <jul@zurich.ibm.com>

* added unittests

* fix a copyright year

* fix

* fix doc

* added qfi as an entry point

* fix lint

* fix lint

* updated qfi

* reflected comments

Co-authored-by: Julien Gacon <jul@zurich.ibm.com>

* fix doc

* add qfi_result into init.py

* reflected comments

Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>

Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Julien Gacon <jul@zurich.ibm.com>
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: New Feature Include in the "Added" section of the changelog mod: algorithms Related to the Algorithms module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split QFI into QFI and QGT
6 participants