diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fdbf707cd..1a4826aa3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,11 @@ we hit release version 1.0.0. as the only argument. ### Fixed +- delta-files (netCDF) would always have diagonal components, + this has now been removed since it only needs the elements with + values +- Siesta sparse matrices could in some cases set wrong diagonal + components - orbital quantum numbers from HSX file was wrong in v1, #462 - RealSpaceSI for right semi-infinite directions, #475 - tbtrans files now have a separate entry in the documentation diff --git a/sisl/io/siesta/_help.py b/sisl/io/siesta/_help.py index 0956a1a529..b1e0bc0511 100644 --- a/sisl/io/siesta/_help.py +++ b/sisl/io/siesta/_help.py @@ -45,9 +45,17 @@ def _csr_from_siesta(geom, csr): _csr_from_sc_off(geom, _siesta.siesta_sc_off(*geom.nsc).T, csr) -def _csr_to_siesta(geom, csr): - """ Internal routine to convert *any* SparseCSR matrix from sisl nsc to siesta nsc """ - _ensure_diagonal(csr) +def _csr_to_siesta(geom, csr, diag=True): + """ Internal routine to convert *any* SparseCSR matrix from sisl nsc to siesta nsc + + Parameters + ---------- + ... + diag: bool, optional + whether the csr matrix will be ensured diagonal as well + """ + if diag: + _ensure_diagonal(csr) _csr_to_sc_off(geom, _siesta.siesta_sc_off(*geom.nsc).T, csr) diff --git a/sisl/io/tbtrans/delta.py b/sisl/io/tbtrans/delta.py index 91aeadc52a..2289042d7a 100644 --- a/sisl/io/tbtrans/delta.py +++ b/sisl/io/tbtrans/delta.py @@ -280,7 +280,7 @@ def write_delta(self, delta, **kwargs): raise SileError(f"{self!s}.write_overlap cannot write a zero element sparse matrix!") # convert to siesta thing and store - _csr_to_siesta(delta.geometry, csr) + _csr_to_siesta(delta.geometry, csr, diag=False) # delta should always write sorted matrices csr.finalize(sort=True) _mat_spin_convert(csr, delta.spin)