---
title: 'XtalOpt: Evolutionary Crystal Structure Prediction'
url: https://www.emergentmind.com/topics/xtalopt-evolutionary-algorithm
type: topic
---

# XtalOpt: Evolutionary Crystal Structure Prediction

Searching arXiv for the cited XtalOpt papers and closely related versions.
XtalOpt is an evolutionary algorithm for crystal structure prediction that maintains a population of candidate crystal structures and iteratively improves that population through local relaxation, fitness evaluation, parent selection, and genetic variation. In the versioned literature summarized here, it is described as a platform for global optimization of crystalline materials under fixed composition, structurally constrained searches for metastable phases, multi-objective search for functional materials, and, in a later release, variable-composition Pareto optimization [2405.02138]. Across these formulations, the recurring goal is to discover low-enthalpy or otherwise targeted crystal structures by combining stochastic structure generation with physics-based local optimization and evolutionary selection.

## 1. Core evolutionary search formalism

In its population-based form, XtalOpt evolves candidate structures generation by generation. A generation consists of spawning new structures, locally relaxing every structure, evaluating fitness or filtering structures, selecting parents by roulette-wheel sampling weighted by fitness, applying genetic variation operators to produce offspring, and then replacing or augmenting the population with offspring while respecting constraints [2405.02138]. The search terminates when the user-specified maximum number of structures has been generated, when no fitness improvement is observed over a given number of generations, or when a hard or soft exit flag is triggered [2405.02138].

Each candidate structure is represented by a triplet consisting of lattice vectors, fractional atomic coordinates, and atom types. Internally, the lattice is stored as a $3\times 3$ matrix $A$, and atomic positions are stored as fractional vectors $\{s_i\}$, so that Cartesian coordinates are given by $x_i = A \cdot s_i$ [2405.02138]. In the fixed-composition setting, composition is constant throughout a run, although an extended grand-canonical version is noted elsewhere in the version-13 description [2405.02138].

The standard evolutionary workflow described for metastable-phase discovery follows the same structure. Initialization can be purely random or seed-assisted; every trial structure is geometry-optimized; duplicates are removed with XtalComp; low-enthalpy structures form a breeding pool; and standard operators such as lattice mutation, atomic-coordinate mutation, crossover, and chemical transmutation generate children for subsequent generations [2306.01873]. In that formulation, the top $N_{\rm pool}$ lowest-enthalpy structures are retained as parents, with $N_{\rm pool}=50$ in practice [2306.01873].

This continuity across releases suggests that XtalOpt’s identity is defined less by a single fitness formalism than by a stable evolutionary search engine onto which different objective schemes and constraints can be grafted.

## 2. Structure generation, relaxation, and diversity control

Initial structures are generated randomly within user-defined bounds. In version 13, the initial population is random within user-defined cell-volume and composition limits [2405.02138]. In the carbon superhardness study, random structures were generated using the RandSpg algorithm, with the number of formula units per primitive cell chosen by the user; for carbon, searches were performed with 8, 12, 16, and 20 atoms per cell, and random cell volumes were restricted to lie near that of diamond in order to bias the search toward realistic densities [1906.05886].

Local optimization is delegated to external engines. Version 13 states that every structure is locally relaxed via an external optimizer such as VASP or an interatomic potential [2405.02138]. In the 2019 superhard-materials study, every new structure was sent to VASP for a full geometry and cell-shape relaxation using PBE-GGA, PAW, and a 500 eV cutoff; $\Gamma$-centered k-meshes were chosen so that lattice constant times k-point count was approximately $25\,\text{\AA}$ in the final evolutionary-algorithm step, with tighter settings used for phonons and final energies, and convergence was imposed when all forces were below $1\times 10^{-5}\,\text{eV/\AA}$ [1906.05886]. In the structurally constrained study, DFT relaxations were performed in three steps—internal coordinates with fixed cell, then volume-only, then full relaxation—and precise re-optimizations used cutoffs between 600 and 1000 eV depending on the system [2306.01873].

