WorksPhysics and Astronomy
Finite temperature and pressure structural relaxations including zero-point motion and anharmonicity
Abstract
At finite temperature and pressure, the equilibrium structure of a crystal minimizes the Gibbs free energy rather than the static Born-Oppenheimer energy. We present WARP (Wyckoff-constrained Anharmonic Relaxations at Pressure and temperature), a symmetry-constrained, variable-cell relaxation based on the stochastic temperature-dependent effective potential method, including anharmonicity and zero-point motion. Every position update is projected onto Wyckoff positions and every strain onto symmetric strains, so a relaxation can raise the symmetry but never lower it. For aluminum, the thermal expansion follows measurements at cryogenic temperatures, including the quantum plateau below 50 K. For lanthanum hydrides at megabar pressures, equations of state agree with phonon-based and path-integral calculations, and LaH relaxes from its rhombohedral static minimum to the observed cubic phase, also with a machine-learned potential fine-tuned on 150 supercells. For brucite, Mg(OD), lattice parameters, bond distances and thermal expansion agree with neutron diffraction, and the O-D isotope effect is captured.
Introduction
At finite temperature and pressure the equilibrium structure of a crystal minimizes its Gibbs free energy rather than its static enthalpy [1]. This is well documented across several material classes: hydrogen-rich compounds, a promising class of materials in the search for high-temperature superconductivity [2, 3, 4, 5, 6], hydrous minerals relevant for the structure and dynamics in planetary interiors [7, 8, 9, 10], perovskites relevant to optoelectronics [11], and thermoelectric materials [12].
Hydrogen is the element whose position is hardest to measure, in particular at high pressure. Hydrogen positions can in general not be determined from X-ray diffraction, and neutron diffraction is not commonly available above 25 GPa [13, 14]. Therefore, hydrogen content and positions are routinely inferred by matching the heavy-atom sublattice and volume to calculation. Such a comparison is only as good as the underlying calculation, where often temperature is not taken into account, which can have a significant influence on the actual finite temperature volume.
Two established routes to include temperature and nuclear quantum effects exist. Path-integral molecular dynamics (PIMD) treats the nuclei quantum mechanically [4, 15] [16, 17] and, with machine-learned inter-atomic potentials (MLIPs), has become computationally feasible even for large systems [18]; but it remains demanding. The extraction of high-symmetry equilibrium positions from a trajectory is not straightforward, and the reliability of pre-trained potentials under extreme conditions is an open question [19]. The second route is based on effective, finite temperature phonons.
As for example in the stochastic self-consistent harmonic approximation (SSCHA) [20, 21], the self-consistent phonon (SCPH) method as implemented in Alamode [22–24] and the temperature-dependent effective potential (TDEP) method [3] [25, 26, 27, 28, 29]; hiPhive [30], by contrast, is a code for fitting force constants rather than a method. SSCHA and TDEP fit force constants of arbitrary order to displacement–force data and calculate renormalised phonons and the properties derived from them; the reference structure around which the force constants are expanded is an input to the fit rather than an output of it. SSCHA allows relaxation of positions and cell on the free-energy surface [2] [20], symmetrising the structure, the gradient and the force constants at every step. Machine-learned interatomic potentials can reduce the cost of path-integral simulations [18] and SSCHA calculations [31, 32], while foundation-model-assisted workflows have also been developed for anharmonic crystal structure prediction [21, 33]. Finite-temperature structural optimization is already available within SSCHA [20, 34] and self-consistent phonon theory [24], while TDEP includes residual-force-based optimization of internal coordinates [35].
The method developed in this work, WARP (Wyckoff-constrained Anharmonic Relaxations at Pressure and temperature), built on stochastic TDEP (sTDEP) [36]. It relaxes the internal coordinates and lattice parameters at a given temperature and target stress tensor, including anharmonicity and zero-point motion. The relaxation workflow is shown in Figure 1. Every position update is projected onto the Wyckoff degrees of freedom of the current space group, and every cell update onto the symmetric strains of its point group. The relaxation is therefore symmetry-constrained by construction: it can raise the symmetry of a structure but never lower it, and the symmetry-forbidden part of the sampling noise never reaches the structure. Forces can come from density functional theory (DFT) or from a machinelearned interatomic potential through an ASE interface [37]. Sensible defaults are automatically chosen, so beyond a few physically meaningful tolerances and the sampling settings listed per system in Supplementary Section S3 the method needs no tuning. In this paper WARP is demonstrated on three test cases of increasing complexity: (i) the thermal expansion of aluminium down to cryogenic temperatures, which tests the quantum statistics of the sampling; (ii) the equations of state of four lanthanum hydrides at megabar pressures, together with the sub- to supergroup transition of LaH previously found at finite temperature [2]; and (iii) brucite, Mg(OD), a layered hydrous mineral whose hydrogen positions have been measured directly by neutron diffraction from 15 to 300 K, against which the lattice parameters, the layer geometry and the O–D distance are compared. Throughout, supercells obtained during the DFT-based sampling double as training sets for the fine-tuning of machine learned interatomic potentials, which allows further decreasing the computational cost of WARP relaxations by orders of magnitude. The output of WARP is a structure at which the thermally averaged forces and stress vanish.

