Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving hamiltonian/geometry into an nc-file doesn't save orbital information #278

Open
jonaslb opened this issue Oct 14, 2020 · 4 comments

Comments

@jonaslb
Copy link
Contributor

jonaslb commented Oct 14, 2020

Describe the bug
I usually save hamiltonians in the netcdf format using sisl.
When i load them, I cannot get any information on the orbitals other than the number of them per atom.
It would make sense I think if orbital information was saved (eg. which orbital is 2sZ1 etc).

Reproducable code

print(si.get_sile("H.nc").read_geometry())

Gives orbital information like Orbital{R: -1.00000, q0: 0.0},, while

print(si.get_sile("run.fdf").read_geometry())

Gives orbital information like AtomicOrbital{5sZ1, q0: 1.0, SphericalOrbital{l: 0, R: 4.1761, q0: 1.0}}.

Version details
sisl master

@zerothi
Copy link
Owner

zerothi commented Oct 14, 2020

You are correct.
I'll see to it :)

@zerothi
Copy link
Owner

zerothi commented Oct 20, 2020

So this is not so easily done.

I need to add extra logic to enable sisl to write non-complete basis sets.
The reason is that siesta only needs to store the (equivalent) SphericalOrbital information, and from that it can generate all atomic orbitals (different m).
However, sisl allows custom choices of only some l, m variants and thus needs to store explicitly all of them. So probably the easiest is to let sisl write everything, with an optional only_l to signal whether compressed forms are stored (to be compatible with Siesta).

@jonaslb
Copy link
Contributor Author

jonaslb commented Nov 11, 2020

Is it because you are thinking of making the format identical to ion.nc files?

I think for spgeom netcdf's it would be simpler to insist on the explicit format. If Siesta needs to read it (which I don't suppose it does, but still), then it can either be taught to understand it, or the sile could have a compat_mode="siesta" option to write orbital information with the siesta assumptions of implicit m (or error out if the orbitals dont match these assumptions).

@zerothi
Copy link
Owner

zerothi commented Nov 11, 2020

I agree. I would simply make a global identifier that writes which program wrote the file. That solves the issue. ;)

I would like to focus on #221 before I proceed with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants