Skip to content
Snippets Groups Projects
Commit d2c1401c authored by Christoph Groth's avatar Christoph Groth
Browse files

add lattice.cubic

parent 24980e4c
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ Library of lattices ...@@ -20,6 +20,7 @@ Library of lattices
chain chain
square square
cubic
triangular triangular
honeycomb honeycomb
kagome kagome
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# http://kwant-project.org/authors. # http://kwant-project.org/authors.
__all__ = ['TranslationalSymmetry', 'general', 'Polyatomic', 'Monatomic', __all__ = ['TranslationalSymmetry', 'general', 'Polyatomic', 'Monatomic',
'chain', 'square', 'triangular', 'honeycomb', 'kagome'] 'chain', 'square', 'cubic', 'triangular', 'honeycomb', 'kagome']
from math import sqrt from math import sqrt
from itertools import product from itertools import product
...@@ -745,6 +745,12 @@ def square(a=1, name='', norbs=None): ...@@ -745,6 +745,12 @@ def square(a=1, name='', norbs=None):
return Monatomic(((a, 0), (0, a)), name=name, norbs=norbs) return Monatomic(((a, 0), (0, a)), name=name, norbs=norbs)
def cubic(a=1, name='', norbs=None):
"""Make a cubic lattice."""
return Monatomic(((a, 0, 0), (0, a, 0), (0, 0, a)),
name=name, norbs=norbs)
tri = ta.array(((1, 0), (0.5, 0.5 * sqrt(3)))) tri = ta.array(((1, 0), (0.5, 0.5 * sqrt(3))))
def triangular(a=1, name='', norbs=None): def triangular(a=1, name='', norbs=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment