WorksPhysics and Astronomy
Hereditary Effective Atom Theory for Large-Scale Atomic Structure Prediction
Abstract
Predicting the atomic structure of large systems requires simultaneous exploration of atomic positions, species, and, generally, the number of atoms. The combinatorial growth of possible arrangements can make this search difficult even for standard genetic algorithms. We introduce Hereditary Effective Atom Theory (HEAT), which integrates Effective Atom Theory into a genetic algorithm to enable efficient global search through a differentiable effective-atom representation. Central to the method is a crossover scheme that directly superimposes two parent structures and relaxes the combined structure. HEAT outperforms conventional genetic-algorithm baselines in recovering a missing 240-atom H sublattice, predicting a 364-atom edge-dislocation core, and reconstructing twisted-bilayer containing 1150 atoms from ptychographic constraints. These results demonstrate how continuous effective-atom relaxation improves the exploration of large combinatorial structure spaces.
Introduction
Predicting the atomic structure of a large system requires finding a favorable arrangement of atoms among a combinatorial number of possibilities. One must generally search over the positions, species, and quantity of atoms simultaneously. This difficult problem arises in crystals, nanoparticles, interfaces, defects, and disordered materials [1, 2, 3, 4, 5]. Experimental data or other constraints might reduce the search space, but the combinatorial scaling with the number of atoms and species is generally unavoidable.
Diffusion models offer one approach to generating candidate structures. Models such as CDVAE, DiffCSP, and MatterGen learn from databases of known or calculated crystals and can generate new structures with specified compositions or properties [6, 7, 8]. However, their training data and demonstrated performance cover a limited range of structures and system sizes. For example, the reported MatterGen base model was trained on crystals containing at most 20 atoms per cell [8]. A model trained on small crystals cannot be assumed to generate reliable low-energy candidates for systems containing hundreds or thousands of atoms. Generated structures must still be checked through energy calculations and relaxation, and their quality for systems far outside the training data remains uncertain. This leaves a need for methods that search directly for favorable atomic arrangements in large systems.
Several established methods search directly for low-energy structures. Random structure searching generates and locally relaxes many independent trial structures [9], while basin hopping and minima hopping alternate local relaxation with moves that explore other minima [10, 11]. Particle-swarm optimization guides a population of candidates using information from previously found low-energy structures [12].
Genetic algorithms perform such a search by maintaining a population of candidate structures [1, 13, 14, 15]. Candidates are ranked by their energy or another specified objective, and better candidates have a higher chance of being selected as parents. Crossover creates a child by combining parts of two parents, while mutation introduces changes such as moving, adding, or removing atoms. Each new candidate is locally relaxed before it is evaluated for selection. Repeating these steps over successive generations allows the search to explore many local minima. This approach has been successful in predicting crystal structures, particularly for small and moderately sized unit cells, and developments such as USPEX have substantially extended its capabilities [1, 14, 16].
For large systems, conventional genetic algorithms can struggle to find low-energy structures from random starting configurations. Local relaxation often leaves these candidates trapped in disordered arrangements, and combining two disordered parents can simply produce another poor structure [17]. Further improvement requires larger rearrangements that crossover and mutation may take many generations to produce. Introducing order into the initial population and preserving favorable local arrangements can improve convergence, as demonstrated by USPEX [16, 17]. However, obtaining a useful starting structure can itself be difficult. For example, Yu et al. reconstructed a gold nanoparticle containing thousands of atoms, but their search began with crystalline candidates whose orientation was already known experimentally and still proceeded over thousands of generations [18]. Such initialization supplies substantial structural information that may be unavailable for an unknown defect or disordered material. This motivates methods that can more readily escape poor local minima without relying on an ordered starting structure.
Effective Atom Theory (EAT) offers a way to address this difficulty [19]. It represents each site as a mixture of elements and a null species corresponding to an absent atom, allowing the mixture weights and atomic position to vary continuously during relaxation. A site can gradually change from one element to another, disappear as its weight shifts to null, or reappear as its weight shifts back to a real element. A structure that is a local minimum with respect to atomic positions need not remain a minimum when atomic identity and presence can also change. These additional degrees of freedom can therefore provide paths to lower-energy structures that positional relaxation alone cannot reach. The system is then driven toward a final structure in which each site is either assigned a single real element or removed, leaving only conventional atoms with definite chemical identities.
As originally formulated, EAT is a local optimization method. It follows gradients from a given starting configuration and can still become trapped in a local minimum, especially in a large system. We therefore introduce Hereditary Effective Atom Theory (HEAT), a genetic algorithm that uses the effective-atom representation of EAT to enable efficient global search. Central to the method is a novel crossover operation that directly superimposes and subsequently relaxes two parent structures, allowing atoms from either parent to move, change identity, or disappear. The child can thereby retain favorable parts of both parents while removing redundant or unfavorable atoms. Importantly, the method does not require an ordered initial structure, making it more flexible than conventional genetic algorithms.
We demonstrate HEAT by recovering a missing 240-atom H sublattice in , predicting a 364-atom edge-dislocation core in Fe, and reconstructing twisted-bilayer containing 1150 atoms using electron ptychography data. HEAT outperforms the conventional genetic-algorithm baseline in all three applications. For the first two, HEAT recovers the reference structures by generations 2 and 4, respectively, with populations of just 30 members. This rapid convergence suggests that, even for hundreds of atoms, EAT’s expanded continuous search space provides sufficiently accessible relaxation pathways that only a few rounds of evolutionary selection and recombination are needed to reach the target structures. The improvement is particularly striking for , our largest test system: HEAT achieves a substantially lower formation energy and much closer agreement with experimental ptychography data. These results demonstrate that combining EAT relaxation with evolutionary search can recover favorable structures containing hundreds to thousands of atoms without requiring ordered initial arrangements.
Results
Hereditary Effective Atom Theory
Hereditary Effective Atom Theory (HEAT) maintains a population of candidate structures and uses EAT to optimize each newly generated member. Generation zero consists entirely of independent, randomly initialized structures, using only the information supplied as input to each reconstruction problem, as described below. No parent structures are required for or involved in this initialization.Each initial structure is optimized through syntropization, which drives effective atoms toward discrete elemental or null states. A final rounding step resolves any remaining effective atoms, and null atoms are removed. The remaining real atoms undergo a final positional relaxation, yielding a discrete candidate whose objective value determines its fitness.
Each subsequent generation is constructed from three groups: newly initialized random immigrants that introduce diversity, elite structures retained from the previous generation, and children produced by crossover between members of the previous generation. To create a child, two parents are chosen from the previous generation by tournament selection [20, 21]. A randomly sampled group of candidates forms the first tournament, and its lowest-score (best objective value) member becomes the first parent. A second tournament is then drawn after excluding that parent, and its lowest-score member becomes the second parent. This procedure favors low-score structures while allowing a range of candidates to contribute offspring. This parent selection followed by crossover is repeated until the requisite number of children has been generated.
The crossover proceeds through the steps shown in Figure 1. First, we halve the real-species weights of every optimizable atom in both parents and increase the null weights accordingly. The two structures are then spatially superimposed in their common cell and scaffold. Next, we add small perturbations to positions and species weights to introduce variation, and prune effective atoms that lie too close together to avoid severe atomic overlaps. EAT then optimizes the combined structure, allowing atomic positions, identities, and occupancies to adjust together. During the syntropization phase, compatible features from either parent can survive, while redundant or unfavorable effective atoms can disappear into null. Then, as with the initialization procedure described above, hard rounding, removal of null atoms, and final positional relaxation produce the discrete child. Only the final objective value of this discrete structure is used for selection; fractional occupancies do not enter any comparison scores.

