The same structure can be represented in an infinite number of coordinate systems (“modular invariance”). Most of these equivalent choices will lead to very flat unit cells, which creates problems for structure relaxation and energy calculation (*e.g.*, a very large number of -points are needed). The constraint, well known in crystallography, that the cell angles be between 60 and 120, does not remove all redundancies and problematic cells (*e.g.*, thus allowed cells with are practically flat). Therefore, we developed ^{23; 24} a special scheme to obtain special cell shapes with the shortest cell vectors. This transformation can be performed if there is at least one lattice vector whose projection onto any other cell vector or the diagonal vector of the opposite cell face is greater (by modulus) than half the length of that vector, *i.e.*, for pairs and , or and these criteria are:

(2) | |||||

(3) | |||||

(4) | |||||

(5) |

For instance, for the criterion 2 the new vector equals:

(6) |

This transformation is performed iteratively, completely avoids pathological cell shapes, and thus solves the problem. During this transformation, the atomic fractional coordinates are transformed so that the original and transformed structures are identical (during the transformation, the Cartesian coordinates of the atoms remain invariant).

*variable* `minVectorLength`

*Meaning*: Sets the minimum length of a cell parameter of a newly generated structure.

*Default*: `1.8 covalent diameter of the largest atom. For molecular crystals ( calculationType = 310, 311) default value is 1.8 max(MolCenters).`

*Format*:

`2.0 : minVectorLength`

Commonly used computational methods (pseudopotentials, PAW, LAPW, and many parametric forcefields) break down when the interatomic distances are too small. This situation needs to be avoided and you can specify the minimum distances between each pair of atoms using the `IonDistances` square matrix cast in an upper-triangular form:

*variable* `IonDistances`

*Meaning*: Sets the minimum interatomic distance matrix between different atom types. Distances lower than `IonDistances` are considered entirely unphysical and will be strictly avoided.

*Default*: `the IonDistances between atom A and B are estimated as but not larger then 1.2 , and in molecular calculations, where and are the default volumes of atom A and B estimated in USPEX. `

*Format*:

`% IonDistances1.0 1.0 0.8 0.0 1.0 0.8 0.0 0.0 1.0 % EndDistances`

**Note:** The dimensions of this matrix must be equal to the number of atomic species. If the compound in the example above is MgSiO, the matrix reads as follows: the minimum Mg–Mg distance allowed in a newly generated structure is 1.0 , the minimum Mg–Si, Si–Si and O–O distances are also 1.0 , and the minimum Mg–O and Si–O distances are 0.8 . You can use this keymatrix to incorporate further system-specific information: *e.g.*, if you know that Mg atoms prefer to be very far apart and are never closer than 3 in your system, you can specify this information. Beware, however, that the larger these minimum distances, the more difficult it is to find structures fulfilling these constraints (especially for large systems), so strive for a compromise and remember that `IonDistances` must be **much** smaller than the actual bond lengths.

*variable* `constraint_enhancement`

*Meaning*: Allows one to apply the stricter constraints of the `IonDistances` matrix (by `constraint_enhancement` times) for symmetric random structures (for all variation operators, unenhanced `IonDistances` matrix still applies). Only use it if you know what you are doing.

*Default*: `1`

*Format*:

`1 : constraint_enhancement`

For molecular crystals, the following keyblock is extremely important:

*variable* `MolCenters`

*Meaning*: Matrix of minimal distances between the centers of molecules. Any distances lower than these indicate large overlap of the molecules, are unphysical and will be strictly avoided.

*Default*: `zero-matrix for non-molecular calculations, no default for molecular crystals (must specify explicitly).`

*Format*:

`% MolCenters 5.5 7.7 0.0 9.7 % EndMol`

**Note:** In the above example, there are two types of molecules. In all of the generated structures, the distance between the geometric centers of the molecules of the first type must be at least 5.5 (A–A distance), the distance between the centers of the molecules of the first and second type — 7.7 (A–B distance), and the distance between the molecules of the second type — 9.7 (B–B distance).