Diversity control is handled explicitly. In the carbon study, after relaxation each child was compared to the existing pool via the XtalComp duplicate-checking routine, and only genuinely new minima were retained [1906.05886]. The structurally constrained study likewise states that XtalComp identifies and removes duplicates from the population [2306.01873]. Duplicate removal functions as a mechanism for preventing the evolutionary search from repeatedly sampling symmetry-equivalent or near-identical minima.

## 3. Fitness functions and multi-objective optimization

For single-objective search, XtalOpt uses enthalpy minimization. In version 13, the fitness of structure $s$ is

$$
f_s = \frac{H_{\max}-H_s}{H_{\max}-H_{\min}} \in [0,1],
$$

with enthalpy defined as

$$
H_s = E_s + P\,V_s,
$$

where $E_s$ is the internal energy from the local optimizer, $P$ is the external pressure, and $V_s = |\det(A_s)|$ is the unit-cell volume computed from the lattice matrix [2405.02138]. Pressure is either taken from the DFT run for variable-cell relaxations or set to the user-specified external pressure [2405.02138].

Version 13 generalizes this to a decomposition-based multi-objective evolutionary search. If $\{X\}=\{X^1,\dots,X^m\}$ are objectives to be minimized and $\{Y\}=\{Y^1,\dots,Y^n\}$ are objectives to be maximized, and each objective is normalized between current population extrema, the generalized fitness is

$$
f_s =
\sum_{i=1}^m
w_X^i\;\frac{X^i_{\max}-X^i_s}{X^i_{\max}-X^i_{\min}}
+
\sum_{j=1}^n
w_Y^j\;\frac{Y^j_s - Y^j_{\min}}{Y^j_{\max}-Y^j_{\min}},
\qquad
\sum_i w_X^i + \sum_j w_Y^j = 1.
$$

Enthalpy is always included as the first objective in $\{X\}$ unless the user explicitly assigns it zero weight, so that the search remains anchored to low-enthalpy, (meta)stable structures while allowing properties such as band gaps, hardness, or elastic moduli to be optimized in parallel [2405.02138]. The same source explicitly distinguishes this weighted linear scalarization from Pareto-based schemes such as NSGA-II: version 13 does not perform non-dominated sorting or crowding-distance selection, and no explicit Pareto front is constructed [2405.02138].

A concrete earlier realization of multi-objective XtalOpt appears in the carbon study, where each relaxed individual acquires both its $0\,\text{K}$ enthalpy $E_i$ and an estimated Vickers hardness $H_{v,i}^{\mathrm{ML}}$, and the combined fitness is

$$
p_i = N \Biggl[ 1
- w\,\frac{H_{v,\max}-H_{v,i}}{H_{v,\max}-H_{v,\min}}
-(1-w)\,\frac{E_i-E_{\min}}{E_{\max}-E_{\min}}
\Biggr],
$$

with $w=0.5$ and $N$ chosen so that $\sum_i p_i=1$ [1906.05886]. There, roulette-wheel selection is applied after sorting the pool by descending $p_i$ and renormalizing over the retained population [1906.05886].

Version 14 marks a methodological transition. It introduces Pareto optimization for variable-composition search and uses distance above the convex hull, $\Delta H$, rather than raw enthalpy as the energetic stability objective [2506.17246]. In Basic mode, objectives are still normalized and combined through a scalar fitness, but in Pareto mode the raw objectives, including $\Delta H$, enter non-dominated sorting directly and weights are not used [2506.17246]. The version-14 description therefore positions Pareto optimization as a replacement for weighted-sum-only optimization in that release [2506.17246].

## 4. Genetic operators and constrained search mechanisms

The principal variation operators retained in version 13 are lattice mutation, atomic-position mutation, cut-and-splice crossover, and optional symmetry-based moves [2405.02138]. Lattice mutation applies a small random symmetric strain $\epsilon$ to the lattice via $A' = (I+\epsilon)\cdot A$, with $\epsilon_{ij}\sim\mathcal{U}(-\Delta,\Delta)$ [2405.02138]. Atomic-position mutation displaces each fractional coordinate by up to $\delta$ in each direction and folds positions back into $[0,1)$ [2405.02138]. Cut-and-splice crossover selects a random plane in fractional coordinates, splits two parent crystals along that plane, and reassembles halves from each parent before rescaling to avoid atomic overlaps [2405.02138]. Symmetry-based moves can raise or lower the space-group symmetry by small perturbations followed by re-symmetrization [2405.02138].

