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

Fix bad indentation and missing hyphen on vqd.py #12162

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

arnaucasau
Copy link
Contributor

@arnaucasau arnaucasau commented Apr 9, 2024

This little PR fixes the docs of two attributes of qiskit/algorithms/eigensolvers/vqd.py

The attribute optimizer had bad indentation and was split between two bullet points in the list of attributes.

Captura desde 2024-04-08 18-56-13

The attribute initial_point was missing a hyphen.

Screenshot 2024-04-09 at 14 40 10

This issue is tracked by Qiskit/documentation#1120

@arnaucasau arnaucasau requested review from woodsp-ibm, ElePT and a team as code owners April 9, 2024 12:43
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Apr 9, 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 the following people are requested to review this:

  • @Qiskit/terra-core

@Eric-Arellano Eric-Arellano added this to the 0.46.2 milestone Apr 9, 2024
Eric-Arellano
Eric-Arellano previously approved these changes Apr 9, 2024
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.

Wow, I had forgotten that qiskit.algorithms was still there in qiskit 0.46. I should probably check and see if the same issue is present in the VQD class of qiskit-algorithms. I found a way to fix the lint complaint, but qiskit-neko is always a bit of a mess with 0.46. I think that this might need to be fixed on the neko side, it might be worth looking into how other PRs against 0.46 handle it (Edit: or we can just move on, given that it's not part of the branch protection rules).

that takes an array as input and returns a Qiskit or SciPy optimization result.
k (int): the number of eigenvalues to return. Returns the lowest k eigenvalues.
betas (list[float]): Beta parameters in the VQD paper.
Should have length k - 1, with k the number of excited states.
These hyper-parameters balance the contribution of each overlap term to the cost
function and have a default value computed as the mean square sum of the
coefficients of the observable.
initial point (Sequence[float] | Sequence[Sequence[float]] | None): An optional initial
initial_point (Sequence[float] | Sequence[Sequence[float]] | None): An optional initial
Copy link
Contributor

@ElePT ElePT Apr 9, 2024

Choose a reason for hiding this comment

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

Now that the initial point's attribute name is correct, sphinx complains that it shows up both here and as a property. You can just remove lines 170 - 178.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ElePT this was a bad change. It's removing actual code that will impact runtime behavior. The better fix is to delete this line of the docs and not mess with the code.

@@ -102,11 +102,6 @@ class VQD(VariationalAlgorithm, Eigensolver):
These hyper-parameters balance the contribution of each overlap term to the cost
function and have a default value computed as the mean square sum of the
coefficients of the observable.
initial_point (Sequence[float] | Sequence[Sequence[float]] | None): An optional initial
Copy link
Contributor Author

@arnaucasau arnaucasau Apr 9, 2024

Choose a reason for hiding this comment

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

Docs for the attribute removed 👍 We can still find the same description under the Args section (line 140) and we shouldn't have the warning. Thank you both for the review!

@arnaucasau
Copy link
Contributor Author

@ElePT it seems like qiskit-algorithms has the same issue. I can fix it there too when this PR is merged 👍

@Eric-Arellano Eric-Arellano enabled auto-merge April 9, 2024 17:49
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.

Nice, thanks a lot for the effort, LGTM.

@Eric-Arellano Eric-Arellano added this pull request to the merge queue Apr 10, 2024
Merged via the queue into Qiskit:stable/0.46 with commit 8a9cc82 Apr 10, 2024
10 of 11 checks passed
@raynelfss raynelfss added the Changelog: None Do not include in changelog label Jun 20, 2024
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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants