From 6b65ab81156b695473aebb51ee1f9fee7d002795 Mon Sep 17 00:00:00 2001 From: Nick Papior Date: Fri, 8 Nov 2024 14:38:31 +0100 Subject: [PATCH] added explanation of how transform works Signed-off-by: Nick Papior --- src/sisl/io/siesta/tests/test_tshs.py | 4 ++-- src/sisl/physics/sparse.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/sisl/io/siesta/tests/test_tshs.py b/src/sisl/io/siesta/tests/test_tshs.py index bd440e1954..9d18d50476 100644 --- a/src/sisl/io/siesta/tests/test_tshs.py +++ b/src/sisl/io/siesta/tests/test_tshs.py @@ -128,11 +128,11 @@ def test_tshs_soc_pt2_xx_dtypes(sisl_files, sisl_tmp): fnc = sisl_tmp("tmp.nc") for HS in data: HS.write(f) - HS1 = sisl.physics.Hamiltonian.read(f) + HS1 = HS.read(f) assert np.allclose(eigs, HS1.eigh(k), atol=1e-5) HS.write(fnc) - HS1 = sisl.physics.Hamiltonian.read(fnc) + HS1 = HS.read(fnc) assert np.allclose(eigs, HS1.eigh(k), atol=1e-5) diff --git a/src/sisl/physics/sparse.py b/src/sisl/physics/sparse.py index 78ea95f07f..c4be7cf32b 100644 --- a/src/sisl/physics/sparse.py +++ b/src/sisl/physics/sparse.py @@ -874,7 +874,6 @@ def _reset(self): self.M11 = 0 self.M22 = 1 self.M12 = 2 - raise NotImplementedError("Currently not implemented") self.Pk = self._Pk_non_colinear self.Sk = self._Sk_non_colinear self.dPk = self._dPk_non_colinear @@ -1617,6 +1616,12 @@ def transform(self, matrix=None, dtype=None, spin=None, orthogonal=None): The transformation matrix does *not* act on the rows and columns, only on the final dimension of the matrix. + The matrix transformation is done like this: + + >>> out = in @ matrix.T + + Meaning that ``matrix[0, :]`` will be the factors of the input matrix elements. + Parameters ---------- matrix : array_like, optional