Figure 1. Whole-structure superposition crossover in HEAT. Two fully discrete parents are lifted back into effective-atom space by increasing the null weight of every optimizable atom. The two complete parent structures are then spatially superimposed within their common scaffold. Atomic positions and effective-atom weights are perturbed, near-overlapping effective atoms are pruned, and the child is syntropized. Continuous relaxation can retain compatible atoms or motifs from either parent while redundant or unfavorable effective atoms become null. Black atoms denote the fixed scaffold; color denotes relative Nb–Ge character and opacity denotes total non-null occupancy in this illustrative example.
For the controlled H-sublattice and edge-dislocation comparisons, HEAT and the conventional GA use the same random, discrete initialization process for generation zero and random immigrants, the same population size and elite/random/crossover fractions within each benchmark, and the same final local-relaxation criterion. Their principal differences are the representation and local optimization used before final scoring, and the crossover and mutation operations. HEAT uses effective-atom relaxation and whole-structure superposition; the conventional GA uses hard atoms, cut-and-splice crossover, and explicit mutations. The ptychographic comparison also includes differences in initialization, as described below. All searches use fixed unit-cell vectors, and any supplied scaffold atoms remain fixed. Full details and run parameters are given in Methods.
Unless otherwise stated, all energies and forces reported below are evaluated using Universal Models for Atoms (UMA) as implemented in FAIRChem [22], and EAT optimizations are performed using the MLIP version of EAT [19].
Sublattice prediction
We first consider reconstructing a missing light-atom sublattice within a known heavier-atom framework. This setting is particularly favorable for a conventional genetic algorithm (GA): the fixed framework and known composition reduce the search largely to placing light atoms within a common host, making crossover a natural way to combine favorable arrangements from different parents. As shown below, even in this nearly ideal case for GA and using the same initialization procedure, population size, and final positional-relaxation criterion for both methods, HEAT outperforms the conventional GA.
This reconstruction problem is particularly relevant for hydrogen-containing crystals: because hydrogen has only one electron, its contribution to conventional X-ray scattering is weak, especially in the presence of heavier elements, and neutron diffraction is therefore often used to determine hydrogen positions. High-quality X-ray data combined with modern refinement methods can nevertheless recover accurate hydrogen coordinates in favorable cases [23, 24], while experimentally reported or database-derived structures may still contain well-resolved heavy-atom frameworks but missing, uncertain, or approximately assigned hydrogen positions [25]. Missing-hydrogen completion has recently also been studied using score-based diffusion models that inpaint H positions while holding the host structure fixed [25].
Specifically, we reconstruct the 240-atom H sublattice of , a structurally complex light-metal borohydride of interest for hydrogen storage [26, 27]. The experimentally reported structure [26] is first relaxed with FAIRChem and used as the reference. All H atoms are then removed, as their positions are often difficult to determine experimentally. The algorithms receive the relaxed Mg–B scaffold, unit cell, chemical formula, and hence the stoichiometric H count, but no reference H coordinates or bonding information (see Figure 2a).

