Skip to content

Commit

Permalink
added hexagonal and goldene
Browse files Browse the repository at this point in the history
These structures are newly synthesized
2D flat structures.

Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Apr 18, 2024
1 parent 1cf5a94 commit 6ad8686
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ we hit release version 1.0.0.
## [0.15.0] - YYYY-MM-DD

### Added
- added the `goldene` 2D lattice, a `hexagonal` Gold 2D structure
- added the `hexagonal` 2D lattice, close-packed FCC(111) surface
- improved `atom` projections of states, #750
- improved typing system
- `units` to `read_*` for some `Sile`s, #726
Expand Down
2 changes: 2 additions & 0 deletions docs/api/geom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Surfaces (slabs)
honeycomb
bilayer
graphene
hexagonal
goldene


Helpers
Expand Down
2 changes: 2 additions & 0 deletions src/sisl/geom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
honeycomb
graphene
bilayer
hexagonal
goldene
They generally take a lattice-parameter argument, and will all allow
Expand Down
90 changes: 89 additions & 1 deletion src/sisl/geom/flat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@

from ._common import geometry_define_nsc

__all__ = ["honeycomb", "graphene", "honeycomb_flake", "graphene_flake", "triangulene"]
__all__ = [
"honeycomb",
"graphene",
"honeycomb_flake",
"graphene_flake",
"triangulene",
"hexagonal",
"goldene",
]


@set_module("sisl.geom")
Expand Down Expand Up @@ -65,7 +73,10 @@ def honeycomb(bond: float, atoms: AtomsLike, orthogonal: bool = False) -> Geomet
atoms,
lattice=lattice,
)

# Set boundary conditions
geometry_define_nsc(g, [True, True, False])

return g


Expand Down Expand Up @@ -250,3 +261,80 @@ def triangulene(
geometry_define_nsc(geom, [False, False, False])

return geom


def hexagonal(
bond: float, atoms: AtomsLike = None, orthogonal: bool = False
) -> Geometry:
"""A hexagonal unit-cell with 1 or 2 atoms in the basic unit cell
The hexagonal unit-cell is the equivalent of an FCC(111) surface, i.e.
a close-packed lattice.
Parameters
----------
bond :
bond length between atoms (*not* lattice constant)
atoms : Atom, optional
the atom (or atoms) that the hexagonal lattice consists of.
orthogonal :
if True returns an orthogonal lattice (2 atoms), otherwise
a non-orthogonal lattice (1 atom).
"""
sq3h = 3.0**0.5 * 0.5
if orthogonal:
lattice = Lattice(
np.array([[2 * sq3h, 0.0, 0.0], [0, 1, 0.0], [0.0, 0.0, 10.0]], np.float64)
* bond
)
g = Geometry(
np.array(
[[0.0, 0.0, 0.0], [sq3h, 0.5, 0.0]],
np.float64,
)
* bond,
atoms,
lattice=lattice,
)
else:
lattice = Lattice(
np.array(
[[sq3h, -0.5, 0.0], [sq3h, 0.5, 0.0], [0.0, 0.0, 10.0]], np.float64
)
* bond
)
g = Geometry(
np.array([[0.0, 0.0, 0.0]], np.float64),
atoms,
lattice=lattice,
)

# Set boundary conditions
geometry_define_nsc(g, [True, True, False])

return g


def goldene(
bond: float = 2.7, atoms: AtomsLike = None, orthogonal: bool = False
) -> Geometry:
"""A goldene unit-cell with 1 or 2 atoms in the basic unit cell
Parameters
----------
bond :
bond length between atoms (*not* lattice constant)
atoms : Atom, optional
the atom (or atoms) that the hexagonal lattice consists of.
Default to Gold atom.
orthogonal :
if True returns an orthogonal lattice (2 atoms), otherwise
a non-orthogonal lattice (1 atom).
See Also
--------
hexagonal : the underlying unit cell
"""
if atoms is None:
atoms = Atom(Z=79, R=bond * 1.01)
return hexagonal(bond, atoms, orthogonal)
11 changes: 7 additions & 4 deletions src/sisl/geom/tests/test_geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ def test_basic():
a = rocksalt(5.64, [Atom("Na", R=3), Atom("Cl", R=4)], orthogonal=True)


def test_flat():
a = graphene()
@pytest.mark.parametrize(
"func, orthogonal",
itertools.product([graphene, goldene], [True, False]),
)
def test_flat(func, orthogonal):
a = func(orthogonal=orthogonal)
assert is_right_handed(a)
graphene(atoms="C")
a = graphene(orthogonal=True)
a = func(atoms="C", orthogonal=orthogonal)
assert is_right_handed(a)


Expand Down

0 comments on commit 6ad8686

Please sign in to comment.