Skip to content

Commit 25ed6bf

Browse files
tfrederiksenzerothi
authored andcommitted
enh: include possibility of BA stacking (in addition to AB and AA)
1 parent 891e4a7 commit 25ed6bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sisl/geom/bilayer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def bilayer(bond=1.42, bottom_atom=None, top_atom=None, stacking='AB',
2323
atom (or atoms) in the bottom layer. Defaults to ``Atom(6)``
2424
top_atom : Atom, optional
2525
atom (or atoms) in the top layer, defaults to `bottom_atom`
26-
stacking : {'AB', 'AA'}
27-
stacking sequence of the bilayer
26+
stacking : {'AB', 'AA', 'BA'}
27+
stacking sequence of the bilayer, where XY means that site X in bottom layer coincides with site Y in top layer
2828
twist : tuple of int, optional
2929
integer coordinates (m, n) defining a commensurate twist angle
3030
separation : float, optional
@@ -54,6 +54,8 @@ def bilayer(bond=1.42, bottom_atom=None, top_atom=None, stacking='AB',
5454
top = top.move([0, 0, separation])
5555
elif stacking.lower() == 'ab':
5656
top = top.move([bond, 0, separation])
57+
elif stacking.lower() == 'ba':
58+
top = top.move([-bond, 0, separation])
5759

5860
# Compute twist angle
5961
m, n = twist

0 commit comments

Comments
 (0)