Figure 2. Reconstruction of the H sublattice in Mg(BH4)2 and comparison with a conventional GA. a FAIRChem-relaxed reference structure and its decomposition into the supplied Mg–B scaffold and withheld 240-atom H sublattice. Mg, B, and H are orange, green, and pink, respectively, and B–H bonds are gray. White B atoms are retained in the isolated-sublattice view to better visualize the three-dimensional H network. b Cumulative best energy difference per H atom, , for HEAT (black) and the conventional GA using real atoms (blue) over the first 20 generations. Here, is the reference energy calculated by FAIRChem, normalized by the number of H atoms. The horizontal red dashed line marks zero energy difference, and the vertical dotted line marks the first generation at which HEAT reaches the reference within numerical accuracy. HEAT reaches the reference at generation 2; the conventional GA does not reach it within the plotted window. The structures show a representative discrete random initialization before EAT relaxation and the best HEAT candidates at generations 0 and 2. H atoms are pink, and B atoms shown for context are white.
This comparison deliberately gives HEAT and the conventional GA the same random starting distribution. Every generation-0 member and later random immigrant contains 240 fully occupied H atoms sampled from a feasible grid with a Å minimum separation from the scaffold and from other initialized H atoms. HEAT then relaxes the positions and H–null mixture weights of the effective atoms, while the conventional GA only relaxes the positions. Both populations contain 30 members with 6 elites, 3 random immigrants, and 21 crossover children after generation zero, and both use tournament size 3.
fig:2b compares the cumulative best formation energies through generation 20. HEAT reproduces the reference H sublattice at generation 2, whereas the conventional GA remains 0.012 eV per H atom (2.9 eV total per primitive periodic cell of Mg(BH4)2) above it at generation 20. The discrete initialization is highly disordered, but relaxation in EAT’s larger, continuous embedding space already produces recognizable local B–H coordination in generation zero.
HEAT’s faster convergence also translates into less computational work. By the time it reaches the reference at generation 2, HEAT has used 24,000 interatomic-model evaluations and 0.5 h of elapsed GA time. By generation 20, the conventional GA has used 91,000 evaluations and 1.6 h without reaching the reference. Thus the additional effective-atom relaxation does not merely exchange accuracy for a larger search budget: in this run, HEAT finds the target with substantially less total work.
Edge-dislocation-core prediction
We next consider a more challenging reconstruction problem: predicting an edge-dislocation core within a known surrounding crystal. Unlike the H-sublattice problem, neither the atomic arrangement within the core nor the number of atoms needed to form it is specified. Crossover must therefore reconcile competing arrangements and atomic populations, rather than simply combine placements within a common host framework. As shown below, HEAT recovers the reference core by generation four, while the conventional GA fails to reach it despite substantially greater computational effort.
Dislocation cores govern elementary processes such as glide and kink formation and therefore strongly influence the plastic response of crystalline materials [29]. The Burgers vector specifies the topological constraint imposed by a dislocation, while continuum elasticity predicts its far-field displacement. These constraints establish the surrounding deformation but do not determine the atomic structure of the compact, highly distorted core, where continuum elasticity breaks down. Reconstructing this core from the known surrounding crystal is therefore an important problem in materials theory.
Specifically, we consider an edge dislocation in Fe, starting from a configuration obtained from the NIST Interatomic Potentials Repository [28]. This configuration was constructed using anisotropic elasticity and relaxed by low-temperature molecular dynamics followed by energy minimization using the Fe interatomic potential of Mendelev et al. [30]. As in the H-sublattice demonstration, we further relax the database configuration with FAIRChem until the maximum force falls below 0.05 eV/Å, while holding the surrounding scaffold and cell fixed. The resulting structure and energy define the reference against which both HEAT and the conventional GA are evaluated.
fig:3a shows the edge-dislocation reference structure and its decomposition into an active core and a fixed scaffold. The extracted section measures approximately Å, with a centered Å active core. We add 8 Å of vacuum padding on each transverse side of the scaffold to separate periodic material images. Removing the 364 active core atoms leaves 605 fixed scaffold atoms. Neither HEAT nor the conventional GA receives the withheld core coordinates or atom count.
Random members in HEAT and the conventional GA are generated using the same initialization procedure. The proposed atom count is drawn from a Poisson distribution whose mean is the active-region volume times the number density inferred from the supplied scaffold, without using the reference count, and clipped between one and twice this estimate. Proposed atoms are distributed as evenly as possible among a grid, with random positions within each grid cell. Sites are then pruned to enforce a minimum separation of 1.0 Å from other proposed atoms and the scaffold, which can reduce the initial atom count. Both populations contain 30 members, with 3 elites, 8 random immigrants, and 19 crossover children per subsequent generation, using tournament size 2. Each conventional-GA crossover child has a probability of 0.30 of undergoing one mutation: rattle, relocation, insertion, or deletion. Before scoring, every newly generated candidate undergoes the same final positional relaxation with the scaffold and cell fixed; elites retain their previously relaxed scores.
The results sharply distinguish the methods (Figure 3b). HEAT reaches the reference at generation 4 after 50,629 model evaluations and 1.93 h of elapsed GA time. By generation 20, the conventional GA has used 160,434 evaluations and 5.23 h but remains 0.096 eV per core atom (0.77 eV total per layer) above the reference. Structurally, the disordered generation 0 HEAT core develops ordered rows by generation 1 and recovers the full edge-dislocation core by generation 4. This progression illustrates how HEAT can complete a dislocation structure whose surrounding framework is established from far-field elasticity, providing a rapid method for determining the atomic structure of the unknown core.

Figure 3. Reconstruction of an edge-dislocation core in Fe and comparison with a conventional GA. a Reference structure and its decomposition into the active region (bronze) and fixed scaffold (red). Starting from a configuration obtained from the NIST Interatomic Potentials Repository [28], the centered active region is relaxed with FAIRChem while the scaffold and supercell lattice vectors are held fixed. The active region contains 364 atoms, and the rightmost view displays the extra half-plane. The dislocation core is encircled and contains roughly 48 atoms when accounting for deeper layers along the dislocation axis. b Cumulative best energy differences per core atom over the first 20 generations. HEAT (black) reaches the red dashed reference line at generation 4 (dotted lines), whereas the conventional GA (blue) does not. The structures displayed are the best HEAT cores at generations 0, 1, and 4.
Allowing atomic positions and populations to adjust together during relaxation is central to this rapid recovery. The conventional GA can change the atom count through crossover and insertion or deletion mutations, but its subsequent local relaxation proceeds at fixed population. In contrast, continuous transfer of weight between Fe and null in HEAT allows atoms to appear or disappear as the structure relaxes, opening additional pathways for changes in bonding topology and for reconciling competing atomic arrangements inherited from the parents. HEAT thereby recovers the reference core with substantially less computational effort than the conventional GA expends without reaching it.
Structure Prediction from Ptychography Information
As our final application, we apply HEAT to three-dimensional atomic-structure reconstruction from electron-ptychography data. Electron ptychography can achieve deep-sub-Ångström lateral resolution and picometer-scale precision [32, 33, 34], while multislice methods additionally encode depth information. However, the depth resolution remains substantially poorer, leaving three-dimensional atomic coordinates incompletely constrained [35, 36, 37, 38]. Related approaches have combined incomplete microscopy data with energetic modeling and Bayesian genetic algorithms [39], and recent work has retrieved three-dimensional coordinates and moiré corrugations in twisted-bilayer WSe [40]. Here, HEAT combines a reconstructed ptychographic phase volume with FAIRChem energy calculations to infer a physically plausible atomic structure.
We focus on a Å interior region of the twisted-bilayer WSe sample from [31]. The experimental input is a three-dimensional phase volume, which constrains the plausible locations of atoms. Figure 4a shows the corresponding depth-summed image and a depth view of the measured-field isosurface. The sharp lateral features constrain the projected atomic positions, but the extended contours along leave considerable uncertainty in atomic heights. Recovering a discrete structure therefore requires resolving both this depth ambiguity and the unknown number and identities of atoms across a region containing more than 1000 atoms.

