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

Fixes so link check passes in CI for latest version #186

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pylintdict
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ hyperparameters
idx
im
imag
init
initializer
inplace
interatomic
Expand Down
3 changes: 3 additions & 0 deletions qiskit_algorithms/optimizers/gradient_descent.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,11 @@ def tell(self, ask_data: AskData, tell_data: TellData) -> None:
"""
if np.shape(self.state.x) != np.shape(tell_data.eval_jac): # type: ignore[arg-type]
raise ValueError("The gradient does not have the correct dimension")
# pylint: disable=attribute-defined-outside-init
# Both x and stepsize get flagged as defined outside init since lint 3.2.5
self.state.x = self.state.x - next(self.state.learning_rate) * tell_data.eval_jac
self.state.stepsize = np.linalg.norm(tell_data.eval_jac) # type: ignore[arg-type,assignment]
# pylint: enable=attribute-defined-outside-init
self.state.nit += 1

def evaluate(self, ask_data: AskData) -> TellData:
Expand Down
Loading