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

docs: clarify method purpose #13312

Merged
merged 2 commits into from
Oct 14, 2024
Merged

docs: clarify method purpose #13312

merged 2 commits into from
Oct 14, 2024

Conversation

boonware
Copy link
Contributor

@boonware boonware commented Oct 11, 2024

Summary

Fixes #13051.

Details and comments

Update the doc string for the Pauli operator method conjugate to clarify that it returns the complex conjugate and not the conjugate transpose.

@boonware boonware requested a review from a team as a code owner October 11, 2024 12:03
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Oct 11, 2024
@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 following people are relevant to this code:

  • @Qiskit/terra-core

@CLAassistant
Copy link

CLAassistant commented Oct 11, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks for looking at this.

I think we'll maybe need a little bit more detail than this to properly describe the function. The complex conjugate of an arbitrary linear operator is only defined with regards to a particular matrix representation (unlike the adjoint, which is what this method was confused with), so I think we should highlight that here. (For example, if we use the $Y$-eigenstate basis, then $Y$ is real-valued and $X$ and $Z$ are complex instead.) It's sufficient to say that the conjugation is defined in terms of the matrix returned by to_matrix, or we can add a short comment that it's the matrix expressed in the $Z$-eigenstate basis.

@boonware
Copy link
Contributor Author

Thanks for looking at this.

I think we'll maybe need a little bit more detail than this to properly describe the function. The complex conjugate of an arbitrary linear operator is only defined with regards to a particular matrix representation (unlike the adjoint, which is what this method was confused with), so I think we should highlight that here. (For example, if we use the Y -eigenstate basis, then Y is real-valued and X and Z are complex instead.) It's sufficient to say that the conjugation is defined in terms of the matrix returned by to_matrix, or we can add a short comment that it's the matrix expressed in the Z -eigenstate basis.

@jakelishman Thanks for the feedback. I have updated the comment.

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@jakelishman jakelishman enabled auto-merge October 14, 2024 16:34
@jakelishman jakelishman added documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Oct 14, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11331375663

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 560 unchanged lines in 18 files lost coverage.
  • Overall coverage increased (+0.01%) to 88.666%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/accelerate/src/error_map.rs 1 85.42%
crates/accelerate/src/barrier_before_final_measurement.rs 2 97.33%
crates/circuit/src/bit_data.rs 2 94.62%
crates/accelerate/src/commutation_checker.rs 2 97.14%
crates/accelerate/src/circuit_library/quantum_volume.rs 3 95.04%
crates/qasm2/src/lex.rs 4 91.98%
crates/accelerate/src/results/marginalization.rs 7 90.17%
crates/circuit/src/circuit_instruction.rs 8 76.04%
crates/accelerate/src/target_transpiler/mod.rs 8 79.11%
Totals Coverage Status
Change from base Build 11277520565: 0.01%
Covered Lines: 73197
Relevant Lines: 82554

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Oct 14, 2024
Merged via the queue into Qiskit:main with commit efdcb75 Oct 14, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Oct 14, 2024
* docs: clarify method

* docs: improve comment

(cherry picked from commit efdcb75)
github-merge-queue bot pushed a commit that referenced this pull request Oct 14, 2024
* docs: clarify method

* docs: improve comment

(cherry picked from commit efdcb75)

Co-authored-by: J. Harte <[email protected]>
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 changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Clarify docstring: Pauli-types conjugate() is complex conjugate, not Hermitian conjugate
5 participants