Figure 1. The warp relaxation loop. A preconditioning stage builds a stable set of model force constants; the position loop then samples thermally displaced supercells, fits force constants, and moves the atoms by the Wyckoff-projected first-order displacement until the residual first-order force constants fall below tolerance; the lattice step subtracts the target stress from the internal stress of Eq. (12) and moves the cell by the symmetry-projected strain. After a lattice step the previous ensemble is no longer representative and is discarded. The loop closes when the internal stress matches the target within tolerance. The position-loop box lists the orders that are fitted there and not the sequence in which they are fitted, which is the second order, then the first-order force constants from the residual of Eq. (6), then the third order fitted to what is left. The “max FC1” of that box is ; the convergence gate of § 2 D is on the mean as well as the maximum.
Methods
The subsections up to Sec. II D describe the method, i.e. the algorithmic steps of initial guess, sampling, force-constant fitting, symmetrisation and update of positions and cell; Sec. II E and Supplementary Sections S3–S4 describe the implementation, i.e. the force engines behind the ASE interface, the defaults and the settings used per system.
The effective Hamiltonian and stochastic sampling
The TDEP method fits the force constants of a model Hamiltonian [25, 35, 38], whose potential energy is a model potential in the displacements of a reference structure . has the form,
and is fitted to forces computed on displaced supercells. is the fitted baseline energy of Eq. (21) of Hellman et al. [35]: the mean sampled potential energy minus the second-order model energy, written in Eq. (5) below; are the displacements, roman indices label atoms and greek indices Cartesian directions, and , and are the first-, second- and third-order force constants; the superscript in parentheses gives the order. These are explicit functions of the reference positions and of temperature, hence the name of the method: , and are effective force constants of the model at the current reference of the iterative process. They are obtained from the fit over the sampled ensemble, and not derivatives of the Born–Oppenheimer surface. In sTDEP [36], which is used throughout this work, the displaced supercells are drawn from a harmonic canonical ensemble built from the second-order force constants alone; and are fitted to the residual forces [39] and do not enter the sampling: enters only the position update (Sec. II B) and only the stress of the lattice update, Eq. (12). In this ensemble the displacements are described by,
where is the number of atoms in the supercell, the frequency of mode of the current second-order force constants, its eigenvector on atom , is the Bose–Einstein occupation. , are uniform random numbers on , drawn independently for every mode of every configuration. The combination is a Box–Muller transform, so every mode enters with an independent Gaussian amplitude, whose root-mean-square value on atom is . Given that , the square of is then given by which is the exact thermal mean-square amplitude of a quantized harmonic oscillator in the canonical ensemble [36, 40]. The displacements, as sums of independent Gaussians, follow the thermal distribution of the harmonic crystal. Every configuration is therefore an uncorrelated draw, and its displacements include the zero-point amplitude from the first step.
Equation (3) reduces to the two limits that bracket the problem. For the occupation vanishes, , and the amplitude becomes : the zero-point amplitude of the harmonic ground state, which is finite at . For the hyperbolic cotangent approaches , the cancels, and the amplitude reduces to —the equipartition result, independent of Planck’s constant.
In the presented examples, quantum-mechanical sampling is used, the cost is identical, since the two distributions differ only in the width assigned to each displacement. A mode with negative squared frequency receives zero amplitude in the sampled configurations (TDEP assigns no displacement to non-positive frequencies).
The stochastic sampling needs starting force constants to generate the first displacements. These can be harmonic force constants from a finite-displacement calculation, for instance with Phonopy [41], or the model force constants of Shulumba et al. [36], which are generated from a single parameter, the Debye temperature or an estimate of the maximum phonon frequency, taken for instance from experimental vibrational data. The preconditioning stage described below then replaces them with fitted ones.
For any Hamiltonian the derivative of the canonical free energy with respect to a parameter is the thermal average of the derivative of the Hamiltonian, . The equilibrium structure at temperature and target stress is therefore the one at which the thermally averaged forces vanish and the thermally averaged stress, nuclear kinetic contribution included, equals the target [34]; warp evaluates these two averages over the sTDEP ensemble (§ 2 B and the lattice update below) and moves the structure until they hold. The harmonic free energy of the converged model,
with
and
the mean sampled potential energy minus the second-order model energy of the samples, is the Gibbs–Bogoliubov bound whose stationary point the self-consistent sampling approaches [20, 35].
Position update and Wyckoff projection
The forces on the sampled configurations are fitted to the expansion of Eq. (1). If the reference structure is not at the finite-temperature equilibrium, these residual:VEVENT forces contain a systematic component. The orders are fitted in sequence [39], i.e. the first-order force constants are fitted to the residual after the second order and before the third,
where labels the atom and the Cartesian direction. A non-zero means there is a force acting on the atoms. Within the harmonic model built from the fitted second-order constants this force is
The equilibrium configuration is the one at which the forces vanish, . Because the second-order force-constant matrix is singular by translational invariance, Eq. (7) is solved for the displacement with the Moore–Penrose pseudo-inverse , which gives the least-squares solution
and the resulting equilibrium positions with applied displacements are
The force constants themselves are symmetry-reduced in the fit, so obeys the space-group symmetries. However, the displacement field is a least-squares solution built from a finite number of sampled forces, and its statistical noise is not symmetric. Applied repeatedly, this noise can lead to an accumulation of error and consequently a decrease in symmetry. The update is therefore projected onto the Wyckoff degrees of freedom before it is applied. At every iteration the space group of the current cell is determined with spglib [42], and the atoms are grouped into Wyckoff orbits, sets of atoms related to each other by the symmetry operations of the group, with rotation and translation . The site symmetry of each representative leaves between zero and three degrees of freedom. A site can move only along , a site only along , and a site not at all. Collecting these allowed directions in a matrix for orbit , a symmetry-compatible displacement of the orbit is
with one parameter vector per orbit, in the fractional coordinates of the cell; translations cancel because displacements are differences of positions. Given the raw displacements , is the least-squares solution over the whole orbit,
an overdetermined system since . The update is then made in parameter space: the site parameters of the orbit are moved by , where is a damping factor on the position update; 0.8 in this work unless stated otherwise and left to the user. Every member is regenerated from the new parameters by its symmetry operation, so the orbit stays to numerical tolerance on its Wyckoff position. Orbits with receive no displacement. The residual is the symmetry-forbidden part of the raw field: a direct measure of the sampling noise, and a check that the ensemble is large enough.
Three properties follow: (i) the projection maps onto the invariant subspace of the space group, so the update cannot lower the symmetry, by construction rather than by tolerance; (ii) it can raise it, since the higher-symmetry structure of a supergroup is a point in the parameter space of the subgroup, reached when the free parameters take special values such as or ; and (iii) because each parameter is averaged over all members of its orbit, its statistical error is never larger, and generally smaller, than that of a single atom’s displacement.
Lattice update
In the following, the convention is that stress is tension-positive and pressure compression-positive is used, i.e the pressure is minus one third of the trace of the stress. Within the model, the stress tensor can be defined as
where is the mean Born–Oppenheimer stress of the sampled configurations, the kinetic stress of the second-order model, evaluated as the harmonic virial of the fitted second-order force constants on the same displacements, Eq. (13), and a finite-grid correction from the third-order force constants, defined below. The first two terms carry the thermal stress. The sampled configurations are displaced on the full potential-energy surface, so contains the entire stress of the displacements, harmonic and anharmonic. What it lacks is the contribution of the nuclear momenta, since each configuration is a static snapshot; supplies it. For the second-order model this kinetic stress is known in closed form and, by the virial theorem of the harmonic oscillator, equals the harmonic virial of the fitted force constants on the sampled displacements [29],
with the sum over the modes of the supercell; the second form is the one used, because it cancels the harmonic part of the sampling fluctuation in term by term, and minus one third of its trace reduces to the ideal-gas pressure in the classical limit. For a harmonic crystal, cancels the tensile virial of the displacements in exactly, so returns the static stress and the crystal does not expand. Any departure of from the static stress is therefore anharmonic: it is the thermal stress that contributes to changes in the lattice. There are multiple ways to calculate the third order contributions to the stress. The third-order force constants carry the strain dependence of the second-order ones [29, 43],
and with it the mode-Grüneisen parameters and the Grüneisen stress of the model. The correction contains this mode-Grüneisen stress of the fitted third-order force constants twice, with opposite signs. The subtracted term, , evaluates it in real space on the sampled supercell; the added term, , evaluates it in reciprocal space which can be described as follows,
where the mode Grüneisen parameters, , come from the third-order force constants and the Bose–Einstein occupation is given as . They differ because only contains contributions from the wavevectors commensurate with the supercell, whereas can be evaluated on a denser mesh by Fourier interpolation of the same force constants. The correction thus replaces the supercell estimate of the Grüneisen stress by its value on the denser mesh. In the limit of a large supercell and many samples the two third-order terms cancel and restores the kinetic contribution that the static snapshots lack, so that reduces to the full thermally averaged stress of the sampled ensemble [29]; a relaxation with the second order alone converges to the same cell in that limit.
The cell is updated with the isothermal elastic constants , which TDEP computes in Voigt notation from the fitted second-order force constants [26]. Alternatively, a full elastic tensor can be supplied by the user. With the compliance , the difference between the internal stress and a user-supplied target stress can be used to calculate a strain,
an engineering Voigt strain whose shear components are halved when it is written back as a symmetric tensor. Before it is applied, the strain is projected onto the subspace allowed by the symmetry of the current cell. This symmetry is the point group of the space group, which contains the non-translational part of every operation of the space group. With denoting these operations in Cartesian coordinates, the projection is the group average
By Neumann’s principle [44], contains only the strain components a crystal of that symmetry may have: one for a cubic cell, two for hexagonal, trigonal and tetragonal, three for orthorhombic, four for monoclinic and six for triclinic. The removed part, , is the symmetry-forbidden component of the stress residual, which is pure sampling noise (the cell counterpart of the Wyckoff residual ); it is monitored at every lattice step.
The projected strain is applied to the lattice matrix,
where is a damping factor. Analogous to , is a base value , supplied by the user or unity, times a noise-referenced gain, , where is the largest component of the stress residual in units of its standard error over the sampled ensemble, and . Far from convergence, the full step is taken; once the residual is within a few standard errors of zero, the step shrinks smoothly, so that the last steps average over several sample sets instead of transferring the canonical sampling noise of the stress to the cell.
The user provides a target pressure. The target is given as pressures, positive in compression, and converted to stresses in the tension-positive convention. This way is supplied by the user and may take three forms: hydrostatic, with equal diagonal components; non-hydrostatic diagonal, with different normal stresses along the three axes; or a general non-diagonal tensor, including shear, i.e. ; a hydrostatic pressure thus corresponds to .
The relaxation workflow
The loop shown in Figure 1 consists of four stages.
A static variable-cell relaxation at the target pressure supplies the starting structure.
Initial model force constants are generated from an estimate of the maximum phonon frequency of the system or from its Debye temperature [36]. A small ensemble is sampled from these force constants, the forces are computed, and the force constants are refitted. The ensemble is then enlarged on a user-defined schedule, typically a geometric series such as 4, 8, 16, 32, 64 configurations chosen per system. In this schedule the samples of the previous iteration are also used in the fit of the current iteration. This is repeated until the phonon spectrum has no imaginary frequencies and the second-order fit reaches a cross-validation score . If neither is reached by the end of the schedule, the run stops. From the third ensemble of the schedule on, the positions are updated, provided the lowest phonon frequency is above THz.
A user-defined number of configurations is sampled from the current force constants and their forces are computed. The force constants are fitted order by order: the second-order force constants first, then the first-order force constants from the residuals, Eq. (6), and finally the third-order force constants from the residual that remains after both second and first order contributions are subtracted. The Wyckoff-projected displacement is then applied. These steps repeat until the mean and maximum of are below a chosen tolerance. If the root-mean-square change of the fractional coordinates in a step is below a threshold, the samples of that step are merged into the next fit, so that the ensemble accumulates while the structure changes little; otherwise the next step is fitted on fresh samples only. The first position step after a lattice update always uses fresh samples.
d. Lattice. The force constants are refitted on the accumulated ensemble, the phonon contribution to the stress and the compliance tensor are computed, and the cell is updated by the damped, symmetry-projected strain. The lattice loop has converged when three conditions hold together: (i) is below a chosen pressure tolerance; (ii) the change in the phonon contribution to the stress between successive lattice steps is below the same tolerance; and (iii) the relative volume change of the cell in the preceding lattice step, , is below 1%. Conditions (ii) and (iii) guard against a step that merely happens to cross the target. Optionally, to avoid demanding a convergence criterion below the sampling noise, the option is there to raise the tolerance for each stress component is to times its standard error over the sampled ensemble, given that this new condition is larger than the originally requested tolerance. Checkpoints are written after every stage, so a run interrupted at any step resumes from the last completed stage.
Machine-learned interatomic potentials
Even though sTDEP is highly efficient, running several tens or hundreds of supercell calculations per point can become very computationally expensive. Especially when the physical effects over a range of temperatures and pressures are evaluated. Since warp requires only the forces and stresses, one can replace the DFT engine with an MLIP. In warp the force engine is interfaced through the Atomic Simulation Environment [37], so any calculator can be used. The potentials used in this work are UPET models [45], foundation models of the PET architecture [46] pre-trained on the OMat24 dataset [47] and fine-tuned on DFT reference configurations of the system at hand. The training sets, splits, fine-tuning settings and held-out errors of every potential are given in Supplementary Section S4.
Results
As WARP provides us with new and efficient routes to structures at finite temperature and high pressure conditions, we wanted to test the capabilities of this method. The three systems (Figure 2) test different parts of the method. In face-centred cubic aluminium, every atom sits on a site without a free Wyckoff parameter, so the position update returns no displacement and only the cell is relaxed. The hydrogen sites of the lanthanum hydrides do have free parameters, and in the LaH transition of Sec. III B these parameters converge to values at which the rhombohedral hydrogen sites become the and sites of ; this is the most direct test of the position projection. In brucite, oxygen and deuterium each sit on the three-fold axis with one free parameter, and the O–D distance of Sec. III C depends on these two parameters and on the lattice parameter, so it tests the position and cell updates together. In all three cases, convergence is judged on the residual forces and the stress at the resolution of the sampled ensemble.

