root / ase / lattice / compounds.py @ 5
Historique | Voir | Annoter | Télécharger (2,54 ko)
| 1 |
"""Function-like objects creating lattices with more than one element.
|
|---|---|
| 2 |
|
| 3 |
These lattice creators are mainly intended as examples for how to build you
|
| 4 |
own. The following crystal structures are defined:
|
| 5 |
|
| 6 |
B1 = NaCl = Rocksalt
|
| 7 |
B2 = CsCl
|
| 8 |
B3 = ZnS = Zincblende
|
| 9 |
L1_2 = AuCu3
|
| 10 |
L1_0 = AuCu
|
| 11 |
|
| 12 |
"""
|
| 13 |
from ase.lattice.cubic import FaceCenteredCubicFactory,\ |
| 14 |
BodyCenteredCubicFactory, DiamondFactory, SimpleCubicFactory |
| 15 |
from ase.lattice.tetragonal import SimpleTetragonalFactory |
| 16 |
import numpy as np |
| 17 |
from ase.data import reference_states as _refstate |
| 18 |
|
| 19 |
|
| 20 |
# To prevent a layer of element one on one side, and a layer of
|
| 21 |
# element two on the other side, NaCl is based on SimpleCubic instead
|
| 22 |
# of on FaceCenteredCubic
|
| 23 |
class NaClFactory(SimpleCubicFactory): |
| 24 |
"A factory for creating NaCl (B1, Rocksalt) lattices."
|
| 25 |
|
| 26 |
bravais_basis = [[0, 0, 0], [0, 0, 0.5], [0, 0.5, 0], [0, 0.5, 0.5], |
| 27 |
[0.5, 0, 0], [0.5, 0, 0.5], [0.5, 0.5, 0], |
| 28 |
[0.5, 0.5, 0.5]] |
| 29 |
element_basis = (0, 1, 1, 0, 1, 0, 0, 1) |
| 30 |
|
| 31 |
|
| 32 |
B1 = NaCl = Rocksalt = NaClFactory() |
| 33 |
|
| 34 |
class CsClFactory(SimpleCubicFactory): |
| 35 |
"A factory for creating CsCl (B2) lattices."
|
| 36 |
bravais_basis = [[0, 0, 0], [0.5, 0.5, 0.5]] |
| 37 |
element_basis = (0, 1) |
| 38 |
|
| 39 |
B2 = CsCl = CsClFactory() |
| 40 |
|
| 41 |
|
| 42 |
#The zincblende structure is easily derived from Diamond, which
|
| 43 |
#already has the right basis.
|
| 44 |
class ZnSFactory(DiamondFactory): |
| 45 |
"A factory for creating ZnS (B3, Zincblende) lattices."
|
| 46 |
element_basis = (0, 1) |
| 47 |
|
| 48 |
B3 = ZnS = Zincblende = ZnSFactory() |
| 49 |
|
| 50 |
|
| 51 |
# The L1_0 structure is "based on FCC", but is a tetragonal distortion
|
| 52 |
# of fcc. It must therefore be derived from the base-centered
|
| 53 |
# tetragonal structure. That structure, however, does not exist,
|
| 54 |
# since it is equivalent to a simple tetragonal structure rotated 45
|
| 55 |
# degrees along the z-axis. Basing L1_2 on that would however give
|
| 56 |
# unexpected miller indices. L1_2 will therefore be based on a simple
|
| 57 |
# tetragonal structure, but with a basis corresponding to a
|
| 58 |
# base-centered tetragonal.
|
| 59 |
class AuCuFactory(SimpleTetragonalFactory): |
| 60 |
"A factory for creating AuCu (L1_0) lattices (tetragonal symmetry)."
|
| 61 |
bravais_basis = [[0, 0, 0], [0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]] |
| 62 |
element_basis = (0, 1, 1, 0) |
| 63 |
|
| 64 |
AuCu = L1_0 = AuCuFactory() |
| 65 |
|
| 66 |
# The L1_2 structure is "based on FCC", but is really simple cubic
|
| 67 |
# with a basis.
|
| 68 |
class AuCu3Factory(SimpleCubicFactory): |
| 69 |
"A factory for creating AuCu3 (L1_2) lattices."
|
| 70 |
bravais_basis = [[0, 0, 0], [0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]] |
| 71 |
element_basis = (0, 1, 1, 1) |
| 72 |
|
| 73 |
AuCu3 = L1_2 = AuCu3Factory() |