User:Jaystrj/sandbox

In crystallography, a fractional coordinate system (crystal coordinate system) is a coordinate system in which the basis vectors used to the describe the system are the lattice vectors of a crystal (periodic) pattern. The selection of an origin and a basis define a unit cell, a parallelepiped defined by the lattice basis vectors $$ \mathbf {a}_1, \mathbf {a}_2, \dots, \mathbf {a}_d $$ where $$ d $$ is the dimension of the space. These basis vectors are described by lattice parameters (lattice constants) consisting of the lengths of the lattice basis vectors $$ a_1, a_2, \dots, a_d$$ and the angles between them $$\alpha_1, \alpha_2, \dots, \alpha_d$$.
 * Crystal Coordinates.png

Crystal Structure
A crystal structure is defined as the spatial distribution of the atoms within a crystal, usually modeled by the idea of an infinite crystal pattern. An infinite crystal pattern refers to the infinite 3D periodic array which corresponds to a crystal, in which the lengths of the periodicities of the array may not be made arbitrarily small. The geometrical shift which takes a crystal structure coincident with itself is termed a symmetry translation (translation) of the crystal structure. The vector which is related to this shift is called a translation vector $$ \mathbf{t} $$. Since a crystal pattern is periodic, all integer linear combinations of translation vectors are also themselves translation vectors,

$$\mathbf{t} = c_1\mathbf{t}_1+c_2\mathbf{t}_2 \text { where } c_1, c_2 \in \mathbb{Z}$$

Lattice
The vector lattice (lattice) $$ \mathbf{T} $$ is defined as the inifinite set consisting of all of the translation vectors of a crystal pattern. Each of the vectors in the vector lattice are called lattice vectors. From the vector lattice it is possible to construct a point lattice. This is done by selecting an origin $$X_0$$ with position vector $$\mathbf{x}_0$$. The endpoints $$X_i$$ of each of the vectors $$\mathbf{x}_i = \mathbf{x}_0 + \mathbf{t}_i$$ make up the point lattice of $$X_0$$ and $$\mathbf{T}$$. Each point in a point lattice has periodicity i.e., each point is identical and has the same surroundings. There exist an infinite number of point lattices for a given vector lattice as any arbitrary origin $$X_0$$ can be chosen and paired with the lattice vectors of the vector lattice. The points or particles that are made coincident with one another through a translation are called translation equivalent.

General coordinate systems
Usually when describing a space geometrically, a coordinate system is used which consists of a choice of origin and a basis of $$ d $$ linearly independent, non-coplanar basis vectors $$ \mathbf{a}_1, \mathbf{a}_2, \dots, \mathbf{a}_d $$, where $$ d $$ is the dimension of the space being descibed. With reference to this coordinate system, each point in the space can be specified by $$d$$ coordinates (a coordinate $$d$$-tuple). The origin has coordinates $$(0, 0,\dots,0)$$ and an arbitrary point has coordinates $$(x_1,x_2,...,x_d)$$. The position vector $$ \vec{OP} $$ is then,

$$\vec{OP} = \mathbf{x} = \sum_{i=1}^{d} x_i\mathbf{a}_i$$

In $$d$$-dimensions, the lengths of the basis vectors are commonly denoted $$a_1, a_2, \dots, a_d$$ and the angles between them $$\alpha_1, \alpha_2, \dots, \alpha_d$$.

Cartesian Coordinate System
A commonly used coordinate system is the Cartesian coordinate system, which consists of orthonormal basis vectors. This means that,

$$a_1 = |a_1| = a_2 = |a_2| = \dots = a_d = |a_d| = 1$$ and $$\alpha_1 = \alpha_2 = \dots = \alpha_d = 90^\circ$$

However, when describing objects with crystalline or periodic structure a Cartesian coordinate system is often not the most useful as it does not often reflect the symmetry of the lattice in the simplest manner.

Fractional (crystal) coordinate system
In crystallography, a fractional coordinate system is used in order to better reflect the symmetry of the underlying lattice of a crystal pattern (or any other periodic pattern in space). In a fractional coordinate system the basis vectors of the coordinate system are chosen to be lattice vectors and the basis is then termed a crystallographic basis (or lattice basis).

