vibesketcher.document.crystal¶
Bravais lattices, prototype crystals and cell choices for periodic structures.
Cells are right-handed row vectors in angstrom, as in PeriodicStructure. Conventional cells use the standard settings of the International Tables for Crystallography, Vol. A (2016); primitive cells use the transformations of W. Setyawan and S. Curtarolo, Comput. Mater. Sci. 49, 299 (2010), doi:10.1016/j.commatsci.2010.05.010. Wigner-Seitz faces are the Voronoi-relevant lattice vectors of J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups, ch. 21 (Springer, 1999): within each coset T + 2L, only the shortest pair +-T bounds the cell.
Every builder records its recipe in provenance["builder"]; the document
schema is unchanged. A Wigner-Seitz cell is an atom placement of the same
lattice, not a different lattice.
Module Attributes
Pearson-style symbols. |
Functions
|
Expand Wyckoff |
|
|
|
Rows a1 along x, a2 in the xy plane (the IUCr standard orientation). |
|
|
|
|
|
|
|
Expand an asymmetric unit with the operations of a space-group setting (#199). |
|
|
|
Parse a coordinate triplet such as |
|
|
|
Reduce a conventional cell of the given Bravais type to its primitive cell. |
|
P with primitive rows = P @ conventional rows (Setyawan-Curtarolo 2010). |
|
Build a library prototype, optionally with other lattice constants or elements. |
The prototype library as plain data (for the CLI, REST and MCP). |
|
|
Move each site to its lattice image nearest the origin lattice point. |
|
Vertices (angstrom) and faces of the Wigner-Seitz cell of the periodic lattice. |
Classes
|
Conventional-cell parameters in angstrom and degrees. |
|
A crystal prototype: lattice type, default parameters and Wyckoff data. |
- vibesketcher.document.crystal.BRAVAIS_3D = ('aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hR', 'hP', 'cP', 'cI', 'cF')¶
Pearson-style symbols. Three-dimensional lattices use the 14 Bravais types; plane lattices use the 5 two-dimensional types; the line lattice is
l.
- class vibesketcher.document.crystal.LatticeParameters(a, b=None, c=None, alpha=None, beta=None, gamma=None, vacuum=20.0)[source]¶
Bases:
objectConventional-cell parameters in angstrom and degrees.
vacuumis the length of each nonperiodic vector of a plane or line lattice; it is part of the recorded model, never invented later.- Parameters:
- vibesketcher.document.crystal.cell_from_parameters(a, b, c, alpha, beta, gamma)[source]¶
Rows a1 along x, a2 in the xy plane (the IUCr standard orientation).
- vibesketcher.document.crystal.conventional_lattice(bravais, parameters)[source]¶
- Parameters:
bravais (str)
parameters (LatticeParameters)
- Return type:
ndarray
- vibesketcher.document.crystal.primitive_transform(bravais)[source]¶
P with primitive rows = P @ conventional rows (Setyawan-Curtarolo 2010).
- Parameters:
bravais (str)
- Return type:
ndarray
- vibesketcher.document.crystal.centring_vectors(bravais)[source]¶
- Parameters:
bravais (str)
- Return type:
ndarray
- vibesketcher.document.crystal.parse_operation(text)[source]¶
Parse a coordinate triplet such as
-x+y,-x,z+1/2(ITA notation).
- class vibesketcher.document.crystal.Prototype(name, description, bravais, parameters, sites, operations=(), reference='', species=())[source]¶
Bases:
objectA crystal prototype: lattice type, default parameters and Wyckoff data.
- Parameters:
- parameters: LatticeParameters¶
- vibesketcher.document.crystal.prototypes()[source]¶
The prototype library as plain data (for the CLI, REST and MCP).
- vibesketcher.document.crystal.build_crystal(bravais, parameters, sites, *, identifier, operations=(), cell='conventional', tolerance=0.0001, species_map=None, recipe=None)[source]¶
Expand Wyckoff
sites(conventional fractional) into a physical cell.operationsare ITA coordinate triplets without the centring translations, which the Bravais type adds. Without operations the sites are taken as the full P1 motif of one lattice point.species_maprenames elements of a prototype ({"Mg": "Ca"}turns MgO into CaO).- Parameters:
- Return type:
- vibesketcher.document.crystal.lattice_rows(structure)[source]¶
- Parameters:
structure (PeriodicStructure)
- Return type:
ndarray
- vibesketcher.document.crystal.cartesian(structure)[source]¶
- Parameters:
structure (PeriodicStructure)
- Return type:
ndarray
- vibesketcher.document.crystal.primitive_cell(structure, bravais, *, identifier, tolerance=0.0001, recipe=None)[source]¶
Reduce a conventional cell of the given Bravais type to its primitive cell.
The site count must drop by exactly the number of lattice points of the conventional cell, which proves that the motif carries the centring.
- Parameters:
- Return type:
- vibesketcher.document.crystal.prototype(name, *, identifier, cell='primitive', a=None, c=None, vacuum=None, species_map=None)[source]¶
Build a library prototype, optionally with other lattice constants or elements.
- vibesketcher.document.crystal.wigner_seitz_cell(structure, *, identifier, tolerance=1e-06)[source]¶
Move each site to its lattice image nearest the origin lattice point.
The lattice, composition and site order are unchanged, so a PBC job sees the same model; a cyclic cluster takes its shape from this placement. Sites equidistant from two lattice points lie on a Wigner-Seitz face; the image with the lexicographically smallest translation is kept and the site is listed in
provenance["builder"]["boundary_sites"].- Parameters:
structure (PeriodicStructure)
identifier (str)
tolerance (float)
- Return type:
- vibesketcher.document.crystal.wigner_seitz_polyhedron(structure)[source]¶
Vertices (angstrom) and faces of the Wigner-Seitz cell of the periodic lattice.
3-D lattices give a polyhedron with faces listed as vertex cycles, plane lattices a polygon in the periodic plane and the line lattice a segment. Faces are the Voronoi-relevant vectors (Conway and Sloane, ch. 21).
- Parameters:
structure (PeriodicStructure)
- Return type:
- vibesketcher.document.crystal.from_space_group(symbol, parameters, sites, *, identifier, cell='conventional', tolerance=0.0001, near_special=0.1, species_map=None)[source]¶
Expand an asymmetric unit with the operations of a space-group setting (#199).
sitesare fractional coordinates of the setting’s conventional cell. Every generated site records its orbit (the asymmetric site it comes from) and the orbit’s multiplicity; a site that comes withinnear_specialangstrom of a special position without lying on it is reported, never moved (no snapping). Two elements on one position are refused.