Skip to content

Commit

Permalink
cleaned models, perhaps these needs an overhaul
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Aug 14, 2024
1 parent 7bcd2ba commit 38ca7a1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/sisl_toolbox/models/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class BaseModel:
),
)

def __getattr__(self, attr):
return getattr(self.ref, attr)


# Each model should inherit from this

Expand Down
27 changes: 22 additions & 5 deletions src/sisl_toolbox/models/_graphene/_hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class GrapheneHamiltonian(GrapheneModel):
class SimpleDispatch(ReferenceDispatch):
"""This implements the simple nearest neighbor TB model"""

def dispatch(self, t=-2.7, a=1.42, orthogonal=False):
def dispatch(self, t: float = -2.7, a: float = 1.42, orthogonal: bool = False):
"""The simplest tight-binding model for graphene"""
# Define the graphene lattice
da = 0.0005
C = si.Atom(6, si.AtomicOrbital(n=2, l=1, m=0, R=a + da))
Expand All @@ -40,7 +41,8 @@ class Hancock2010Dispatch(ReferenceDispatch):

doi = "10.1103/PhysRevB.81.245402"

def dispatch(self, set="A", a=1.42, orthogonal=False):
def dispatch(self, set: str = "A", a: float = 1.42, orthogonal: bool = False):
"""Tight-binding model based on 10.1103/PhysRevB.81.245402"""
distance = self._obj.distance
da = 0.0005
H_orthogonal = True
Expand Down Expand Up @@ -85,9 +87,11 @@ def dispatch(self, set="A", a=1.42, orthogonal=False):
C = si.Atom(6, si.AtomicOrbital(n=2, l=1, m=0, R=R[-1]))
graphene = si.geom.graphene(a, C, orthogonal=orthogonal)
graphene.optimize_nsc([0, 1])

# Define the Hamiltonian
H = si.Hamiltonian(graphene, orthogonal=H_orthogonal)
H.construct([R, t])

return H


Expand All @@ -104,7 +108,8 @@ class Ishii2010Dispatch(ReferenceDispatch):

doi = "10.1103/PhysRevLett.104.116801"

def dispatch(self, t=-2.7, a=1.42, orthogonal=False):
def dispatch(self, t: float = -2.7, a: float = 1.42, orthogonal: bool = False):
"""Tight-binding model based on 10.1103/PhysRevLett.104.116801"""
distance = self._obj.distance
da = 0.0005

Expand All @@ -120,9 +125,11 @@ def construct(H, ia, atoms, atoms_xyz=None):
# Define the graphene lattice
C = si.Atom(6, si.AtomicOrbital(n=2, l=1, m=0, R=R[-1]))
graphene = si.geom.graphene(a, C, orthogonal=orthogonal)

# Define the Hamiltonian
H = si.Hamiltonian(graphene)
H.construct(construct)

return H


Expand All @@ -136,8 +143,13 @@ class Cummings2019Dispatch(ReferenceDispatch):
doi = "10.1021/acs.nanolett.9b03112"

def dispatch(
self, t=(-2.414, -0.168), beta=(-1.847, -3.077), a=1.42, orthogonal=False
self,
t: tuple[float, float] = (-2.414, -0.168),
beta: tuple[float, float] = (-1.847, -3.077),
a: float = 1.42,
orthogonal: bool = False,
):
"""Tight-binding model based on 10.1021/acs.nanolett.9b03112"""
distance = self._obj.distance
da = 0.0005

Expand All @@ -154,9 +166,11 @@ def construct(H, ia, atoms, atoms_xyz=None):
# Define the graphene lattice
C = si.Atom(6, si.AtomicOrbital(n=2, l=1, m=0, R=R[-1]))
graphene = si.geom.graphene(a, C, orthogonal=orthogonal)

# Define the Hamiltonian
H = si.Hamiltonian(graphene)
H.construct(construct)

return H


Expand All @@ -169,7 +183,8 @@ class Wu2011Dispatch(ReferenceDispatch):

doi = "10.1007/s11671-010-9791-y"

def dispatch(self, a=1.42, orthogonal=False):
def dispatch(self, a: float = 1.42, orthogonal: bool = False):
"""Tight-binding model based on 10.1007/s11671-010-9791-y"""
distance = self._obj.distance
da = 0.0005

Expand All @@ -182,10 +197,12 @@ def dispatch(self, a=1.42, orthogonal=False):
# Define the graphene lattice
C = si.Atom(6, si.AtomicOrbital(n=2, l=1, m=0, R=R[-1]))
graphene = si.geom.graphene(a, C, orthogonal=orthogonal)

# Define the Hamiltonian
H = si.Hamiltonian(graphene, orthogonal=False)
t = [(-0.45, 1), (-2.78, 0.117), (-0.15, 0.004), (-0.095, 0.002)]
H.construct([R, t])

return H


Expand Down

0 comments on commit 38ca7a1

Please sign in to comment.