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
201 stars 60 forks source link

Layout of `DynamicalMatrix` #831

Open tfrederiksen opened 1 month ago

tfrederiksen commented 1 month ago

Currently, to construct the dynamical matrix one needs to assign orbitals to each atom to represent the spatial degrees of freedom. Here a simple example

import sisl

c = sisl.Atom("C", orbitals=(1, 2, 3))
g = sisl.geom.graphene(atoms=c)
dm = sisl.DynamicalMatrix(g)

for i in g:
    _, nn = g.close(i, R=(0.1, 1.6))
    for j in nn:
        dm[i, j] = [xx, xy, xz, yx, yy, yz, zx, zy, zz]
dm.apply_newton()

However, it would seem more intuitive if

zerothi commented 1 month ago

To add to this.

This could also be more intuitive for SOC matrices.

I.e.

H = sisl.Hamiltonian(..., spin="soc")
H[i, j, 0, 1] = # up-down