Figure 2. The three test systems as relaxed with WARP. (a) Aluminium, fcc, a block of conventional cells. (b) LaH in its cubic phase at 150 GPa and 300 K, with the La-centred H cages. (c) Brucite, Mg(OD), at 300 K: four layers of edge-sharing MgO octahedra, with the O–D groups pointing into the gap between them. Rendered with CrysViz (https://crysviz.org/).
Thermal expansion of aluminium
Aluminium is one of the most thoroughly characterised metals, with reliable thermal expansion data to cryogenic temperatures [48], and its use in aerospace structures makes its low-temperature dimensional stability of direct engineering interest [50]. Figure 3 shows the comparison of the calculated lattice parameter with the measurements of Figgins et al. [48] from 20.4 K to around 120 K at , where the measured series ends. The fractional change follows the measurement, including the curvature below 100 K that a classical treatment does not contain [28]. Towards higher temperatures the calculated fractional difference falls below the measured expansion. The absolute lattice parameter sits 0.026 Å, or 0.65%, above the measurement, and that offset is close to constant across the range.

Figure 3. Aluminium at low temperature. Left: absolute lattice parameter. Right: fractional change relative to the lowest experimental point at 20.4 K [48]; Both series end near 120 K, and the dotted continuations at the right-hand edge of each panel carry no data. The curvature below 100 K is reproduced.
Lanthanum hydrides at megabar pressure: equations of state
Lanthanum hydrides are hydrogen-rich, strongly anharmonic, at megabar pressure, and known to be poorly described by static DFT, with finite-temperature and nuclear-quantum effects narrowing but not closing the gap to experiment [3]. Figure 4 compares the WARP calculated pressure–volume relations for LaH, LaH, LaH and LaH at 300 K with the TDEP results of Laniel et al. [3], PIMD by Wang et al. [49] and by van de Bund and Ackland [4], and SSCHA by Errea et al. [2]. The volumes as calculated with WARP are in excellent agreement across all four stoichiometries and the full pressure range, over volume changes of more than ten per cent, with 16–40 configurations per position step in cells of up to 231 atoms. As previously described, the large number of DFT supercell calculations needed for a full P-V equation-of-state (EOS) at a given temperature can be computationally demanding if large ranges are explored and analyzed. For this reason we evaluated the use of MLIPs. Every supercell sampled in the DFT-force relaxations is a first-principles calculation, and these supercells can serve as the training set for a potential used in the same relaxation (Figure 5). Several benchmarks were performed in order to investigate the efficient of training a potential from the DFT samples. Initially all 3383 samples from the full DFT-based simulations were used to fine-tune a UPET model [45, 46], containing LaH, LaH, and LaH structures over a wide pressure range, as described in the methods section. Two extrapolations were built into the test deliberately; i) LaH is absent from the training set, and ii) the pressure range extends below the lowest trained pressure.