In a lattice basis, any lattice vector $$\mathbf{t}$$ can be represented as,

$$\mathbf{t} = \sum_{i=1}^{d} c_i\mathbf{a}_i \text{ where } c_i \in \mathbb{Q}$$

There are an infinite number of lattice bases for a crystal pattern. However, these can be chosen in such a way that the simplest discription of the pattern can be obtained. These bases are used in the International Tables of Crystallography Volume A, and are termed conventional bases. A lattice basis $$\mathbf{a}_1, \mathbf{a}_2, ..., \mathbf{a}_d$$ is called primitive if the basis vectors are lattice vectors and all lattice vectors $$\mathbf{t}$$ can be expressed as,

$$\mathbf{t} = \sum_{i=1}^{d} c_i \mathbf{a}_i \text{ where } c_i \in \mathbb{Z}$$

However, the conventional basis for a crystal pattern is not always chosen to be primitive. Instead, it is chosen so the number of orthogonal basis vectors is maximized. This results in some of the coefficients of the equations above being fractional. A lattice in which the conventional basis is primitive is called a primitive lattice, while a lattice with a non-primitive conventional basis is called a centered lattice.

The choice of an origin and a basic implies the choice of a unit cell which can further be used to describe a crystal pattern. The unit cell is defined as the parallelotope in which the coordinates of all points are such that, $$0 \leq x_1,x_2,\dots,x_d < 1$$.

Furthermore, points outside of the unit cell can be transformed inside of the unit cell through standardization, the addition or subtraction of integers to the coordinates of points to ensure $$0 \leq x_1,x_2,\dots,x_d < 1$$. In a fractional coordinate system the lengths of the basis vectors $$\mathbf{a}_1, \mathbf{a}_2, ..., \mathbf{a}_d$$ and the angles between them $$\alpha_1, \alpha_2, \dots, \alpha_d$$ are called the lattice parameters (lattice constants) of the lattice. In two- and three-dimensions, these correspond to the lengths and angles between the edges of the unit cell.

The fractional coordinates of a point in space $$\rho = (\rho_{x_1}, \rho_{x_2}, \dots, \rho_{x_d})$$ in terms of the lattice basis vectors is defined as,

$$\rho = \rho_{x_1}\mathbf{a}_1 + \rho_{x_1}\mathbf{a}_2 + \dots + \rho_{x_d}\mathbf{a}_d \text{ where } \rho \in [0,1)$$

Cell tensor
In Cartesian coordinates the 2 basis vectors are represented by a $$2 \times 2$$ cell matrix $$\mathbf{h}$$:

$$\mathbf{h} = \begin{pmatrix} \mathbf{a}_1 & \mathbf{a}_2 \end{pmatrix}^\operatorname{T} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} \\ a_{2,x_1} & a_{2,x_2} \end{pmatrix}$$

The volume of the unit cell, $$V$$, is given by the determinant of the cell matrix:

$$V = \det(\mathbf{h}) = a_{1,x_1}a_{2,x_2} - a_{1,x_2}a_{2,x_2}$$

For the special case of a square or rectangular unit cell, the matrix is diagonal and we have that:

$$V = \det(\mathbf{h}) = a_{1,x_1}a_{2,x_2}$$

Relationship between fractional and Cartesian coordinates
The relationship between fractional and Cartesian coordinates can be described by the matrix transformation $$ \mathbf{r} = \mathbf{h}\boldsymbol\rho $$:

$$ \begin{pmatrix} r_{x_1} \\ r_{x_2} \end{pmatrix} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} \\ a_{2,x_1} & a_{2,x_2} \end{pmatrix}\begin{pmatrix} \rho_{x_1}  \\ \rho_{x_2} \end{pmatrix} $$

Similarly, the Cartesian coordinates can be converted back to fractional coordinates using the matrix transformation $$ \boldsymbol\rho = \mathbf{h}^{-1}\mathbf{r} $$:

$$ \begin{pmatrix} \rho_{x_1} \\ \rho_{x_2} \end{pmatrix} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} \\ a_{2,x_1} & a_{2,x_2} \end{pmatrix}^{-1} \begin{pmatrix} r_{x_1}  \\ r_{x_2} \end{pmatrix} $$

Cell tensor
In Cartesian coordinates the 3 basis vectors are represented by a $$3 \times 3$$ cell tensor $$\mathbf{h}$$:

$$\mathbf{h} = \begin{pmatrix} \mathbf{a}_1 & \mathbf{a}_2 & \mathbf{a}_3 \end{pmatrix}^\operatorname{T} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} & a_{1,x_3} \\ a_{2,x_1} & a_{2,x_2} & a_{2,x_3} \\ a_{3,x_1} & a_{3,x_2} & a_{3,x_3} \end{pmatrix}$$

The volume of the unit cell, $$V$$, is given by the determinant of the cell tensor:

$$V = \det(\mathbf{h}) = a_{1,x_1}(a_{2,x_2}a_{3,x_3}-a_{2,x_3}a_{3,x_2}) - a_{1,x_2}(a_{2,x_1}a_{3,x_3} - a_{2,x_3}a_{3,x_1}) - a_{1,x_3}(a_{2,x_1}a_{3,x_2} - a_{2,x_2}a_{3,x_1})$$

For the special case of a cubic, tetragonal, or orthorhombic cell, the matrix is diagonal and we have that:

$$V = \det(\mathbf{h}) = a_{1,x_1}a_{2,x_2}a_{3,x_3}$$

Relationship between fractional and Cartesian coordinates
The relationship between fractional and Cartesian coordinates can be described by the matrix transformation $$ \mathbf{r} = \mathbf{h}\boldsymbol\rho $$:

$$ \begin{pmatrix} r_{x_1} \\ r_{x_2} \\ r_{x_3} \end{pmatrix} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} & a_{1,x_3} \\ a_{2,x_1} & a_{2,x_2} & a_{2,x_3} \\ a_{d,x_1} & a_{d,x_2} & a_{d,x_d} \end{pmatrix}\begin{pmatrix} \rho_{x_1}  \\ \rho_{x_2} \\ \rho_{x_3} \end{pmatrix} $$

Similarly, the Cartesian coordinates can be converted back to fractional coordinates using the matrix transformation $$ \boldsymbol\rho = \mathbf{h}^{-1}\mathbf{r} $$:

$$ \begin{pmatrix} \rho_{x_1} \\ \rho_{x_2} \\ \rho_{x_3} \end{pmatrix} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} & a_{1,x_3} \\ a_{2,x_1} & a_{2,x_2} & a_{2,x_3} \\ a_{d,x_1} & a_{d,x_2} & a_{d,x_d} \end{pmatrix}^{-1} \begin{pmatrix} r_{x_1}  \\ r_{x_2} \\ r_{x_3} \end{pmatrix} $$

Cell tensor
In Cartesian coordinates the $$ d $$ basis vectors are represented by a $$d \times d$$ cell tensor $$\mathbf{h}$$:

$$\mathbf{h} = \begin{pmatrix} \mathbf{a}_1 & \mathbf{a}_2 & \dots & \mathbf{a}_d \end{pmatrix}^\operatorname{T} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} & \dots & a_{1,x_d} \\ a_{2,x_1} & a_{2,x_2} & \dots & a_{2,x_d} \\ \vdots & \vdots & \ddots & \vdots \\ a_{d,x_1} & a_{d,x_2} & \dots & a_{d,x_d} \end{pmatrix}$$

The volume of the unit cell, $$V$$, is given by the determinant of the cell tensor:

$$V = \det(\mathbf{h})$$

Relationship between fractional and Cartesian coordinates
The relationship between fractional and Cartesian coordinates can be described by the matrix transformation $$ \mathbf{r} = \mathbf{h}\boldsymbol\rho $$:

