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

Add commutator functions to quantum_info #9546

Merged
merged 16 commits into from
Mar 31, 2023

Conversation

ikkoham
Copy link
Contributor

@ikkoham ikkoham commented Feb 8, 2023

Summary

Add commutator functions to quantum_info.

Note that unlike opflow, it does not perform reduce (simplify) method. This is because LinearOp is not guaranteed to have a simplify method. Therefore, when calling it, users must explicitly simplify after the call if necessary.

Details and comments

@ikkoham ikkoham added Changelog: New Feature Include in the "Added" section of the changelog mod: quantum info Related to the Quantum Info module (States & Operators) labels Feb 8, 2023
@ikkoham ikkoham added this to the 0.24.0 milestone Feb 8, 2023
@ikkoham ikkoham requested a review from a team as a code owner February 8, 2023 06:20
@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 Feb 8, 2023

Pull Request Test Coverage Report for Build 4554653888

  • 42 of 42 (100.0%) changed or added relevant lines in 6 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.03%) to 85.378%

Files with Coverage Reduction New Missed Lines %
qiskit/extensions/quantum_initializer/squ.py 2 80.0%
crates/accelerate/src/sabre_swap/layer.rs 4 97.32%
Totals Coverage Status
Change from base Build 4552100985: 0.03%
Covered Lines: 67275
Relevant Lines: 78797

💛 - Coveralls

Copy link
Member

@mrossinek mrossinek left a comment

Choose a reason for hiding this comment

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

Just two minor observations but in general this LGTM 👍

qiskit/quantum_info/operators/utils.py Outdated Show resolved Hide resolved
@ikkoham
Copy link
Contributor Author

ikkoham commented Feb 22, 2023

Thank you very much for great suggestions. I improved codes.

mrossinek
mrossinek previously approved these changes Feb 24, 2023
Copy link
Member

@mrossinek mrossinek left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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.

Some minor comments and one question, otherwise LGTM too!

qiskit/quantum_info/operators/utils.py Outdated Show resolved Hide resolved
qiskit/quantum_info/operators/utils.py Outdated Show resolved Hide resolved
qiskit/quantum_info/operators/utils.py Outdated Show resolved Hide resolved
qiskit/quantum_info/operators/utils.py Outdated Show resolved Hide resolved
qiskit/quantum_info/operators/utils.py Outdated Show resolved Hide resolved
releasenotes/notes/add-commutator-96ef07433e8ca4e7.yaml Outdated Show resolved Hide resolved
qiskit/quantum_info/operators/utils.py Outdated Show resolved Hide resolved
Cryoris
Cryoris previously approved these changes Mar 23, 2023
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.

LGTM thanks for integrating the changes!

@Cryoris Cryoris enabled auto-merge March 23, 2023 14:22
@Cryoris Cryoris added this pull request to the merge queue Mar 31, 2023
Merged via the queue into Qiskit:main with commit b11a159 Mar 31, 2023
@ikkoham ikkoham deleted the quantum_info/commutator branch April 5, 2023 14:24
@ikkoham
Copy link
Contributor Author

ikkoham commented Apr 5, 2023

@Cryoris Thank you!

giacomoRanieri pushed a commit to giacomoRanieri/qiskit-terra that referenced this pull request Apr 16, 2023
* Add commutator functions to quantum_info

* clear reference

* add tests

* improve docs and rename arg

* improve type hint

* Apply suggestions from code review

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* split files

* fix test (rename args)

* rename var

* rename var

* Update docstring

* black

---------

Co-authored-by: Julien Gacon <gaconju@gmail.com>
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
* Add commutator functions to quantum_info

* clear reference

* add tests

* improve docs and rename arg

* improve type hint

* Apply suggestions from code review

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* split files

* fix test (rename args)

* rename var

* rename var

* Update docstring

* black

---------

Co-authored-by: Julien Gacon <gaconju@gmail.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: quantum info Related to the Quantum Info module (States & Operators)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants