Skip to content

Commit

Permalink
enh: changed alat to bond in honeycomb lattice
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Jun 24, 2016
1 parent b7f0927 commit eaf6136
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sisl/geom/flat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@
__all__ = ['honeycomb', 'graphene']


def honeycomb(alat, atom, square=False):
def honeycomb(bond, atom, square=False):
"""
Returns a honeycomb geometry with the graphene unit-cell (2 atoms)
"""
sq3h = 3.**.5 * 0.5
if square:
sc = SuperCell(np.array([[3., 0., 0.],
[0., 2 * sq3h, 0.],
[0., 0., 10.]], np.float64) * alat, nsc=[3, 3, 1])
[0., 0., 10.]], np.float64) * bond, nsc=[3, 3, 1])
g = Geometry(np.array([[0., 0., 0.],
[0.5, sq3h, 0.],
[1.5, sq3h, 0.],
[2., 0., 0.]], np.float64) * alat,
[2., 0., 0.]], np.float64) * bond,
atoms=atom, sc=sc)
else:
sc = SuperCell(np.array([[1.5, sq3h, 0.],
[1.5, -sq3h, 0.],
[0., 0., 10.]], np.float64) * alat, nsc=[3, 3, 1])
[0., 0., 10.]], np.float64) * bond, nsc=[3, 3, 1])
g = Geometry(np.array([[0., 0., 0.],
[1., 0., 0.]], np.float64) * alat,
[1., 0., 0.]], np.float64) * bond,
atoms=atom, sc=sc)
return g


def graphene(alat=1.42, atom=None, square=False):
def graphene(bond=1.42, atom=None, square=False):
"""
Returns a geometry with the graphene unit-cell (2 atoms)
"""
if atom is None:
return honeycomb(alat, Atom(Z=6, R=alat * 1.01), square)
return honeycomb(alat, atom, square)
return honeycomb(bond, Atom(Z=6, R=bond * 1.01), square)
return honeycomb(bond, atom, square)


if __name__ == "__main__":
Expand Down

0 comments on commit eaf6136

Please sign in to comment.