The carbon superhardness implementation describes crossover and single-parent mutation in less formal but compatible terms, including shuffling atoms and small cell-shape perturbations [1906.05886]. Version 14 broadens the operator set to crossover, stripple, permustrain, permutomic, permucomp, and optional random supercell mutation, with operator probabilities derived from adjustable integer weights [2506.17246]. In fixed-composition or multi-composition searches, operators that would change composition are skipped; in variable-composition mode, composition can change through crossover of parents with different stoichiometries, atom addition or removal, and random generation of new compositions [2506.17246].

Constrained search was developed explicitly in the structurally constrained evolutionary algorithm. Rather than continuously mixing energetic and structural metrics, each structure is assigned

$$
f(s)=
\begin{cases}
E(s), & \text{if all constraints pass,}\\
E_{\rm pen}\gg E_{\max}, & \text{if any constraint fails,}
\end{cases}
$$

with $E_{\rm pen}=99\,\text{eV}$ per formula unit, ensuring that failing structures never enter the top-$N_{\rm pool}$ breeding pool [2306.01873]. Constraint checks occur after DFT relaxation and before selection [2306.01873].

The structural constraints supported in that work include coordination-number filters, local chemical-environment requirements, Bravais-lattice filtering, and space-group filtering, all implemented through Pymatgen analysis [2306.01873]. Coordination numbers are defined by a user-chosen cutoff $r_{\rm cut}$, with examples such as $1.5\,\text{\AA}$ for N–N or C–N bonds [2306.01873]. Bravais lattice is determined with symmetry-analysis tolerance 0.02, and the space-group number can be required to match a target value [2306.01873].

Version 13 incorporates a related but more general “filtration” objective. A user may specify `objective = fil /path/filter.sh out.dat`; the filter script reads `output.POSCAR` or other files and writes exactly one integer, 1 for keep or 0 for discard [2405.02138]. Structures for which the script returns 0 are removed from the parent pool entirely, though they remain in the overall archive [2405.02138]. Parents are drawn only from the filtered pool, and any child that fails the filter is immediately rejected or replaced according to the user’s policy, prior to any relaxation or objective evaluation [2405.02138].

A plausible implication is that XtalOpt’s constrained-search capability evolved from hard structural screening tightly coupled to enthalpy ranking toward a more general framework in which arbitrary user scripts can enforce admissibility conditions at the parent-pool level.

## 5. Software architecture, interfaces, and execution model

Version 13 describes the software architecture as a C++ core with Qt for the GUI, supplemented by a Python/C shell for job scripting and for user-provided objective scripts [2405.02138]. Relaxations and objective evaluations are submitted asynchronously either to a local queue or to a remote scheduler such as PBS or SLURM; the code tracks job submission IDs, monitors completion, and parses outputs [2405.02138]. The main modules listed are the Search Engine, Scheduler Interface, Objective Manager, and IO Manager [2405.02138].

The Objective Manager is responsible for launching user scripts, parsing single-value outputs, applying weights, and handling filtering [2405.02138]. The IO layer reads and writes input flags, POSCAR outputs, `structure.state` logs, and `results.txt` live ranking files [2405.02138]. Important command-line input entries include structure limits, composition, optimizer type, population size, maximum number of structures, queue settings, and a list of objectives with associated scripts and weights [2405.02138]. The output includes one column per objective plus fitness in `results.txt`, per-structure `output.POSCAR` and state files, and various global logs [2405.02138].

Version 14 extends the execution model by supporting local optimizers that can read and write VASP POSCAR/CONTCAR plus OUTCAR, including VASP, CP2K, and Quantum ESPRESSO, and by providing a Python wrapper, `vasp_uip.py`, to connect ML potentials such as MACE or CHGNet through ASE for rapid relaxations [2506.17246]. It also introduces explicit support for fixed-composition, multi-composition, and fully variable-composition search modes [2506.17246].

