File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,15 +139,16 @@ def _entropy_components(
139139
140140 @staticmethod
141141 def _matrix_eigenvalues (matrix : np .ndarray ) -> np .ndarray :
142- """Compute eigenvalues of a real symmetric covariance matrix."""
143- matrix = np .asarray (matrix , dtype = float )
144-
145- if matrix .ndim != 2 or matrix .shape [0 ] != matrix .shape [1 ]:
146- raise ValueError (f"Expected square matrix, got shape={ matrix .shape } " )
142+ """Compute eigenvalues of a matrix.
147143
148- matrix = 0.5 * (matrix + matrix .T )
144+ Args:
145+ matrix: Input matrix.
149146
150- return la .eigvalsh (matrix )
147+ Returns:
148+ Eigenvalues as a NumPy array.
149+ """
150+ matrix = np .asarray (matrix , dtype = float )
151+ return la .eigvals (matrix )
151152
152153 def _convert_lambda_units (self , lambdas : np .ndarray ) -> np .ndarray :
153154 """Convert eigenvalues into SI units using run_manager.
You can’t perform that action at this time.
0 commit comments