$$ \begin{pmatrix} r_{x_1} \\ r_{x_2} \\ \vdots \\ r_{x_d} \end{pmatrix} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} & \dots & a_{1,x_d} \\ a_{2,x_1} & a_{2,x_2} & \dots & a_{2,x_d} \\ \vdots & \vdots & \ddots & \vdots \\ a_{d,x_1} & a_{d,x_2} & \dots & a_{d,x_d} \end{pmatrix}\begin{pmatrix} \rho_{x_1}  \\ \rho_{x_2} \\ \vdots \\ \rho_{x_d} \end{pmatrix} $$

Similarly, the Cartesian coordinates can be converted back to fractional coordinates using the transformation $$ \boldsymbol\rho = \mathbf{h}^{-1}\mathbf{r} $$:

$$ \begin{pmatrix} \rho_{x_1}  \\ \rho_{x_2} \\ \vdots \\ \rho_{x_d} \end{pmatrix} = \begin{pmatrix} a_{1,x_1} & a_{1,x_2} & \dots & a_{1,x_d} \\ a_{2,x_1} & a_{2,x_2} & \dots & a_{2,x_d} \\ \vdots & \vdots & \ddots & \vdots \\ a_{d,x_1} & a_{d,x_2} & \dots & a_{d,x_d} \end{pmatrix}^{-1} \begin{pmatrix} r_{x_1}  \\ r_{x_2} \\ \vdots \\ r_{x_d} \end{pmatrix} $$

Determination of cell properties in three dimensions using the metric tensor
The metric tensor $$\mathbf{G}$$ is sometimes used for calculations involving the unit cell and is defined (in matrix form) as:

In two dimensions,

$$\mathbf{G} = \begin{pmatrix} g_{11} & g_{12} \\ g_{21} & g_{22} \end{pmatrix} = \begin{pmatrix} \mathbf{a}_1\cdot\mathbf{a}_1 & \mathbf{a}_1\cdot\mathbf{a}_2 \\ \mathbf{a}_2\cdot\mathbf{a}_1 & \mathbf{a}_2\cdot\mathbf{a}_2 \end{pmatrix} = \begin{pmatrix} a_1^2 & a_1a_2\cos(\alpha_1) \\ a_1a_2\cos(\alpha_1) & a_2^2 \end{pmatrix}$$

In three dimensions,

$$\mathbf{G} = \begin{pmatrix} g_{11} & g_{12} & g_{13} \\ g_{21} & g_{22} & g_{23} \\ g_{31} & g_{32} & g_{33} \end{pmatrix} = \begin{pmatrix} \mathbf{a}_1\cdot\mathbf{a}_1 & \mathbf{a}_1\cdot\mathbf{a}_2 & \mathbf{a}_1\cdot\mathbf{a}_3 \\ \mathbf{a}_2\cdot\mathbf{a}_1 & \mathbf{a}_2\cdot\mathbf{a}_2 & \mathbf{a}_2\cdot\mathbf{a}_3 \\ \mathbf{a}_3\cdot\mathbf{a}_1 & \mathbf{a}_3\cdot\mathbf{a}_2 & \mathbf{a}_3\cdot\mathbf{a}_3 \end{pmatrix} = \begin{pmatrix} a_1^2 & a_1a_2\cos(\alpha_3) & a_1a_3\cos(\alpha_2) \\ a_1a_2\cos(\alpha_3) & a_2^2 & a_2a_3\cos(\alpha_1) \\ a_1a_3\cos(\alpha_2) & a_2a_3\cos(\alpha_1) & a_3^2 \end{pmatrix}$$

The distance between two points Q and R in the unit cell can be determined from the relation:

$$ d_{qr}^2 = \sum_{i, j} g_{ij} (r_i - q_i)(r_j - q_j) $$

The distance from the origin of the unit cell to a point Q within the unit cell can be determined from the relation:

$$ OQ = r_q; r_q^2 = \sum_{i, j} g_{ij} q_i q_k $$

The angle formed from three points Q, P (apex), and R within the unit cell can determined from the relation:

$$cos(QPR) = (r_{pq})^{-1}(r_{pr})^{-1}\sum_{i, j}g_{ij}(q_i - p_i)(r_j - p_j)$$

The volume of the unit cell, $$V$$ can be determined from the relation:

$$V^2 = \det(\mathbf{G})$$

Supporting file formats

 * CPMD input
 * CIF