The asynchronous job-scheduling model in version 13 is described as enabling scaling to hundreds of concurrent relaxations on modern HPC clusters [2405.02138]. That statement is paired with the observation that lightweight objective scripts contribute to efficient and robust high-throughput crystal-structure prediction workflows [2405.02138]. This suggests that the software is intended not only as an evolutionary search engine in the abstract, but also as an HPC-oriented orchestration layer for large numbers of external relaxation and property-evaluation jobs.

## 6. Applications, benchmarks, and methodological trajectory

The 2019 superhard-carbon study provides an early demonstration of XtalOpt as a multi-objective search tool directed toward low-enthalpy, superhard materials. The workflow combined VASP relaxations, AFLOW-ML estimates of shear modulus, the Teter hardness model $H_{v,\mathrm{Teter}} = 0.151\,G$, and a combined energy-hardness fitness [1906.05886]. Four searches on carbon cells with 8, 12, 16, and 20 atoms produced 5,624 relaxed minima [1906.05886]. Screening criteria of $H_v^{ML}>40\,\text{GPa}$ and $E_i\le -8.80\,\text{eV/atom}$ yielded 827 superhard, low-energy structures out of 1,324 low-energy structures; removing duplicates left 89 distinct minima, of which phonon calculations found 79 dynamically stable, including 43 newly predicted superhard phases [1906.05886]. The paper also reports a diamond reference hardness of $75.6\,\text{GPa}$ and two newly predicted polytypes, $R3m$-16 and $R\bar{3}m$-16, with $H_v^{ML}\approx 76.2\,\text{GPa}$ [1906.05886].

The structurally constrained study benchmarks targeted metastable-phase discovery across XeN$_8$, TiO$_2$, BaH$_4$, and WC$_3$N$_6$ [2306.01873]. In XeN$_8$ at 50 GPa, a coordination-constrained run discarded 57.4% of candidates and located the desired $P\bar{1}$–II 2D-polymeric phase at approximately the 250th structure, whereas an unconstrained run of approximately 1500 relaxations did not recover that phase [2306.01873]. In TiO$_2$, an orthorhombic Bravais-lattice constraint identified brookite as the 345th structure, compared with the 1141st structure in the unconstrained run [2306.01873]. In BaH$_4$ at 50 GPa, a space-group-constrained run found the correct $I4/mmm$ phase after about 65 relaxations, compared with a ranking of 354th in the unconstrained search [2306.01873]. In WC$_3$N$_6$, a chemical-environment-constrained run discovered a new salt-like melaminate $P\bar{1}$ phase as the 515th structure, 53 meV/atom above the $Im\bar{3}m$ ground state and 29 meV/atom below a previously proposed $P1$ phase in D3(BJ) results; phonon spectra confirmed dynamical stability [2306.01873].

Version 13 itself does not report a new performance benchmark in the manuscript, but it cites earlier applications of XtalOpt’s multi-objective evolutionary search and states that searches with tens to hundreds of structures per generation typically converge to low-enthalpy or metastable candidates within a few hundred to one thousand total structures [2405.02138]. Version 14, in turn, reports in-house tests on the XtalOpt website showing that variable-composition plus Pareto searches locate new ternary oxide and nitride phases in fewer generations than fixed-composition or multi-composition alone, and that an ML-potential wrapper can speed local relaxations by 10–100× versus DFT [2506.17246].

Taken together, these studies trace a methodological trajectory: initial enthalpy-driven evolutionary search, addition of explicit property-driven scalarized fitness, introduction of hard structural filters for metastable targets, general multi-objective weighted linear scalarization in version 13, and finally variable-composition Pareto optimization around distance above the convex hull in version 14 [2405.02138]. A common misconception is that all XtalOpt multi-objective searches are Pareto-based; the version history shows instead that weighted-sum scalarization and Pareto optimization correspond to distinct stages of the codebase, with the former characterizing version 13 and earlier property-coupled studies, and the latter introduced explicitly in version 14 [2405.02138].

Source: https://www.emergentmind.com/topics/xtalopt-evolutionary-algorithm