zerothi / sisl

Electronic structure Python package for post analysis and large scale tight-binding DFT/NEGF calculations
https://zerothi.github.io/sisl
Mozilla Public License 2.0
182 stars 58 forks source link

Comparison with Denchar and sisl #137

Open zerothi opened 5 years ago

zerothi commented 5 years ago

Describe the feature Now Denchar allows spin-orbit calculations which means that we can now compare the two!

It would be really nice to actually do this comparison and possibly create a workbook.

pfebrer commented 3 years ago

I've been comparing denchar with sisl for density and wavefunctions. I have created a folder with all the things necessary, and I will keep adding other structures/calculations. Let me know if you want to add something in particular.

Right now there's only orthogonal and non orthogonal graphene, but I've done this because I've seen differences in a system that I'm studying, so I plan to add it to see exactly what's happening.

Here are the results for graphene in an html file:

Comparing sisl with denchar.zip

Everything seems to be fine except the imaginary part of the wavefunctions at k=(0.5, 0, 0), which is always positive in the denchar version, but not in sisl (the 16 first wavefunctions are shown in each case).

Here is the folder to reproduce all the results, with a run_all.sh script that runs siesta and denchar and the jupyter notebook to analyze the results:

denchar_benchmark.zip

zerothi commented 3 years ago

I am not on my comp, but one thing to notice is that wavefunctions may be rotated by an arbitrary phase factor. So one should really use the same coefficients to compare correctly.

pfebrer commented 3 years ago

Ok, so you mean that I should generate wavefunctions in sisl from the .WFSX file, right?

zerothi commented 3 years ago

Yes, that would be the easiest option!

zerothi commented 3 years ago

Also some comparison of different origin would be great.

zerothi commented 3 years ago

So there is something different in the non-orthorhombic system, something like an offset or something? Hmm...

pfebrer commented 3 years ago

Yes, the structure is shifted there, but still you can see if the wfn is the same or not.

zerothi commented 3 years ago

Ok, so they were not the same thing, probably the easiest way to compare is to subtract the two grids to ensure direct comparison:

  1. Use the same number of grid-points in sisl and denchar, you can manually add them in sisl.
  2. Convert denchar output to e/Ang**3 so you can compare values.
  3. Do a final check that the normalization is complete int rho == n_elec for RHO, and int wave^2 == 1 for wavefunctions. These of course can only be done if the same simulation cell is used.