diff --git a/qiskit_algorithms/linear_solvers/matrices/numpy_matrix.py b/qiskit_algorithms/linear_solvers/matrices/numpy_matrix.py index 9857498d..96a90d76 100644 --- a/qiskit_algorithms/linear_solvers/matrices/numpy_matrix.py +++ b/qiskit_algorithms/linear_solvers/matrices/numpy_matrix.py @@ -65,11 +65,6 @@ def __init__( self._evolution_time = None # makes sure the eigenvalues are contained in [0,1) self._matrix = None - # store parameters - self.num_state_qubits = int(np.log2(matrix.shape[0])) - self.tolerance = tolerance - self.evolution_time = evolution_time - self.matrix = matrix super().__init__( num_state_qubits=int(np.log2(matrix.shape[0])), tolerance=tolerance, @@ -77,6 +72,12 @@ def __init__( name=name, ) + # store parameters + self.num_state_qubits = int(np.log2(matrix.shape[0])) + self.tolerance = tolerance + self.evolution_time = evolution_time + self.matrix = matrix + @property def num_state_qubits(self) -> int: r"""The number of state qubits representing the state :math:`|x\rangle`. @@ -181,7 +182,6 @@ def _reset_registers(self, num_state_qubits: int) -> None: """ qr_state = QuantumRegister(num_state_qubits, "state") self.qregs = [qr_state] - self._qubits = qr_state[:] def _build(self) -> None: """Build the circuit"""