From 6ad868651ea56d1e0057c7ed37d29c31c493ffb7 Mon Sep 17 00:00:00 2001 From: Nick Papior Date: Thu, 18 Apr 2024 10:00:01 +0200 Subject: [PATCH] added hexagonal and goldene These structures are newly synthesized 2D flat structures. Signed-off-by: Nick Papior --- CHANGELOG.md | 2 + docs/api/geom.rst | 2 + src/sisl/geom/__init__.py | 2 + src/sisl/geom/flat.py | 90 +++++++++++++++++++++++++++++++- src/sisl/geom/tests/test_geom.py | 11 ++-- 5 files changed, 102 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5209c748ee..f3cda93382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/api/geom.rst b/docs/api/geom.rst index 40ceb85b2e..ee4581e775 100644 --- a/docs/api/geom.rst +++ b/docs/api/geom.rst @@ -77,6 +77,8 @@ Surfaces (slabs) honeycomb bilayer graphene + hexagonal + goldene Helpers diff --git a/src/sisl/geom/__init__.py b/src/sisl/geom/__init__.py index 0e88fda11b..5457381e3c 100644 --- a/src/sisl/geom/__init__.py +++ b/src/sisl/geom/__init__.py @@ -53,6 +53,8 @@ honeycomb graphene bilayer + hexagonal + goldene They generally take a lattice-parameter argument, and will all allow diff --git a/src/sisl/geom/flat.py b/src/sisl/geom/flat.py index 0226e05f41..2f826c0292 100644 --- a/src/sisl/geom/flat.py +++ b/src/sisl/geom/flat.py @@ -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") @@ -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 @@ -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) diff --git a/src/sisl/geom/tests/test_geom.py b/src/sisl/geom/tests/test_geom.py index 5868b5d787..60f23a473a 100644 --- a/src/sisl/geom/tests/test_geom.py +++ b/src/sisl/geom/tests/test_geom.py @@ -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)