Skip to content

Commit

Permalink
Fixes so link check passes in CI for latest version (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
woodsp-ibm authored Jul 12, 2024
1 parent 3fb69b3 commit e0c63ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
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

0 comments on commit e0c63ec

Please sign in to comment.