Figure 4. Pressure–volume relations of lanthanum hydrides at 300 K. Squares: TDEP calculations of Laniel et al. [3]. Open triangles: PIMD of van de Bund and Ackland [4], Wang et al. [49]. Crosses: SSCHA of Errea et al. [2]. Filled black circles: WARP with DFT forces. Open circles: WARP with the transfer-learned potential; LaH and the pressures below 118 GPa were not in its training set. There are ten filled circles, three for LaH, three for LaH and two each for LaH and LaH; where both were run at the same pressure the filled circle is drawn over the open one. PIMD triangles are drawn in front. Solid lines: the static (0 K) DFT Birch–Murnaghan equations of state. Dashed lines: Birch–Murnaghan curves through the 300 K points, the WARP DFT-force points together with the TDEP points of Laniel et al. [3] for LaH and LaH, and the WARP DFT-force and potential points for LaH and LaH, with held at the static value; the legend shortens this to a fit through the WARP points. They are guides for reading the PIMD and SSCHA points against the finite-temperature result rather than the static one.

Figure 5. The two ways to run the relaxation. (a) With DFT forces, every sampled supercell is a first-principles calculation. The loop consists of preconditioning, Wyckoff-projected position updates, and lattice updates through the symmetry-projected strain, until the internal stress matches the target (details in Figure 1). (b) The supercells sampled in (a) form the reference set for fine-tuning a foundation potential. The relaxation then restarts from the beginning: since every quantity must be consistent with the force engine used throughout, the reference structure is first re-relaxed to the static 0 K minimum of the fine-tuned potential itself, after which the same loop runs at any temperature and pressure. For at 150 GPa, the 150 DFT supercells taken from the first three iterations of the DFT-force run were the entire first-principles cost.
The DFT based calculations supply ten reference volumes across the four stoichiometries, and at every tested pressure, the potential reproduces the reference volume to within 0.4%: with the largest deviation at 150 GPa, ranging from 0.27% for LaH, to 0.35% for LaH. For LaH, the agreement is 0.01% at 140 GPa (34.547 against 34.549 Å per La) and 0.2% at 110 GPa (36.919 against 36.998 Å per La). The largest error is 1.87% for the out-of-distribution LaH,
LaH at 150 GPa was further investigated in order to benchmark whether the method captures finite-temperature phase transitions correctly. Static PBE relaxation result in a rhombohedral LaH structure, whereas the experimentally observed structure is cubic (). Errea et al. [2] showed with SSCHA that quantum nuclear motion stabilises the cubic phase [2]. In their approach they used up to 1000 configurations per population in an 88-atom supercell. Starting from the rhombohedral structure, WARP reproduces this quantum stabilisation with 40 configurations per position step in a 231-atom cell. In six lattice steps, the rhombohedral angle reduces from 62.327° to 59.962°, compared to 60° for the cubic cell, and the hydrogen parameter reaches , the value of the special Wyckoff position in the cubic space group. The site keeps one free parameter in , so its signature of the transition is not a fixed value but the merging of its three rhombohedral parameters into a single one, 0.1207 (Figure 6). No symmetry was imposed on the result, only on each step. A WARP relaxation confined to can therefore converge efficiently into without the cubic symmetry being imposed.

Figure 6. LaH at 150 GPa and 300 K: with DFT forces. (a) Rhombohedral angle of the primitive cell against relaxation step, counting every preconditioning, position and lattice step. Seven plateaux, and therefore six lattice steps, take it from to . (b) Hydrogen Wyckoff parameters in the cubic setting. The parameter, measured from the La site, reaches . The three parameters of the orbit, one for the pair on the three-fold axis and two for the six off-axis atoms, measured from the cage centre, merge into the single value of the one free parameter of the cubic site. Compare Extended Data Fig. 8 of Errea et al. [2].
To test how little DFT data is needed, the foundation model was fine-tuned on only 150 supercells taken from the first three lattice steps of the DFT-force run of LaH, 120 structures were used for training, 15 for validation and 15 for testing. None of these supercells were close to the cubic endpoint, yet the relaxation with this potential reproduces the transition (Supplementary Fig. S1). The 150 DFT supercells are therefore the entire first-principles cost of the complete WARP relaxation (Figure 5b).
Brucite Mg(OD): Direct comparison with neutron diffraction data
The hydrogen positions of the lanthanum hydrides could only be compared with other calculations. In brucite, however, the hydrogen positions have been measured directly. It is stable at ambient pressure and the structure of deuterated samples has been measured by neutron diffraction from 15 to 300 K [51], making it a model for the hydrous minerals of planetary interiors [7, 8]. Mg(OD) is a layered hydroxide in which sheets of octahedral MgO are separated by a gap. Every O–D unit is oriented towards this gap. Its structure therefore contains two kinds of distances between atoms, those within a sheet of polyhedra and those across the gap (Figure 7). The crystal structure is in space group , where O and D each occupy the three-fold axis with one free parameter , the computed O–D distance, , is a distance between mean positions. Chakoumakos et al. [51] modelled the deuterium atoms both on a single site on the axis and over three sites displaced from it; the uncorrected O–D distance of the single-site model is given by the same expression and is the quantity compared here.

Figure 7. Brucite Mg(OD) and the two parts into which its thermal expansion is resolved. The structure at 300 K relaxed with the PBE+D3 potential, viewed along with vertical: edge-sharing MgO octahedra (blue), oxygen (red) and deuterium (white), with the shortest D···O contacts across the gap dashed. The octahedral layer is measured between the two oxygen planes of one sheet and the interlayer between the oxygen planes on either side of the gap; the shaded bands mark the two regions in every layer.
Mg(OD) was relaxed at ambient pressure from 15 to 300 K, with the UPET potential [45] fine-tuned on thermally displaced supercells from PBE+D3 DFT based calculations (Supplementary § 4.0.3); it reproduces the static PBE+D3 cell to 0.3% or better (Supplementary § 4.0.1). The values at every temperature are taken from the last lattice step of each relaxation and are listed in Supplementary Table S2. Because the thermal expansion of brucite between 15 and 300 K is only 0.027 Å in , every lattice step averages the stress over 1024 configurations of the 215 atom cells. The 512 samples of the position step are included in the lattice step. The standard error of is 0.07–0.09 GPa, which, with using the measured elastic constants [52], corresponds to around 0.008 Å (0.2%) in and around 0.0002 Å in ; the octahedral layer and the O–D distance, which follow from the positions, are resolved to around 0.001 and 0.0003 Å.
The cell and the bond distances agree with experimental values over the complete temperature range (Figure 8a–Figure 8c): is 1.3 to 1.4% longer and 1.2 to 1.5% shorter than measured, the Mg–O bond 1.3 to 1.4% longer and the octahedral layer 1.0 to 1.9% thicker. The gap is slightly compressed, the interlayer distance being 3.2 to 3.7% the O···O distance across it 1.7 to 2.1% shorter, an offset already present in the static cell (Supplementary § 4.0.1).

