diff --git a/.pylintdict b/.pylintdict index f4d90d78..245f309e 100644 --- a/.pylintdict +++ b/.pylintdict @@ -148,6 +148,7 @@ hyperparameters idx im imag +init initializer inplace interatomic diff --git a/qiskit_algorithms/optimizers/gradient_descent.py b/qiskit_algorithms/optimizers/gradient_descent.py index 0f79abb1..6051c379 100644 --- a/qiskit_algorithms/optimizers/gradient_descent.py +++ b/qiskit_algorithms/optimizers/gradient_descent.py @@ -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: