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

[work in progress] Clarify "conjugate" method purpose #13395

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

boonware
Copy link
Contributor

@boonware boonware commented Nov 5, 2024

Summary

Implements #13322

Details and comments

Below I have listed each conjugate method as returned by this search query, together with the reason why or why not the doc string has been updated.

  • AdjointMixin - Updated to reference only the complex conjugate, but I have not referenced the basis as this is an ABC. Precisely which basis depends on how the concrete class has implemented the abstract method.
  • SparsePauliOp - This class has a to_matrix method, so reference to this basis is made.
  • StabilizerState - The conjugate method returns the conjugate of the Clifford (operator) used to create the StabilizerState. As such, I have referenced the basis returned by the operator's to_matrix method.
  • Unitary - This class has a to_matrix method, so reference to this basis is made.
  • PauliList - Update the comment to reflect what is already in place for BasePauli.
  • StateVector - TODO
  • DensityMatrix - TODO

@boonware boonware requested a review from a team as a code owner November 5, 2024 10:56
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Nov 5, 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

@coveralls
Copy link

coveralls commented Nov 5, 2024

Pull Request Test Coverage Report for Build 11684304427

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.
  • 23 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.02%) to 88.791%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/unitary_synthesis.rs 1 92.2%
qiskit/primitives/backend_sampler_v2.py 2 98.53%
crates/qasm2/src/lex.rs 5 92.48%
crates/qasm2/src/parse.rs 6 97.62%
qiskit/primitives/backend_estimator.py 9 96.12%
Totals Coverage Status
Change from base Build 11669445061: 0.02%
Covered Lines: 76796
Relevant Lines: 86491

💛 - Coveralls

@eliarbel eliarbel added the documentation Something is not clear or an error documentation label Nov 5, 2024
@@ -123,7 +123,7 @@ def inverse(self, annotated: bool = False):
return self.adjoint()

def conjugate(self):
"""Return the conjugate of the unitary."""
"""Return the complex conjugate of the unitary with respect to the representation returned by ``to_matrix``."""
Copy link
Member

Choose a reason for hiding this comment

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

consider linking to the method:

Suggested change
"""Return the complex conjugate of the unitary with respect to the representation returned by ``to_matrix``."""
"""Return the complex conjugate of the unitary with respect to the representation returned by :meht:`~UnitaryGate.to_matrix`."""

@@ -291,6 +291,7 @@ def __setitem__(self, key, value):
# ---------------------------------------------------------------------

def conjugate(self):
"""Return the complex conjugate with respect to the representation returned by ``to_matrix``."""
Copy link
Member

Choose a reason for hiding this comment

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

consider linking to the method:

Suggested change
"""Return the complex conjugate with respect to the representation returned by ``to_matrix``."""
"""Return the complex conjugate with respect to the representation returned by :meth:`~SparsePauliOp.to_matrix`."""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PR PRs from contributors that are not 'members' of the Qiskit repo documentation Something is not clear or an error documentation
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants