Skip to content

Return of missing diagonal elements error #661

@AleksBL

Description

@AleksBL

Code to reproduce problem

print(Hd.nsc)
Hd.write('out.TSHS')

Gives
[1 1 1]
SislError: The diagonal elements of your orthogonal Hamiltonian have not been defined, this is a requirement.

Redefining by

Hd2 = sisl.Hamiltonian(sisl.Geometry(Hd.xyz, atoms=Hd.atoms))
import scipy.sparse as sp
Hd2 = Hd2.fromsp(sisl.Geometry(Hd.xyz, atoms=Hd.atoms), Hd.Hk(), S = sp.eye(Hd.na))
Hd2.write('out.TSHS')

makes it write without error.

This bug has appeared at several updates it seems, or it might be some strange stuff going on in the dependencies. I dont know, but i think it was fixed in a 0.13 version.

I didnt understand the origin of it when it was fixed previously, so I wondered if you know where this error comes from?

Best,
Aleksander

Version details
Run the below code and add to bug-report:

3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
0.14.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions