Questions about the sisl tutorial

Asked by Yuefei Huang on 2020-05-28

Hello Nick,
I met some problems running the sisl tutorials.
In TB_01:
#####
for ia, io in H:
#####
You intended to enumerate atomic and orbital indices, but actually when using "for i in H:", it enumerates the indices of nonzero terms in H, for example running:
#####
graphene = sisl.geom.graphene()
H = sisl.Hamiltonian(graphene)
H[0, 0] = 0.0
H[1, 1] = 0.0
H[0, 1] = -2.7
H[1, 0] = -2.7
H[0, 1, (-1, 0)] = -2.7
H[0, 1, (0, -1)] = -2.7
H[1, 0, (1, 0)] = -2.7
H[1, 0, (0, 1)] = -2.7
for ia, io in H:
    print(ia,io)
###
Output is:
0 0
0 1
0 9
0 5
1 1
1 0
1 10
1 14

In TB_04 about edge atom indice:
#####
for ia in device.close(device.center(what='cell'), R=14.):
    if len(device.close(ia, R=1.43)) < 4:
        edge.append(ia + 1) # + 1 to get fortran indices
#####
Why do you use fortran indices in the following code? When you plot the edge atom DOS later, and call tbt.DOS(atom=edge, norm='atom'), should you use python indices here?

In TB_05,
#####
dangling = [ia for ia in H.geom.close(H.geom.center(what='cell'), R=14.)
                if len(H.edges(ia)) < 2]
H = H.remove(dangling)
# + 1 to get fortran indices
edge = [ia + 1 for ia in H.geom.close(H.geom.center(what='cell'), R=14.)
         if len(H.edges(ia)) < 3]
#####
Should the two inequality be <3 and <4, as in TB_04? Since H.edges(ia) returns itself too.

Thank you!

Question information

Language:
English Edit question
Status:
Answered
For:
Siesta Edit question
Assignee:
No assignee Edit question
Last query:
2020-05-28
Last reply:
2020-05-28
Nick Papior (nickpapior) said : #1

Hello, could you move this discussion to github:

https://github.com/zerothi/ts-tbt-sisl-tutorial

Thanks! :)

Can you help with this problem?

Provide an answer of your own, or ask Yuefei Huang for more information if necessary.

To post a message you must log in.