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

Expand docstrings for annotated flag on control() and inverse() #11749

Merged
merged 6 commits into from
Feb 12, 2024

Conversation

ElePT
Copy link
Contributor

@ElePT ElePT commented Feb 8, 2024

Summary

Documents annotated argument for inverse() in all gates in the standard library that provider their own implementation. I found that control() was already documented, but I made sure the types were indicated in the signature instead of the args. definition to make @Cryoris happy (unfortunately there is still quite a lot of inconsistency documenting the types).

Details and comments

Addresses #11707.

I only looked for gates in the standard library, if you know of any other affected gates, let me know and I can add them to the PR.

@ElePT ElePT added documentation Something is not clear or an error documentation Changelog: None Do not include in changelog labels Feb 8, 2024
@ElePT ElePT requested a review from a team as a code owner February 8, 2024 10:49
@qiskit-bot
Copy link
Collaborator

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

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia

@coveralls
Copy link

coveralls commented Feb 8, 2024

Pull Request Test Coverage Report for Build 7869598198

Details

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

Files with Coverage Reduction New Missed Lines %
qiskit/circuit/library/standard_gates/x.py 1 98.07%
crates/qasm2/src/lex.rs 4 91.69%
Totals Coverage Status
Change from base Build 7837327418: 0.01%
Covered Lines: 58836
Relevant Lines: 65943

💛 - Coveralls

@ElePT ElePT added this to the 1.0.0 milestone Feb 8, 2024
Copy link
Member

@mtreinish mtreinish 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 doing this it's a great improvement. I have one inline wording suggestion that applied to all the uses of annotated on every standard library gate class so it's repeated for each inverse() method.

@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Feb 8, 2024
ElePT and others added 2 commits February 9, 2024 14:00
Apply suggestions from Matt's code review

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@ElePT
Copy link
Contributor Author

ElePT commented Feb 9, 2024

Thanks for taking the time to write all the suggestions, I had to format them a bit to make lint happy, but I took it as a chance to double-check that the messages make sense for the corresponding gates.

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

Oops, look like I missed a few spots in my earlier review.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Copy link
Member

@mtreinish mtreinish 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 applying the updates

@mtreinish mtreinish added this pull request to the merge queue Feb 12, 2024
Merged via the queue into Qiskit:main with commit 381a8d9 Feb 12, 2024
12 checks passed
mergify bot pushed a commit that referenced this pull request Feb 12, 2024
…11749)

* Add annotated

* Add returns

* Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

Apply suggestions from Matt's code review

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Format suggestions

* Fix lint

* Apply last round of suggestions

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
(cherry picked from commit 381a8d9)
github-merge-queue bot pushed a commit that referenced this pull request Feb 12, 2024
…11749) (#11774)

* Add annotated

* Add returns

* Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

Apply suggestions from Matt's code review

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Format suggestions

* Fix lint

* Apply last round of suggestions

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
(cherry picked from commit 381a8d9)

Co-authored-by: Elena Peña Tapia <57907331+ElePT@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 changelog 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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants