From e45a762d8798e0887994da79d5e0faa9d95c8ad1 Mon Sep 17 00:00:00 2001 From: Nicolas Renaud Date: Wed, 1 Nov 2023 17:32:52 +0100 Subject: [PATCH] pylint --- vqls_prototype/matrix_decomposition/matrix_decomposition.py | 3 ++- .../matrix_decomposition/optimized_matrix_decomposition.py | 2 +- vqls_prototype/solver/log.py | 4 ++-- vqls_prototype/solver/qst_vqls.py | 2 -- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/vqls_prototype/matrix_decomposition/matrix_decomposition.py b/vqls_prototype/matrix_decomposition/matrix_decomposition.py index 7c77a78..915a080 100644 --- a/vqls_prototype/matrix_decomposition/matrix_decomposition.py +++ b/vqls_prototype/matrix_decomposition/matrix_decomposition.py @@ -474,7 +474,8 @@ def load(self, filename) -> None: filename (str): name of the file """ pauli_strings, coeffs = np.load(filename) - self.strings + self.strings = pauli_strings + self.coefficient = coeffs self.circuits = [] for pauli_string in self.strings: self.circuits.append(self._create_circuit(pauli_string)) diff --git a/vqls_prototype/matrix_decomposition/optimized_matrix_decomposition.py b/vqls_prototype/matrix_decomposition/optimized_matrix_decomposition.py index 8253703..c71caff 100644 --- a/vqls_prototype/matrix_decomposition/optimized_matrix_decomposition.py +++ b/vqls_prototype/matrix_decomposition/optimized_matrix_decomposition.py @@ -2,7 +2,7 @@ import itertools from dataclasses import dataclass from collections import OrderedDict -from typing import Optional, Union, List, Tuple, TypeVar +from typing import Optional, Union, List, TypeVar from qiskit.quantum_info import SparsePauliOp import numpy as np import numpy.typing as npt diff --git a/vqls_prototype/solver/log.py b/vqls_prototype/solver/log.py index 8207fe5..7ff379e 100644 --- a/vqls_prototype/solver/log.py +++ b/vqls_prototype/solver/log.py @@ -8,8 +8,8 @@ class VQLSLog: values: List parameters: List - def update( + def update( # pylint: disable=unused-argument self, count: int, cost: float, parameters: np.ndarray - ) -> None: # pylint: disable=unused-argument + ) -> None: self.values.append(cost) self.parameters.append(parameters) diff --git a/vqls_prototype/solver/qst_vqls.py b/vqls_prototype/solver/qst_vqls.py index e59aec2..5923d4b 100644 --- a/vqls_prototype/solver/qst_vqls.py +++ b/vqls_prototype/solver/qst_vqls.py @@ -26,8 +26,6 @@ VariationalLinearSolverResult, ) -from ..matrix_decomposition.matrix_decomposition import MatrixDecomposition - from ..matrix_decomposition.optimized_matrix_decomposition import ( ContractedPauliDecomposition, )