Figure 8. Brucite Mg(OD) at ambient pressure against neutron diffraction. This work with the PBE+D3 potential and the deuterium mass on the hydrogen sites (dark blue diamonds, 15 K and 30–300 K in 30 K steps), with the protium-mass series behind it (light blue diamonds), against the neutron diffraction data of Chakoumakos et al. [51] (open black symbols). Every computed point is the final structure of its relaxation, the last lattice step. The lines join the computed points. (a) The lattice parameters (lower group) and (upper group) on one axis. (b) The octahedral-layer thickness (lower group) and the interlayer thickness (upper group). (c) The Mg–O bond (lower group) and the O···O distance across the interlayer gap (upper group). (d) The O–D distance against the single-site model of the neutron data (open circles); the inset shows the change of each series relative to its value at the lowest temperature, in percent. The computed O–D is the distance between the mean oxygen and deuterium positions with the deuterium on the three-fold axis, which is the quantity the single-site model gives.
The thermal expansion of the cell is in good agreement with experimental data: between 15 and 300 K the volume increases by 0.70%, against 0.79% measured, and by 0.012 Å, compared to 0.027 Å in measurements. Its partition between the octahedral layer and the interlayer distance, however, is reversed. In the calculation the increase of is carried by the interlayer distance (0.009 Å, against 0.003 Å for the octahedral layer), whereas in experiment it is carried by the octahedral layer (0.021 Å, against 0.006 Å for the interlayer distance), although the measured interlayer distance is not monotonic and its total change is only around twice its scatter between adjacent temperatures. The series with the protium mass shows the same partition (Supplementary § 4.0.1). Since the relaxation treats the sheets and the gap on the same footing, the likely origin is the description of the
forces across the gap, which are weak and dominated by dispersion: the thermal response of the interlayer distance is most likely not well captured by current density functionals. Establishing this requires a dedicated study of the interlayer distance, beyond the scope of the presentation of this method.
The computed O–D distance is 0.009 to 0.016 Å, or 0.9 to 1.7%, longer than the measured one (Figure 8d), and its temperature dependence shows a clear isotope effect. With the protium mass on the hydrogen sites the distance decreases by 0.0015 Å between 30 and 300 K. With the deuterium mass, which leaves the potential unchanged and alters only the amplitudes of the sampled motion, the decrease nearly doubles, to 0.0026 Å, against 0.0067 Å measured over the same range. The origin is the libration of the O–D unit, the motion of the deuterium perpendicular to the bond, which shortens the distance between the mean positions of oxygen and deuterium. The libration of the heavier deuteron lies lower in frequency and is thermally excited at lower temperature, so its amplitude, and with it the shortening, grows faster with temperature than for the proton, although at 300 K both are still dominated by zero-point motion. The measured distance first rises to a maximum of 0.9599 Å at 105 K and then falls; neither series shows this maximum.
Discussion
The central design choice of WARP, taking every step in the Wyckoff parameters and symmetric strains of the current space group, proves to be more than a convenience. It removes the symmetry-forbidden part of the sampling noise by construction, and, because the structures of a supergroup form a subspace of the parameter space of the subgroup, it allows the symmetry to rise when the free energy favours it. shows both: starting from the rhombohedral static minimum, the relaxation reaches the cubic phase without the transition being imposed, reproducing the quantum stabilization found with SSCHA by Errea [2], with 40 configurations per position step. Weighing the symmetry-allowed stress against its own standard error then lets the relaxation stop at the resolution of the ensemble rather than at an arbitrary tolerance. The resulting parameters agree perfectly with the results by Errea [2], see Extended Data Fig. 8 of Errea [2].
Where the results differ from experiment, they do so in ways that can be traced to the force engine rather than to the relaxation. The absolute lattice parameter of aluminium is 0.026 Å too large, while its fractional thermal expansion follows the measurement at cryogenic temperatures. In brucite, the cell, the bond distances and the thermal expansion agree with experiment, while the partition of the expansion between the octahedral layer and the interlayer distance points to the description of the interlayer by current density functionals. This makes WARP a tool for assessing force engines at finite temperature: with anharmonicity and zero-point motion included, the remaining differences from experiments can be traced to the functional or the potential.
The method has clear limits, each of which suggests its own extension. Because the projection lets symmetry rise but never fall, a structure that has reached the subspace of a supergroup stays there even if this is a saddle point of the free energy. The ensemble is a single Gaussian centred on the mean positions, which captures libration but not a distribution over several sites, such as the off-axis disorder of the deuterium in brucite; this part of the temperature dependence of the O–D distance remains outside the method. Finally, the lattice step is preconditioned by the fitted compliance tensor, which describes soft, long-ranged responses along the interlayer direction of brucite less well, so that the cell converges in tens of steps rather than a few. For such cases, WARP accepts a full elastic tensor supplied by the user, for instance from experiment, in place of the fitted one; since the compliance tensor only sets the step, this changes the path of the relaxation but not its fixed point.
Conclusion
WARP allows the relaxation of crystal structures at finite temperature and pressure on the effective Hamiltonian of sTDEP, with anharmonicity and zero-point motion included and every step confined to the symmetry of the current space group. It follows the measured thermal expansion of aluminium including its low-temperature quantum plateau, reproduces the equations of state of four lanthanum hydrides at megabar pressures, and finds the cubic phase of LaH from its rhombohedral static minimum, with DFT forces and with a potential fine-tuned on 150 of its own supercells. In brucite, a layered hydrous mineral, it places the deuterium atoms to within 0.016 Å of the measured O–D distance, picks up the isotope effect on that distance, and reproduces the cell and the Mg–O bond to within 1.5% from 15 to 300 K. Using density-functional or machine-learned forces through a common interface, warp makes finite-temperature structures accessible for systems ranging from metals and super-hydrides to hydrous minerals relevant to planetary interiors.
Data availability
The relaxed structures, force constants, training sets and fine-tuned potentials underlying the figures are available from the corresponding author on request.
Code availability
warp is available in the repository https://github.com/TEPEC-Physics-at-Extreme-Conditions/WARP.
Acknowledgements
We thank Rickard Armiento (Linköping University) for the tabulation of the space-group Wyckoff degrees of freedom on which the projector is built (https://symdata.anyterial.se/), and Gerd Steinle-Neumann (Bayerisches Geoinstitut, University of Bayreuth) for suggesting brucite as a test case. F.K. acknowledges support from the Swedish Research Council (VR) grant 2020-04630 and the Swedish e-Science Research Centre (SeRC). H.R.A.t.E. and F.T. acknowledge support through ERC Grant (UNMASCC-HP, 10.3030/101117758). Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them. F.T. acknowledges furthermore support from the Swedish government’s Strategic Research Area in Materials Science on Functional Materials at Linköping University (Faculty Grant SFO-Mat-LiU 2009-00971). Computations were enabled by resources provided by the National Academic Infrastructure for Supercomputing in Sweden (NAISS) on Dardel at PDC, partially funded by the Swedish Research Council through grant agreement no. 2022-06725. We acknowledge NAISS for providing access to the LUMI supercomputer, owned by the EuroHPC Joint Undertaking and hosted by CSC (Finland) and the LUMI consortium. For open access, the authors have applied a Creative Commons Attribution (CC BY) license to any Author Accepted Manuscript version arising from this submission.
Author contributions
H.R.A.t.E.: Conceptualization, Methodology, Software, Investigation, Formal analysis, Visualization, Writing – original draft. F.T.: Conceptualization, Funding, Supervision, Writing – review & editing. F.K.: Conceptualization, Writing – review & editing.
Competing interests
The authors declare no competing interests.
References
Supplementary Information for: Finite temperature and pressure structural relaxations including zero-point motion and anharmonicity
Henricus R. A. ten Eikelder; Florian Knoop; Florian Trybel
The transition with the LaH10-120-sample potential
Brucite: static cells and the finite-temperature structures
Table S1 gives the static PBE+D3 cell and that of the fine-tuned potential, each from a variable-cell relaxation of the five-atom cell. The potential reproduces the PBE+D3 cell to 0.3% or better in every quantity listed. The static cell already carries the offsets of the main text: against experiment at 15 K, is 2.4% and the interlayer 4.9% short.
Table S2 lists the final structure of every relaxation of the two series plotted in Figure 8, with the deuterium and with the protium mass on the hydrogen sites, together with the single-site neutron O–D interpolated to the same temperatures. Each entry is the last lattice step of its relaxation.
Isotope mass. The measured crystal is Mg(OD), and the series of Figure 8 is sampled with the deuterium mass, 2.0141 u, on the hydrogen sites; a second series with the protium mass is plotted behind it. The potential energy surface is the same for both isotopes, and the mass enters only through the thermal and zero-point amplitudes of the sampling and through the phonon frequencies (§ 4.0.4). The two series also differ in the compliance of the lattice update: the deuterium series uses the measured elastic constants [1] and starts at every temperature from the final cell of the protium series, which used the clamped-ion compliance of the fitted force constants (§ 4.0.2). At the same temperature the two series agree in to 0.0005 Å, in the octahedral layer to 0.0015 Å and in to 0.009 Å, with differences of either sign, which is within what a single relaxation resolves in . The partition of the expansion is the same: between 30 and 300 K the octahedral layer carries 20% of the increase of with deuterium and 17% with protium, against 79% in experiment. Over the same range the O–D distance decreases by 0.0026 Å with deuterium and by 0.0015 Å with protium, against 0.0067 Å measured.
| (K) | (Å) | (Å) | oct. layer (Å) | interlayer (Å) | Mg–O (Å) | O⋅⋅⋅O (Å) | O–D (Å) | neutron O–D, single-site (Å) | (O–D) (Å) |
| deuterium mass | |||||||||
| 15 | 3.1811 | 4.6723 | 2.1058 | 2.5664 | 2.1170 | 3.1559 | 0.9685 | 0.9563 | +0.0122 |
| 30 | 3.1814 | 4.6668 | 2.1049 | 2.5619 | 2.1170 | 3.1523 | 0.9688 | 0.9566 | +0.0122 |
| 60 | 3.1814 | 4.6691 | 2.1051 | 2.5640 | 2.1170 | 3.1540 | 0.9686 | 0.9582 | +0.0103 |
| 90 | 3.1814 | 4.6724 | 2.1057 | 2.5668 | 2.1171 | 3.1563 | 0.9687 | 0.9598 | +0.0089 |
| 120 | 3.1819 | 4.6736 | 2.1058 | 2.5678 | 2.1174 | 3.1573 | 0.9686 | 0.9590 | +0.0096 |
| 150 | 3.1825 | 4.6792 | 2.1066 | 2.5726 | 2.1179 | 3.1614 | 0.9684 | 0.9576 | +0.0108 |
| 180 | 3.1833 | 4.6815 | 2.1071 | 2.5744 | 2.1185 | 3.1631 | 0.9678 | 0.9562 | +0.0116 |
| 210 | 3.1846 | 4.6801 | 2.1071 | 2.5730 | 2.1191 | 3.1624 | 0.9675 | 0.9546 | +0.0129 |
| 240 | 3.1858 | 4.6825 | 2.1076 | 2.5749 | 2.1198 | 3.1643 | 0.9671 | 0.9530 | +0.0141 |
| 270 | 3.1868 | 4.6906 | 2.1091 | 2.5816 | 2.1207 | 3.1701 | 0.9663 | 0.9510 | +0.0152 |
| 300 | 3.1882 | 4.6841 | 2.1083 | 2.5757 | 2.1212 | 3.1212 | 0.9661 | 0.9499 | +0.0163 |
| protium mass | |||||||||
| 15 | 3.1814 | 4.6729 | 2.1062 | 2.5667 | 2.1173 | 3.1562 | 0.9688 | 0.9563 | +0.0126 |
| 30 | 3.1816 | 4.6700 | 2.1057 | 2.5643 | 2.1172 | 3.1544 | 0.9690 | 0.9566 | +0.0124 |
| 60 | 3.1818 | 4.6613 | 2.1042 | 2.5571 | 2.1170 | 3.1485 | 0.9692 | 0.9582 | +0.0110 |
| 90 | 3.1817 | 4.6715 | 2.1057 | 2.5658 | 2.1173 | 3.1556 | 0.9689 | 0.9598 | +0.0091 |
| 120 | 3.1823 | 4.6730 | 2.1058 | 2.5672 | 2.1176 | 3.1569 | 0.9689 | 0.9590 | +0.0099 |
| 150 | 3.1830 | 4.6743 | 2.1059 | 2.5684 | 2.1180 | 3.1581 | 0.9686 | 0.9576 | +0.0111 |
| 180 | 3.1836 | 4.6819 | 2.1074 | 2.5746 | 2.1186 | 3.1633 | 0.9684 | 0.9562 | +0.0122 |
| 210 | 3.1846 | 4.6802 | 2.1071 | 2.5731 | 2.1191 | 3.1625 | 0.9684 | 0.9546 | +0.0138 |
| 240 | 3.1858 | 4.6825 | 2.1078 | 2.5748 | 2.1198 | 3.1642 | 0.9682 | 0.9530 | +0.0152 |
| 270 | 3.1870 | 4.6875 | 2.1087 | 2.5788 | 2.1207 | 3.1680 | 0.9678 | 0.9510 | +0.0167 |
| 300 | 3.1886 | 4.6932 | 2.1097 | 2.5835 | 2.1217 | 3.1723 | 0.9675 | 0.9499 | +0.0176 |
Table S2. Brucite final structures by temperature. The final structure of every relaxation of the two PBE+D3 series plotted in Figure 8, with the deuterium mass (upper block, the main series) and with the protium mass (lower block): lattice parameters, octahedral-layer and interlayer thickness, the Mg–O bond, the O⋅⋅⋅O distance across the interlayer gap and the O–D distance between mean positions, with the single-site O–D of the neutron diffraction data of Chakoumakos et al. [2] interpolated to the same temperature and (O–D), the computed O–D minus the neutron one.
Computational details
Settings common to all systems. Density-functional theory [3, 4] was applied with the projector augmented-wave method [5] as implemented in Quantum Espresso [6, 7, 8], with PAW datasets from the PSLIBRARY tables [9] and PBE [10] and, for brucite, PBE with Grimme D3 dispersion [11]. Starting structures were relaxed to $10^{-4}$ eV Å$^{-1}$ and 0.05 GPa. The position-update guards are a maximum displacement of 2 Å and a minimum interatomic distance of 0.3 Å. Phonon sums—$F_\mathrm{ph}$, $\sigma_\mathrm{ph}$ and the densities of state—were evaluated on a $q$-point grid of the unit cell, the densest of $22^3$, $20^3$, $18^3$, $16^3$ and $14^3$ on which the interpolation of the fitted force constants succeeded. The position loop stops when the mean and the maximum $|\Phi^{(1)}|$ fall below 30 and 75 meV Å$^{-1}$, respectively, unless stated otherwise per system; those tolerances are bounded below by the standard error of the ensemble mean of {xref}Eq. (6)`, which falls as in the number of configurations, and by whatever part of the calculator’s force error is systematic rather than random. Plane-wave cutoffs were 80/640 Ry for Al, 100/700–800 Ry for the hydrides, 110/880 Ry for brucite.
Unless stated otherwise, every -mesh quoted per system below is the mesh applied to the sampled supercell, not to the unit cell. TDEP fits used quantum statistics throughout, supercells of (Al), , , and as listed per hydride below together with the 231-atom LaH cell of the transition, and the 215-atom non-diagonal cell for brucite, with 16–512 configurations per step as stated per system. The noise-referenced gain of the lattice update described in Methods, with , is used for the final lattice steps of the brucite series and of the LaH equation of state; earlier steps used .
Per system. Cutoffs are given as rc2 and rc3, the second- and third-order force-constant cutoff radii; the frequency quoted per system is the maximum phonon frequency used to generate the initial force constants; and the single pressure quoted per hydride is the reference state point of that entry, not the extent of the campaign. Al: fcc, PBE, scalar-relativistic PAW datasets from pslibrary 1.0.0, 80/640 Ry, a -centred -mesh, Gaussian smearing 0.01 Ry, self-consistency to Ry; sTDEP on supercells with rc2 6.0 and rc3 3.5 Å, initial force constants from a maximum frequency of 11 THz, 16 configurations per position step and 32 accumulated for the lattice step. Lanthanum hydrides: PBE, PAW datasets from pslibrary 1.0.0 with the lanthanum semicore states in valence, -centred -meshes, sTDEP at 300 K with 16 configurations per position step and 32 accumulated for the lattice step, the transition of LaH with 40. Each stoichiometry was run at 300 K on a 5 GPa grid from 110 to 170 GPa; Figure 4 plots the points computed. LaH: 100/700 Ry, -mesh, smearing 0.005 Ry, Ry; supercells of the 20-atom conventional cell (120 atoms), rc2 4.0 and rc3 2.5 Å, 53 THz, 125 GPa, pressure tolerance 0.1 GPa. LaH: 100/800 Ry, , 0.01 Ry, Ry; supercells, 4.0 and 2.5 Å, 43 THz, 125 GPa, 0.005 GPa. LaH: 100/800 Ry, , 0.01 Ry, Ry; supercells, 3.5 and 2.0 Å, 55 THz, 140 GPa, 0.1 GPa. LaH: 100/700 Ry, , 0.01 Ry, Ry; supercells for the equation of state and a 231-atom supercell (21 formula units) for the transition, 4.0 and 2.5 Å, 63 THz, 150 GPa, 0.005 GPa. Brucite: PBE with Grimme D3 dispersion (zero damping), 110/880 Ry, a -centred -mesh on the supercell, Gaussian smearing 0.01 Ry, self-consistency to Ry for the training supercells; the production series with the fine-tuned potential (the epoch-1140 checkpoint of § 4.0.3) on a non-diagonal supercell of 43 five-atom cells (215 atoms), the rows of its transformation matrix being , and , with rc2 5.67 and rc3 3.5 Å, initial force constants from a maximum frequency of 118 THz, 512 configurations per position step reused in the lattice step (1024 per lattice step), quantum statistics with the deuterium mass on the hydrogen sites and the measured elastic constants [1] as the compliance of the lattice update, every temperature started from the final cell of a series with the protium mass and the clamped-ion compliance (§ 4.0.1), , position-loop tolerances 30 and 75 meV Å, the noise-referenced gain and a pressure gate per component of 0.08 GPa or twice the standard error of the sampled stress, at 15 K and from 30 to 300 K in 30 K steps at ambient pressure. The static cells of Table S1 are Quantum ESPRESSO variable-cell relaxations of the five-atom cell with an -mesh and the cutoffs of the series.
| (Å) | (Å) | oct. layer (Å) | interlayer (Å) | Mg–O (Å) | O–D (Å) | (Å/atom) | |
| DFT PBE+D3 | 3.1684 | 4.6120 | 2.0839 | 2.5281 | 2.1052 | 0.9713 | 8.019 |
| potential PBE+D3 | 3.1676 | 4.6185 | 2.0897 | 2.5288 | 2.1063 | 0.9718 | 8.027 |
| neutron, 15 K [2] | 3.1408 | 4.7270 | 2.067 | 2.659 | 2.0874 | 0.9563 | 8.077 |
Table S1. Brucite static cells. Variable-cell relaxations of the five-atom cell at ambient pressure with PBE+D3 and with the fine-tuned potential. The octahedral-layer thickness is and the interlayer thickness is less that. The neutron O–D is that of the single-site model, the like-for-like comparison with the computed distance.
The fine-tuned potentials: training data, fitting and held-out errors
Three fine-tuned potentials are used: the full-set and LaH-120-sample potentials of Sec. IIIB and § 4, and the PBE+D3 brucite potential of Sec. IIIC. All share one protocol. The foundation model is pet-omat-l [12, 13, 14]; every parameter is trained (full fine-tuning, no adapters) with metatrain [15], on one energy head per DFT setting, with the loss weights 0.1 on the energy, 20 on the forces and 5 on the virial, a 5% linear warm-up and the learning rates, batch sizes and epoch counts of Table S4; provenance and coverage are in Table S3. Reference energies are aligned per DFT setting before training; forces and stresses are used as computed. Every set is split by whole sampling stage, never by frame, so a validation or test configuration always comes from a sampling stage the model has not seen. Every configuration is a thermally displaced supercell generated by a DFT-force relaxation, which is why the distributions of Figure S2 are clustered: each cluster is one lattice step of one state point.

Figure S2. Training-set distributions of the fine-tuned potentials (train, validation and test frames together). Left: volume per atom; middle: the DFT pressure of the frame; right: force magnitude per atom by species, counts on a logarithmic scale; deuterium is labelled “H”, the potential carrying hydrogen’s chemical identity. Each row is one potential, and the clusters within a row are individual lattice steps of the DFT-force relaxations that produced the frames.
| the full-set potential | LaH-120-sample | brucite PBE+D3 | |
| used for | MLIP points of Figure 4; the transition of Sec. III B | Figure S1 | brucite series of Sec. III C |
| source frames | DFT-force relaxations of LaH, LaH, LaH at 300 K | first three lattice steps of one LaH DFT-force run | DFT-force relaxations, 15 / 150 / 270 K |
| frames train / val / test | 3 261 / 303 / 319 | 120 / 15 / 15 | 991 / 109 / 96 |
| sampling stages | 203 | 41 | 24 |
| cell sizes (atoms) | 44–231 | 231 | 215 |
| volume per atom (Å) | 3.00–4.10 | 3.02–3.19 | 7.73–7.88 |
| DFT pressure (GPa) | 118 to 171 | 128 to 165 | −3 to +4 |
| force RMS per species (eV Å) | La 2.73, H 1.44 | La 2.52, H 1.45 | Mg 1.02, O 3.57, D 3.52 |
Table S3. Provenance and coverage of every fine-tuned potential used. Train, validation and test frames are split by whole sampling stage. “DFT-force relaxations” are WARP runs with DFT forces; every frame is a thermally displaced supercell of one of their sampling stages.

Figure S1. LaH, 150 GPa, 300 K, with the fine-tuned UPET potential from 120 training supercells, in the layout of Figure 6: (a) rhombohedral angle and (b) hydrogen Wyckoff parameters in the cubic setting against relaxation step. The training configurations are taken from the first three lattice steps of the DFT-force run of Figure 6 and do not reach the cubic endpoint; the relaxation runs from to , above the cubic metric, in seven lattice steps, with the 8c site at and the three 32f parameters merged to 0.1204–0.1208.
| the full-set potential | LaH-120-sample | brucite PBE+D3 | |
| learning rate; batch | ; 2 | ; 1 | ; 1 |
| epochs run / checkpoint used | 399 / 399 | 1 990 / 1 990 | 3 205 / 1 140 |
| validation force RMSE at the checkpoint (meV Å) | 25.1 | 35.3 | 24.9 |
| training force RMSE at the checkpoint (meV Å) | 12.1 | 4.8 | 17.9 |
| validation energy RMSE (meV/atom) | 1.1 | 0.2 | 1.2 |
| held-out test force RMSE (meV Å) | 25.8 | 34.5 | 12.3 |
| held-out test energy RMSE (meV/atom) | 1.46 | 0.24 | 0.10 |
| fine-tuning cost (GPU-h) | 47 | 620 | |
| acceptance test | equation of state and endpoint vs DFT | endpoint vs DFT (Figure S1) | static cell (Table S1) |
Table S4. Fitting and errors. Validation and training errors are the per-epoch values of metatrain at the checkpoint that was used; held-out test errors are a separate evaluation of that checkpoint on the test split with the calculator the relaxations use. Held-out errors are reported, not used as the acceptance criterion: the test in the last row is structural.
The full-set potential reaches its validation plateau of 25 by epoch 250 (Figure S3) while the training error keeps falling to 12: the validation stages are different stages of the same relaxations, and the gap is the price of a set that is clustered by construction. The -120-sample potential is that effect taken to its limit, one run’s first three lattice steps, and its training error of 5 against a validation error of 35 is expected; § 4 shows that the relaxation with it still reaches the DFT endpoint, which is the test that matters. The PBE+D3 brucite series uses the epoch-1140 checkpoint, with a validation error of 24.9 ; the fit continued to epoch 3205, where the validation error settles at 18 against a training error of 3. For this set the validation and test splits are not equivalent: the validation stages are the harder ones, and the same checkpoints score 12.3 (epoch 1140) and 2.1 (epoch 3205) on the test split (Figure S4). This is the honest reading of a split by sampling stage rather than by frame: the held-out error depends on which stages were held out, which is why the acceptance tests of the last row are structural.

Figure S3. Learning curves. Training (green) and validation (blue) force RMSE per epoch, the validation energy RMSE per epoch (grey) and as a 25-epoch running median (magenta, right axis), the checkpoint used for the relaxations (dashed; for brucite PBE+D3 the epoch-1140 checkpoint of Table S4) and the best validation epoch (dotted).

Figure S4. Held-out test sets. Top: predicted against reference force components, coloured by species (the deuterium sites of brucite are labelled H, as in the potentials’ data); bottom: predicted against reference energy per atom, both relative to the test-set mean. Each panel is the checkpoint used for the relaxations, evaluated with the same calculator the relaxations use; the RMSE in the title is the number in Table S4. Oxygen is red, hydrogen (deuterium) light blue, magnesium blue and lanthanum green, as in Figure S2.
Phonon dispersions: DFT against the fine-tuned potentials
Figure S5 compares the effective phonon dispersions of the DFT-force and the potential-driven warp relaxations of the same material and state point. For each pair the DFT and potential steps with the smallest root-mean-square difference of the sorted bands are shown; the force and energy errors of the potentials themselves are those of Table S4 and Figure S4. The root-mean-square differences are 0.92, 0.76, 0.63 and 0.33 THz for , , and , and 0.36 THz for brucite. , which is absent from the training set, shows the largest difference, mostly in the hydrogen optical bands. Both brucite runs of this comparison use the protium mass, so the panel compares the two force engines on the same dynamics. The dispersion of with the deuterium mass is shown in Figure S6: the O–D stretching band lies at 78–79 THz, against 106–108 THz with the protium mass, a ratio of 1.36, while the acoustic and lattice modes below 15 THz are nearly unchanged.

Figure S6. Brucite with the deuterium mass. Effective phonon dispersion of Mg(OD) at 300 K and 0 GPa from the PBE+D3 potential with the deuterium mass on the hydrogen sites (black), the last lattice step of the relaxation at 300 K; the same potential with the protium mass at 300 K in grey for comparison.

Figure S5. Effective phonon dispersions, DFT against the fine-tuned potentials. DFT-force relaxations (black, solid) and relaxations with the fine-tuned potential (blue, dashed) of , and at 150 GPa, at 140 GPa and brucite at 0 GPa, at the temperatures in the legends, on the high-symmetry path of each cell; the two paths of a pair are mapped segment by segment onto common tick positions because the two relaxed cells differ slightly. Brucite is shown with the protium mass in both runs, hence .
LaH: the hydrogen cage across the transition
In LaH every lanthanum atom sits in a cage of 32 hydrogen atoms, 8 on the 8c and 24 on the 32f site, whose faces are six squares and twelve hexagons. Figure S7 shows this cage at the two ends of the DFT-force relaxation of Figure 6. In the rhombohedral static minimum the cage is compressed along the three-fold axis, 4.09 Å high against 4.46 Å at the end of the relaxation, the La–H distances spread from 2.05 to 2.27 Å, and only 30 of the 48 cage edges are short H–H contacts (1.09–1.11 Å); the others are 1.42 Å or longer, so that the cage closes with triangles at its poles. At the end of the relaxation the La–H distances lie between 2.13 and 2.23 Å, all 48 edges are H–H contacts of 1.14 to 1.24 Å, and the cage has the square and hexagonal faces of the cubic structure.

Figure S7. The La-centred H cage of LaH at 150 GPa and 300 K. Left: the rhombohedral () static PBE minimum, the start of the relaxation of Figure 6 (rhombohedral angle 62.33°). Right: the final structure of that relaxation (59.96°). Both are viewed perpendicular to the three-fold axis, which is vertical, at the same scale. Lanthanum (blue) at the centre, hydrogen at the vertices; light sticks are H–H distances below 1.30 Å, the faces are the coordination polyhedron of the lanthanum atom. Rendered with CrysViz.
References
References
- [1]F. Jiang, S. Speziale, and T. S. Duffy, American Mineralogist 91, 1893 (2006).
- [2]B. C. Chakoumakos, C.-K. Loong, and A. J. Schultz, The Journal of Physical Chemistry B 101, 9458 (1997).
- [3]P. Hohenberg and W. Kohn, Phys. Rev. 136, B864 (1964).
- [4]W. Kohn and L. J. Sham, Phys. Rev. 140, A1133 (1965).
- [5]P. E. Blöchl, Phys. Rev. B 50, 17953 (1994).
- [6]P. Giannozzi et al., J. Phys.: Condens. Matter 21, 395502 (2009).
- [7]P. Giannozzi et al., J. Phys.: Condens. Matter 29, 465901 (2017).
- [8]P. Giannozzi et al., J. Chem. Phys. 152, 154105 (2020).
- [9]A. Dal Corso, Computational Materials Science 95, 337 (2014).
- [10]J. P. Perdew, K. Burke, and M. Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996).
- [11]S. Grimme, J. Antony, S. Ehrlich, and H. Krieg, The Journal of Chemical Physics 132, 154104 (2010).
- [12]F. Bigi, P. Pegolo, A. Mazitov, J. Schmidt, and M. Ceriotti, Machine Learning: Science and Technology 7, 035051 (2026).
- [13]A. Mazitov, F. Bigi, M. Kellner, P. Pegolo, D. Tisi, G. Fraux, S. Pozdnyakov, P. Loche, and M. Ceriotti, Nature Communications 16, 10653 (2025).
- [14]L. Barroso-Luque, M. Shuaibi, X. Fu, B. M. Wood, M. Dzamba, M. Gao, A. Rizvi, M. Uyтtendaele, C. L. Zitnick, and Z. W. Ulissi, Nature Computational Science 6, 642 (2026).
- [15]F. Bigi, J. W. Abbott, P. Loche, A. Mazitov, D. Tisi, M. F. Langer, A. Goscinski, P. Pegolo, S. Chong, R. Goswami, P. Freber, S. Chorna, M. Kellner, M. Ceriotti, and G. Fraux, metatrain: train, fine-tune, and manipulate machine learning models for atomistic systems (2026), repository https://github.com/metatensor/metatrain, documentation https://docs.metatensor.org/metatrain.