Figure 4. a Experimental phase volume from [31], summed over the 12 measured depth slices (top), and an orthographic depth view of its normalized-intensity isosurface at contour value (bottom). The elongated contours illustrate the weak depth localization. Opacity decreases with distance along the viewing direction and the surface is clipped at the measured depth boundaries. b Cumulative best loss for HEAT (black) and the conventional GA (blue) through generation 128. The loss combines formation energy per atom with image, composition, and sample-box penalties (Eq. (21), , see Methods). The red dashed line marks the loss of an independently constructed ideal reference WSe bilayer fitted to the experimental phase volume and relaxed under the same objective. Depth views show the best HEAT candidates at generations 0 and 128; the latter was first found at generation 115. W and Se are blue and magenta, respectively. c Simulated phase volumes (compare with a), summed over the same 12 slices, for the best candidates available at generation 128 for each method. Experimental and simulated projections use a common intensity scale. All spatial views show the central Å region of the experimental sample.
The optimization covers a Å region of the sample, with approximately 8 Å of vacuum padding on each side to separate periodic images. This region extends beyond the area of interest so that the edges, where the artificial material–vacuum boundaries cause the strongest structural distortions, can be excluded from the analysis. Accordingly, we use the central Å crop for visualization and the projection comparison below, while all reported optimization losses are evaluated over the full measured region.
We formulate the reconstruction as a Bayesian inference problem, combining the experimental imaging evidence with chemical information supplied by the MLIP. For an atomic configuration and measured phase volume , we write the posterior probability as , where denotes the MLIP information. The image likelihood measures agreement with the experimental data, while the prior favors energetically plausible structures. Maximizing this posterior is equivalent to minimizing the sum of the corresponding negative logarithms, providing a common objective for balancing imaging evidence and chemical plausibility. Finally, we introduce additional soft priors to favor the global W:Se ratio of 1 : 2 and to confine atoms to the measured sample region, without imposing an exact atom count or exact stoichiometry.
To construct the energy-based prior, we evaluate the formation energy per atom, , using FAIRChem and elemental reference energies. Maximizing the entropy over configurations subject to a constraint on the mean energy above the MLIP global minimum gives , where is an inverse energy scale controlling the preference for low-energy structures. This scale characterizes our energetic prior and need not correspond to a physical temperature. Combining this prior with the image likelihood and dividing the negative log posterior by gives the loss to be minimized as , supplemented by the composition and confinement penalties introduced above.
To model the image likelihood, we first predict the phase volume associated with a candidate atomic configuration. Evaluating a full electron-scattering simulation and ptychographic reconstruction for every candidate would be computationally expensive, so we use a differentiable approximation based on a precomputed library of isolated-atom projected potentials. Each elemental lateral profile is fitted with a sum of two Gaussians, representing its narrow central peak and broader tails, and combined with a Gaussian depth response of standard deviation 4 Å. Summing these contributions at the candidate atomic positions gives the predicted phase volume. Given this model phase volume, we next treat the voxelwise residuals as independent, with a probability density proportional to the exponential of a negative Huber penalty. The resulting residual distribution has a Gaussian center and exponential tails, accommodating small discrepancies as approximately Gaussian errors while reducing the influence of larger deviations, including those arising from imperfections in the forward model. The negative log likelihood is therefore proportional to the summed Huber penalties, up to a configuration-independent constant. The normalization, penalty weights, and remaining implementation details are given in Methods.
To perform the structural inference, both HEAT and the conventional GA minimize the same loss objective, with HEAT employing effective-atom mixtures of W, Se, and null during relaxation. Both methods use the experimental phase field to guide initialization, placing candidate atoms in high-intensity regions. During initialization, HEAT first performs an image-fitting stage that adjusts positions and continuous species weights, then includes the interatomic energy during EAT relaxation, whereas the conventional GA assigns discrete W and Se atoms to locations sampled from the same candidate reregion and locally relaxes only their positions.
In later generations, as described above, HEAT uses whole-structure superposition followed by EAT relaxation, while the conventional GA uses cut-and-splice crossover and discrete mutations to change the atomic population and arrangement. Both algorithms use populations of 50, with 5 elites, 13 random immigrants, and 32 crossover children per generation, and tournament sizes of 4 and 2 for selecting the first and second parents, respectively. For HEAT, selection and all reported losses are based on the final real-atom structures, excluding the entropy term used during syntropization (Eq. (21) with in Methods).
To establish a reference, we constructed two ideal WSe monolayers from a Materials Project bulk structure with an initial relative twist of , then fitted their orientations, translations, heights, and small in-plane strains to the experimental phase volume. We subsequently relaxed all atomic positions under the same combined energy, image, composition, and confinement loss used for the GA candidates, holding the species, atom count, and cell fixed, to obtain a reference loss of .
Figure 4b compares the cumulative best losses through generation 128. HEAT improves from 0.11 at generation zero to , first attained at generation 115 and retained through generation 128, whereas the conventional GA reaches 0.03 by generation 128. The corresponding formation energies for the conventional GA and HEAT are and eV/atom, respectively, compared with eV/atom for an independently relaxed ideal WSe bilayer. Their weighted image penalties are 0.106 and 0.035, respectively. HEAT therefore obtains both a substantially lower formation energy and much closer agreement with the phase volume. Through generation 128, HEAT and the conventional GA require approximately 540,000 and 210,000 interatomic-model evaluations, respectively. Although HEAT uses about 2.6 times as many evaluations over this window, it does reach far lower objective values than the conventional GA. Moreover, at the same computational budget of 210,000 interatomic-model evaluations (generation 43), HEAT already far surpasses the conventional GA’s best result, achieving a formation energy of −0.254 eV/atom and a weighted image penalty of 0.0615.
The depth views to the right of the convergence plot show the best HEAT structures at generations zero and 128, with W in blue and Se in magenta. The generation-zero candidate already forms two broad layers, but their internal height ordering is disordered. By generation 128, the retained best structure resolves the six atomic planes of two twisted Se–W–Se trilayers. The full structure contains 1497 atoms; the displayed interior crop contains 1150 atoms, comprising 389 W and 761 Se.
fig:4c compares the depth-summed phase volumes for the 42.72 × 42.72 Å region predicted by the approximate ptychography reconstruction for the best HEAT and conventional-GA candidates at generation 128. HEAT closely reproduces the measured projected pattern, with a Pearson correlation of 0.934, compared with 0.124 for the conventional GA. Residual intensity mismatches remain at only a few locations indicating potential W or Se vacancies. Likely a simple post-processing step may suffice to correct such point defects. Together with the recovered trilayer structure and lower objective, the results show that HEAT accesses physically favorable, image-consistent configurations that the conventional GA fails to find within the comparison window.
Discussion
HEAT combines genetic search with continuous optimization of atomic positions, identities, and occupancies. Its superposition crossover allows atoms from both parents to contribute to a child, while redundant or unfavorable atoms disappear when doing so lowers the loss during relaxation. In the H-sublattice and edge-dislocation benchmarks, HEAT recovers the reference structures within a few generations, while the conventional GA fails to reach them over a longer search with more model evaluations. The largest application, twisted-bilayer WSe, shows a substantial improvement in both formation energy and agreement with the experimental ptychographic data. These results demonstrate the value and efficiency of the effective-atom representation for reconstructing missing sublattices, determining dislocation-core structures—with potential extensions to grain boundaries and interfaces—and recovering atomic structures from ptychographic data. HEAT introduces computational overhead relative to conventional genetic algorithms by optimizing chemical identities and occupancies alongside atomic positions, combining both parents’ atoms during crossover, and following effective-atom optimization with a final real-atom relaxation. However, across all three applications, this overhead is more than offset by HEAT’s greater effectiveness in exploring chemical orderings and bonding topologies. The additional operations do not necessarily increase the net cost per generation, because continuous changes in atomic identity and presence can provide more efficient relaxation pathways. Indeed, over matched generation windows, HEAT takes slightly less time per generation in the H-sublattice benchmark and approximately the same time in the edge-dislocation benchmark, while reaching both references much sooner. For the ptychographic reconstruction, HEAT achieves significantly better structural quality at comparable computational effort. We therefore expect the greatest benefit in large systems requiring many coupled changes in chemical assignments and bonding topology. For smaller problems that a conventional GA already solves readily, HEAT may offer little advantage.
Looking forward, several natural extensions could broaden HEAT’s applicability. Allowing the lattice vectors to vary would extend the present fixed-cell searches to simultaneous optimization of atomic structure and supercell geometry. For systems without a supplied scaffold or experimental field to establish a common coordinate frame, exploring relative translations and rotations of the parents before superposition could enable crossover to identify and combine additional compatible structural motifs. The effective-atom representation accommodates both extensions, providing a foundation for their development within HEAT. We also plan to explore extending HEAT to ptychographic reconstruction of amorphous systems containing more than 100,000 atoms, thereby bringing atomically resolved structural inference to complex disordered material systems of direct technological relevance.
Methods
Effective-atom representation and HEAT
For effective atom , let be its weight for real species . The real-species weights satisfy , and the remaining weight
is assigned to null [19]. The limits and represent an absent atom and a conventional atom of species , respectively. The interatomic energy and application-specific penalties are differentiated with respect to both and the position , allowing identity, presence, and geometry to relax together.
Syntropization adds the Tsallis penalty [19, 41]
to the physical objective with coefficient . Increasing favors vertices of the species–null simplex. After syntropization, any remaining mixed-species effective atoms are assigned to the species with the largest weight; effective atoms assigned to null are removed. Thus every structure admitted to the genetic population is a conventional discrete structure, and fractional occupancies never enter the final comparison score.
Generation zero contains independently initialized and optimized random members. Each subsequent generation retains the lowest-score members without reevaluation (elites), introduces newly initialized random immigrants, and creates crossover children. The same initialization setting controls generation zero and all later immigrants. Elitism preserves the best structures, while immigrants provide continuing exploration [21].
Parents are chosen only by fitness through two tournament selections [20]. For independently sampled tournaments and ,
where is the loss function (equivalently the negative fitness). We clarify that parents are discrete structures so the entropy term in the loss associated with syntropization is zero. The winner is excluded from the eligible population when is drawn, ensuring distinct parents; other competitors may occur in both tournaments.
To cross parents and , each optimizable atom is converted into an effective atom with weight on its original element and weight on null:
where is the original element of atom and . The two complete sets of optimizable effective atoms are concatenated in their common scaffold and cell. Effective atoms that overlap are reduced to one, small random perturbations are applied to occupancy and position, and zero-occupancy reservoir effective atoms are added when needed. The resulting child is optimized with EAT, hard-rounded, and relaxed as a conventional atomic structure. We use , so the child initially retains half of the real occupancy carried by every site in each parent.
After hard rounding, null sites are removed and the positions of the remaining active atoms are relaxed. Copied elites retain their previously computed scores without further relaxation.
Conventional genetic baseline
The baseline is a conventional fixed-cell memetic GA assembled from conventional selection, cut-and-splice, mutation, and local-relaxation operators, with any supplied scaffold held fixed. Its candidates contain only fully occupied hard atoms. In the H-sublattice and edge-dislocation benchmarks, it uses the same hard random-member initialization scheme as HEAT. The H benchmark initializes the known stoichiometric number of atoms; the dislocation benchmarks draw a Poisson population estimate from the supplied scaffold density. Initial and repaired atoms obey the same minimum-distance cutoff.
Parent selection uses the same best-of-tournament rule. In the H-sublattice and edge-dislocation benchmarks, crossover is conventional periodic real-space cut-and-splice: a random Cartesian plane through a random fractional-cell origin is drawn, the child takes one periodic half-space from parent and the opposite half-space from parent , and the resulting positions are repaired for overlaps and allowed atom-count limits. Each crossover child is mutated with probability 0.30. H mutations either rattle a subset of atoms or relocate one atom; dislocation mutations may additionally insert or delete an atom. No mutation is applied to elites or random immigrants. The microscopy-frame crossover and initialization used for the WSe baseline are specified below in subsection Conventional GA baseline for ptychographic reconstruction.
Every non-elite baseline member is locally relaxed and scored under the same loss function used for HEAT. The methods differ in their local search before hard scoring and in their crossover and mutation operators. In the H-sublattice and edge-dislocation benchmarks, both methods use a population of 30 and the same numbers of elites, random immigrants, and crossover children. The initialization and population choices for each application are given below.
Hydrogen-sublattice reconstruction protocol
The complete experimentally reported Mg(BH) structure of [26] is first relaxed with FAIRChem, including cell relaxation, and used as the reference. All 240 H atoms are then removed, leaving the Mg–B framework fixed for candidate calculations. Each effective atom in the unknown sublattice spans H and null, and the continuous effective number of H atoms is
The loss minimized during each HEAT relaxation is
where is the formation energy per atom and enforces the target stoichiometry. The formation energy is
where and are the numbers of Mg and B atoms in the fixed scaffold, respectively.
The composition penalty is
where
and
The composition term fixes only the global stoichiometry and provides no information about H coordinates or bonding. Its coefficient is . Random members begin with exactly 240 one-hot H atoms chosen without replacement from feasible locations on a fractional grid. Feasible locations are at least 1.0 Å from the scaffold, and the selected H atoms are also separated by at least 1.0 Å. This generator is used identically for every generation-0 member and every later random immigrant in HEAT and the conventional baseline. HEAT may subsequently change the realized population through H–null relaxation; the composition penalty then softly restores the known global stoichiometry.
After the continuous stage, the candidate is hard-rounded and locally relaxed with the scaffold and cell fixed; the conventional baseline uses the same final relaxation and force criterion. Ranking uses the hard formation energy plus the hard composition term, with no entropy contribution. Both searches use , with 6 elites, 3 random immigrants, 21 crossover children, and tournament size 3.
Edge-dislocation-core reconstruction protocol
The edge-dislocation reference is initialized as a configuration from [28]. Atoms in a centered 25 Å 25 Å active prism are relaxed with FAIRChem while the surrounding scaffold and cell are fixed. The extracted material section spans approximately 40 Å 40 Å transversely and is periodic along the dislocation line, with a repeat of approximately 7 Å. We add 8 Å of vacuum on each transverse side to separate periodic images. The system contains 605 fixed scaffold atoms and 364 relaxed active atoms. The active atoms are removed before either genetic search begins.
For both algorithms, a random member count is drawn as
clipped to at least one atom and at most twice the density estimate. Positions are stratified across a partition of the active prism and repaired using a 1.0 Å minimum distance from other candidate atoms and the scaffold. This initialization is used for every generation-0 member and random immigrant and does not use the withheld reference population.
Each effective atom in the active region spans Fe and null. A random effective-atom initialization can collapse to the all-null configuration before an ordered core forms, so we introduce a soft lower bound on the total non-null occupancy. The objective is
where penalizes insufficient occupancy. The continuous effective number of active atoms is
and the formation energy is
where is the number of fixed scaffold atoms.
The occupancy penalty is
where
Here, and are the volumes of the supplied material outside and inside the active prism, controls the softplus sharpness, and sets the minimum encouraged occupancy. The density estimate uses only the scaffold, not the reference count. We use and . These deliberately loose bounds prevent early collapse to an empty active region without fixing the final population.
Null effective atoms are added after optimization when needed so that EAT can still spawn atoms during later relaxation. Crossover halves the parent occupancies, superimposes and perturbs the parents, and prunes overlaps before EAT relaxation. The resulting hard Fe atoms are finally relaxed under the same fixed-scaffold protocol used for the reference and the conventional GA baseline. The hard formation energy plus occupancy-lower-bound term determines ranking. Both algorithms use , with 3 elites, 8 immigrants, 19 crossover children, and tournament size 2.
Ptychographic reconstruction protocol
The reconstruction protocol optimizes against the measured three-dimensional phase volume directly. The data remain on their native voxel grid; effective atoms are not assigned to individually fitted experimental blobs. The input is a centered 320 × 320 pixel crop containing all 12 measured depth slices, with sampling Å. The measured region therefore spans 48.82 × 48.82 × 12 Å. Adding approximately 8 Å of vacuum on each side, with lateral padding snapped to whole pixels, gives a fixed 64.69 × 64.69 × 28 Å periodic cell. Atomic centers are softly confined to the measured sample box. All measured voxels contribute to the image loss, while synthetic vacuum voxels are excluded.
A single background and intensity scale are determined over the entire measured crop: subtract its first percentile, clip negative values to zero, and divide by the 99.5th percentile of the resulting field. The normalized target is retained in the linear domain, including values above one; individual slices are not normalized separately.
Each effective atom spans W, Se, and null. Let , , and . At voxel , the predicted image is
where denotes lateral position. Each is a sum of core and tail Gaussians whose widths and relative integrated weights are taken from fits to isolated-atom projected-potential tables, with an additional 0.08 Å lateral Gaussian blur. The shared depth response is
The lateral convolution is periodic; the depth response does not wrap across the cell. Its tails outside the measured depth window are not renormalized. A common factor sets the combined peak of one isolated W atom, centered on a lateral grid point and a depth plane, to one.
The loss is
with formation energy per atom
where is the FAIRChem energy and are elemental reference energies. The image penalty is the mean Huber loss over the measured voxels ,
where for and otherwise. The global composition penalty is
with and . For sample-box bounds in Cartesian direction ,
with . The configured weights are , , and , with Å. The composition term is a soft guide; neither exact stoichiometry nor a target atom count is enforced.
For generation zero and random immigrants, an initialization mask is obtained by smoothing the square root of the normalized target and thresholding at its median. Candidate locations are selected in intensity order. Each selected location excludes further candidates within a cylinder centered on that location, with lateral radius 0.75 Å and total height 6 Å ( Å along the depth direction), followed by uniform jitter of Å per Cartesian coordinate, accepted only within the initialization region. The proposal count is set by a density of 0.20 Å times the feasible measured volume, excluding added vacuum. Each site allows W, Se, or null. An initial 500-step image prefit jointly optimizes positions and soft species probabilities using Adam, the image, composition, and sample-box terms, a short-range repulsion, and a gradually increasing entropy penalty. This prefit omits the interatomic energy and passes all candidate effective atoms, still softly occupied, into the energy-inclusive EAT optimization.
Synchronization then uses projected quasi-Newton relaxation of (21), with and increasing from by a factor of 1.5 until the mean entropy per site falls below . Each site is rounded to its largest W, Se, or null component; null atoms are removed, and positions are relaxed with species and cell fixed under the same physical objective. The final positional stage uses a projected-gradient tolerance of , an iteration limit of 500, and a cost-plateau stopping criterion. Selection uses the final hard objective without the entropy term. The same image renderer is used in prefit, syntropization, and final relaxation.
The population contains members. After generation zero, each generation retains 5 elites, adds 13 random immigrants, and creates 32 crossover children. Parent tournaments have sizes 4 and 2, excluding the first winner from the second tournament. Whole-structure crossover scales both parents’ occupancies by , superimposes their effective atoms in the common fixed cell, perturbs positions and species weights, and prunes pairs closer than 1 Å before EAT relaxation. No separate mutation offspring are enabled in this configuration.
For Figure 4, spatial views use a central pixel display crop obtained by removing 20 measured pixels (3.05128 Å) from each lateral edge. Structure views retain atomic centers within this footprint without changing their heights. Simulated projections are computed from the full optimized structures using Eq. (19), summed over the 12 measured depth slices, and then cropped laterally; all experimental and simulated projections share the same intensity scale. The reported projection correlations are Pearson coefficients over the displayed pixels. The experimental depth view is a single isosurface of the normalized measured field at 0.20, with no fitted-blob replacement or depth exaggeration. Opacity decreases with distance along the viewing axis to expose foreground contours.
In this application and those below, elemental reference energies are computed with the same FAIRChem model from elemental structures obtained from the Materials Project database [42, 43].
Conventional GA baseline for ptychographic reconstruction
The conventional WSe baseline uses fully occupied W and Se atoms and the same TIFF crop, normalization, Gaussian image renderer, fixed periodic cell, formation-energy model, and image, composition, and sample-box penalties as HEAT. Its objective is Eq. (21) evaluated for hard atoms with . Both searches use populations of 50 members, with 5 elites, 13 random immigrants, and 32 crossover children per generation, and parent tournaments of sizes 4 and 2.
Random members are generated from the same intensity-derived cylindrical candidate pool described above. Locations are independently occupied with a probability chosen to give a mean initial population of 1500 atoms before overlap repair; occupied locations receive W or Se labels with probabilities 1/3 and 2/3. Crossover selects opposite sides of a randomly oriented plane from the two parents in their common experimental coordinate frame, without translating or aligning the parents. Each crossover child undergoes one mutation with probability 0.30, choosing rattle, relocation, insertion, or deletion with conditional probabilities 0.35, 0.25, 0.20, and 0.20, respectively. Rattle displaces 20% of the atoms with a Gaussian standard deviation of 0.25 Å. Proposed structures are repaired using a 1 Å minimum separation.
Each non-elite candidate undergoes position-only projected-BFGS relaxation of the shared physical objective, with species and population fixed during local relaxation. The iteration limit, projected-gradient tolerance, and cost-plateau criteria match HEAT’s final positional stage. The discrete baseline uses no soft image prefit, fractional-species optimization, syntropization, or rounding. Thus the two methods share the image-derived candidate pool but differ in initialization: HEAT performs a soft image prefit followed by effective-atom relaxation, whereas the conventional GA baseline directly initializes hard atoms.
Data Availability
The datasets generated and/or analysed during the current study are available at https://github.com/jt577/HEAT-data.
Code Availability
The underlying code for this study is available at https://github.com/jt577/HEAT-data.
Acknowledgements
J.T., S.S., and T.A. acknowledge support from the Center for Alkaline-Based Energy Solutions (CABES), part of the Energy Frontier Research Center (EFRC) program supported by the U.S. Department of Energy under grant DE-SC-0019445. C.L. and D.M. acknowledge support from the Eric and Wendy Schmidt AI in Science Postdoctoral Fellowship, a program of Schmidt Sciences. C.M. acknowledges support from the US National Science Foundation (NSF) under award PHY-1549132, the Center for Bright Beams (CBB).
Author Contributions
J.T. conceived all methods, performed all calculations, and edited the manuscript. C.L. provided simulated and experimental ptychography data. C.M. contributed to early method development. S.K. provided different ptychography samples for method improvement. S.S. initiated the ptychography application. D.M. supervised the study. T.A. supervised the study and edited the manuscript. All authors reviewed the manuscript.
Competing Interests
All authors declare no financial or non-financial competing interests.
References
- [1]A. R. Oganov and C. W. Glass, The Journal of Chemical Physics 124, 244704 (2006).
- [2]Q. Zhu, L. Li, A. R. Oganov, and P. B. Allen, Phys. Rev. B 87, 195317 (2013).
- [3]B. C. Revard, W. W. Tipton, A. Yespenko, and R. G. Hennig, Phys. Rev. B 93, 054117 (2016).
- [4]T. Frolov, D. L. Olmsted, M. Asta, and Y. Mishin, Nature Communications 4, 1899 (2013).
- [5]A. Pandey, P. Biswas, and D. A. Drabold, Scientific Reports 6, 33731 (2016).
- [6]T. Xie, X. Fu, O. Ganea, R. Barzilai, and T. S. Jaakkola, CoRR abs/2110.06197 (2021).arxiv.org/abs/2110.06197
- [7]R. Jiao, W. Huang, P. Lin, J. Han, P. Chen, Y. Lu, and Y. Liu, Crystal structure prediction by joint equivariant diffusion (2024), arXiv:2309.04475 [cond-mat.mtrl-sci].arxiv.org/abs/2309.04475
- [8]C. Zeni, R. Pinsler, D. Zügner, A. Fowler, M. Horton, X. Fu, Z. Wang, A. Shysheya, J. Crabbe, S. Ueda, R. Sordillo, L. Sun, J. Smith, B. Nguyen, H. Schulz, S. Lewis, C.-W. Huang, Z. Lu, Y. Zhou, H. Yang, H. Hao, J. Li, C. Yang, W. Li, R. Tomioka, and T. Xie, Nature 639, 624 (2025).
- [9]C. J. Pickard and R. J. Needs, Journal of Physics: Condensed Matter 23, 053201 (2011).
- [10]D. J. Wales and J. P. K. Doye, The Journal of Physical Chemistry A 101, 5111 (1997).
- [11]S. Goedecker, The Journal of Chemical Physics 120, 9911 (2004).
- [12]Y. Wang, J. Lv, L. Zhu, and Y. Ma, Physical Review B 82, 094116 (2010).
- [13]D. M. Deaven and K. M. Ho, Phys. Rev. Lett. 75, 288 (1995).
- [14]C. W. Glass, A. R. Oganov, and N. Hansen, Computer Physics Communications 175, 713 (2006).
- [15]F. Curtis, X. Li, T. Rose, Á. Vázquez-Mayagoitia, S. Bhattacharya, L. M. Ghiringhelli, and N. Marom, Journal of Chemical Theory and Computation 14, 2246 (2018).
- [16]A. O. Lyakhov, A. R. Oganov, H. T. Stokes, and Q. Zhu, Computer Physics Communications 184, 1172 (2013).
- [17]A. O. Lyakhov, A. R. Oganov, and M. Valle, Computer Physics Communications 181, 1623 (2010).
- [18]M. Yu, A. B. Yankovich, A. Kaczmarowski, D. Morgan, and P. M. Voyles, ACS Nano 10, 4031 (2016).
- [19]J. Tahmassebpour, B. Li, B. Barron, H. Abruña, P. Frazier, and T. Arias, Effective atom theory: Gradient-driven ab initio materials design (2025), arXiv:2509.07180 [cond-mat.mtrl-sci].
- [20]B. L. Miller and D. E. Goldberg, Evolutionary Computation 4, 113 (1996).
- [21]B. L. Greensite, D. C. Elsey, and G. R. Hutchison, The Journal of Chemical Physics 159, 091501 (2023).
- [22]B. M. Wood, M. Dzamba, X. Fu, M. Gao, M. Shuaibi, L. Barroso-Luque, K. Abdelmaqsoud, V. Gharakhanyan, J. R. Kitchin, D. S. Levine, K. Michel, A. Sriram, T. Cohen, A. Das, A. Rizvi, S. J. Sahoo, Z. W. Ulissi, and C. L. Zitnick, Uma: A family of universal models for atoms (2026), arXiv:2506.23971 [cs.LG].arxiv.org/abs/2506.23971
- [23]M. Woíńska, S. Grabowsky, P. M. Dominiak, K. Woźniak, and D. Jayatilaka, Science Advances 2, e1600192 (2016).
- [24]B. Haberl, M.-E. Donnelly, J. J. Molaison, M. Guthrie, and R. Boehler, Journal of Applied Physics 130, 215901 (2021).
- [25]T. Reents, A. Cantarella, M. Bercx, P. Bonfà, and G. Pizzi, npj Computational Materials 12, 203 (2026).
- [26]Y. Filinchuk, R. Černý, and H. Hagemann, Chemistry of Materials 21, 925 (2009).
- [27]O. Zavorotynska, A. El-Kharbachi, S. Deledda, and B. C. Hauback, International Journal of Hydrogen Energy 41, 14378 (2016).
- [28]C. A. Becker, F. Tavazza, Z. T. Trautt, and R. A. Buarque de Macedo, Current Opinion in Solid State and Materials Science 17, 277 (2013).
- [29]D. Rodney, L. Ventelon, E. Clouet, L. Pizzagalli, and F. Willaime, Acta Materialia 124, 633 (2017).
- [30]M. I. Mendelev, S. Han, D. J. Ackland, D. Y. Sun, and M. Asta, Philosophical Magazine 83, 3977 (2003).
- [31]K. X. Nguyen, Y. Jiang, C.-H. Lee, P. Kharel, Y. Zhang, A. M. van der Zande, and P. Y. Huang, Science 383, 865 (2024).
- [32]Y. Jiang, Z. Chen, Y. Han, P. Deb, H. Gao, S. Xie, P. Purohit, M. W. Tate, J. Park, S. M. Gruner, V. Elser, and D. A. Muller, Nature 559, 343 (2018).
- [33]Z. Chen, M. Odstrčil, Y. Jiang, Y. Han, M.-H. Chiu, L.-J. Li, and D. A. Muller, Nature Communications 11, 2994 (2020).
- [34]Z. Chen, Y. Jiang, Y.-T. Shao, M. E. Holtz, M. Odstrčil, M. Guizar-Sicairos, I. Hanke, S. Ganschow, D. G. Schlom, and D. A. Muller, Science 372, 826 (2021).
- [35]S. Gao, P. Wang, F. Zhang, G. T. Martinez, P. D. Nellist, X. Pan, and A. I. Kirkland, Nature Communications 8, 163 (2017).
- [36]Z. Chen, Y.-T. Shao, S. E. Zeltmann, H. K. P. E. R. Rosenberg, C. A. Ross, Y. Jiang, and D. A. Muller, Imaging interstitial atoms with multislice electron ptychography (2024), arXiv:2407.18063 [cond-mat.mtrl-sci].arxiv.org/abs/2407.18063
- [37]Z. Dong, Y. Zhang, C.-C. Chiu, S. Lu, J. Zhang, Y.-C. Liu, S. Liu, J.-C. Yang, P. Yu, Y. Wang, and Z. Chen, Nature Communications 16, 1219 (2025).
- [38]S. Karapetyan, S. E. Zeltmann, G. Wilk, T.-K. Chen, V. D. H. Hou, and D. A. Muller, Nature Communications 17, 3561 (2026).
- [39]T. Stoops, A. De Backer, I. Lobato, and S. Van Aert, Microscopy and Microanalysis 31, ozae090 (2025).
- [40]J. Huang, Y. Zhang, S. hyun Bae, B. Ahammed, E. Ertekin, and P. Y. Huang, Science Advances 12, eae b4305 (2026).
- [41]C. Tsallis, Journal of Statistical Physics 52, 479 (1988).
- [42]A. Jain, S. P. Ong, G. Hautier, W. Chen, W. D. Richards, S. Dacek, S. Cholia, D. Gunter, D. Skinner, G. Ceder, and K. A. Persson, APL Materials 1, 011002 (2013).
- [43]M. K. Horton, P. Huck, R. X. Yang, J. M. Munro, S. Dwaraknath, A. M. Ganose, R. S. Kingsbury, M. Wen, J. X. Shen, T. S. Mathis, A. D. Kaplan, K. Berket, J. Riebesell, J. George, A. S. Rosen, E. W. C. Spotte-Smith, M. J. McDermott, O. A. Cohen, A. Dunn, M. C. Kuner, G.-M. Rignanese, G. Petretto, D. Warouqiers, S. M. Griffin, J. B. Neaton, D. C. Ohrzan, M. Asta, G. Hautier, S. Cholia, G. Ceder, S. P. Ong, A. Jain, and K. A. Persson, Nature Materials 24, 1522 (2025).