Skip to content

Commit

Permalink
doc: fixed documentation to reflect orthogonal implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Jun 28, 2016
1 parent 07fdf9e commit b551ea5
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ To create the nearest neighbour tight-binding model for graphene you simply do
# Create nearest-neighbour tight-binding
# graphene lattice constant 1.42
dR = ( 0.1 , 1.5 )
on = ( 0. , 1. )
nn = (-0.5 , 0. )
on = 0.
nn = -0.5

# Ensure that graphene has supercell connections
gr.sc.set_nsc([3,3,1])
tb = TightBinding(gr)
tb = Hamiltonian(gr)
for ia in tb.geom:
idx_a = tb.close(ia, dR=dR)
tb[ia,idx_a[0]] = on
Expand All @@ -178,9 +178,9 @@ To create the nearest neighbour tight-binding model for graphene you simply do
at this point you have the tight-binding model for graphene and you can easily create
the Hamiltonian using this construct:

H, S = tb.tocsr(k=[0.,0.5,0])
Hk = tb.Hk(k=[0.,0.5,0])

which returns the Hamiltonian and the overlap matrices in the `scipy.sparse.csr_matrix`
which returns the Hamiltonian in the `scipy.sparse.csr_matrix`
format. To calculate the dispersion you diagonalize and plot the eigenvalues

import matplotlib.pyplot as plt
Expand All @@ -189,8 +189,8 @@ format. To calculate the dispersion you diagonalize and plot the eigenvalues
for ik, k in enumerate(klist):
eigs[ik,:] = tb.eigh(k, eigvals_only=True)
# Or equivalently:
# H, S = tb.tocsr(k)
# eigs[ik,:] = sli.eigh(H.todense(), S.todense(), eigvals_only=True)
# Hk = tb.Hk(k)
# eigs[ik,:] = sli.eigh(Hk.todense(), eigvals_only=True)
for i in range(tb.no):
plt.plot(eigs[:,i])

Expand All @@ -207,6 +207,26 @@ which accomplishes the same thing, but at much faster execution. `iR` should be
number such that `tb.geom.close(<any index>,dR = tb.geom.dR * iR)` is approximately
1000 atoms.

The above example is for the default orthogonal Hamiltonian. However, sisl is
not limited to orthogonal basis functions. To construct the same example using
explicit overlap matrix the following procedure is necessary:

# Create nearest-neighbour tight-binding
# graphene lattice constant 1.42
dR = ( 0.1 , 1.5 )
on = ( 0. , 1.)
nn = (-0.5, 0.) # still orthogonal (but with fake overlap)

tb = Hamiltonian(gr, ortho=False)
for ia in tb.geom:
idx_a = tb.close(ia, dR=dR)
tb[ia,idx_a[0]] = on
tb[ia,idx_a[1]] = nn
Hk = tb.Hk(k=[0.,0.5,0])
Sk = tb.Sk(k=[0.,0.5,0])
eigs = sli.eigh(Hk.todense(), Sk.todense(), eigvals_only=True)



## Downloading and installation ##

Expand Down

0 comments on commit b551ea5

Please sign in to comment.