Manuscript Offprint
arXiv:2610.01315EP-Flow: Disordered Crystal Structure Prediction without Site-Level Annotations
Abstract
Generative models have made rapid progress in ordered crystal structure prediction, yet many functional materials are intrinsically disordered, with substitutional mixing, vacancies, or interstitial species controlling their properties. Existing crystal generators either assume deterministic site occupations or require site-level disorder annotations, which are often unavailable when the chemical formula is the primary input. We formulate disordered crystal structure prediction through an Occupancy Distribution Matrix (ODM), a continuous site-by-species representation that unifies ordered crystals, solid solutions, vacancy disorder, and interstitial occupancy. A valid ODM must satisfy coupled site-wise occupancy, mass-conservation, and nonnegativity constraints, placing each sample on a formula-dependent transportation polytope. We propose Entropic Polytope Flow (EP-Flow), a marginal-constrained flow matching framework that canonicalizes heterogeneous polytopes into a shared double-centered space, learns a marginal-preserving flow, and recovers feasible occupancies through a Sinkhorn inverse map. By jointly generating occupancies, fractional coordinates, and lattice parameters, EP-Flow achieves state-of-the-art performance on formula-conditioned disordered CSP benchmarks derived from COD and MPDS, substantially outperforming adapted ordered-crystal generators. Analyses further show that EP-Flow recovers sparse and chemically meaningful local disorder patterns rather than merely matching global composition statistics.
1 Introduction
Crystalline materials underpin technologies ranging from semiconductors and batteries to solid electrolytes, catalysts, magnets, and superconductors. Recent machine learning advances have accelerated Crystal Structure Prediction (CSP) and generative materials design, with models such as CDVAE [1], GNoME [2], DiffCSP [3], FlowMM [4] and MatterGen [5] demonstrating remarkable progress. However, most existing methods are built around ordered structures, often derived from DFT calculations at 0 K, where each crystallographic site is occupied by a single deterministic element. Real materials frequently exhibit crystallographic disorder at synthesis or operating conditions, including substitutional mixing, vacancies, and interstitial species. This mismatch is substantial rather than marginal: nearly 47% of verified ICSD structures [6] contain some form of disorder. Such disorder can govern ionic transport, thermal stability, magnetism, and electronic behavior, motivating generative models that explicitly handle disordered crystals.
Disordered CSP is not merely ordered CSP with soft labels. In conventional ordered CSP, once a cell size or formula-unit convention is specified, the target composition fixes the species to be placed, and each generated site is assigned one deterministic species. In disordered crystals, the model must also infer how stoichiometric mass is allocated over crystallographic sites: multiple species may share a site, a site may be partially vacant, or an interstitial position may be fractionally occupied. For common substitutional solid solutions, the site budget is usually implied by the formula. However, for vacancy and interstitial disorder, the reported composition is insufficient to specify all crystallographic sites. To resolve this, we use an extended stoichiometric vector c by incorporating a vacancy pseudospecies (Vac). This ensures every site is fully accounted for, satisfying , where N is the total site count, M is the number of candidate species (including Vac), and is the target count for species j. This yields an Occupancy Distribution Matrix (ODM) encoding site-wise distributions. A valid ODM must satisfy three coupled constraints: site-wise full occupancy, mass conservation matching c, and non-negativity. We illustrate diverse types of disordered structures in Appendix D.1, and detail the mapping between macroscopic formulas and microscopic site counts in Appendix D.2.
Together, these requirements define a formula-dependent transportation polytope, as illustrated in Fig. 1. Unlike standard crystal generators that predict site labels independently or correct compositions after generation, ODM generation is globally coupled: changing one site occupancy changes the feasible allocations at other sites. Moreover, the feasible domain changes with both composition and site budget. Standard diffusion or flow models are therefore difficult to apply directly, because their trajectories must respect a heterogeneous family of constrained domains rather than a single Euclidean space.
To address this challenge, we propose EP-Flow, a marginal-constrained flow matching framework for disordered CSP without site annotation. EP-Flow canonicalizes each formula-dependent transportation polytope into a shared double-centered linear subspace by applying log-domain double centering to the ODM. In this space, the model learns a marginal-preserving flow whose velocity field remains in the zero-marginal tan-

Ordered Structure
Disordered Structure
○A ●B ●O ●A : B :

Iso-dimensional
Hetero-dimensional
Figure 1: Formula transportation polytopes.
gent space. A Sinkhorn-based inverse map then recovers an ODM on the target transportation polytope, enforcing row-sum, column-sum, and non-negativity constraints. Built on this occupancy formulation, EP-Flow jointly generates occupancies, fractional coordinates, and lattice parameters.
We evaluate EP-Flow on large-scale COD [7] and MPDS [8] benchmarks covering substitutional disorder, vacancy-inclusive disorder, and systems with up to N=50 crystallographic sites. Compared to the adapted baselines, EP-Flow achieves state-of-the-art performance under this no-site-annotation CSP setting, substantially improving structure match rate, occupancy accuracy, formula consistency, and validity. Case studies further show that EP-Flow recovers sparse and chemically meaningful disorder motifs rather than merely matching global composition statistics.
In summary, our contributions are threefold: (1) we formulate disordered CSP without site annotation as generation over formula-dependent transportation polytopes using an ODM representation that unifies ordered crystals, substitutional disorder, vacancy disorder, and interstitial occupancy; (2) we introduce EP-Flow, a marginal-constrained flow matching framework with double-centered canonicalization and Sinkhorn recovery; and (3) we construct COD and MPDS benchmarks with occupancy-sensitive metrics, demonstrating state-of-the-art performance for formula-conditioned disordered CSP without site-level disorder priors.
Disordered Crystal Structure Prediction. Recognizing the limitations of ordered models, recent work has started to address disordered structures explicitly. Dis-Gen [19] represents crystals in a tabular form and reconstructs them with a VAE-style architecture, while DMFlow [20] uses flow matching to model substitutional and positional disorder under simplex constraints. However, these methods still rely on site-level disorder annotations, e.g., which sites are doped and what occupancies they should carry. This assumption breaks down in the more challenging setting considered here, where only the global chemical formula is given. In contrast, EP-Flow models the full occupancy distribution jointly, so that local full-occupancy and global mass-conservation constraints are handled within a unified generative process without requiring explicit site-specific supervision.
Constrained Generative Modeling on Manifolds. More broadly, our work is related to constrained generative modeling beyond materials science. Prior studies have extended diffusion and flow-based models to Riemannian manifolds, simplices, and more general polytopes [21, 22, 23, 24, 25], using projection-based corrections [26] or barrier/mirror-map formulations [27, 28]. These strategies, however, can either break trajectory smoothness or become numerically fragile near sharp polytope boundaries. Our approach instead develops a marginal-preserving flow in a shared double-centered space, followed by a Sinkhorn inverse map, yielding exact transportation-polytope constraints.
3 Preliminaries
We briefly review the two ingredients underlying our method: transportation-polytope constraints and the double-centered zero-marginal space that provides a shared representation across formulas.
3.1 Transportation Polytopes and Sinkhorn Projection
Let and be prescribed marginal vectors with equal total mass, i.e., . The associated transportation polytope is defined as the set of non-negative matrices satisfying these exact marginal constraints:
Given a non-negative matrix , the Sinkhorn algorithm [29] alternates row and column rescaling to project onto . We denote the resulting differentiable operator by . In practice, a finite number of iterations is sufficient to satisfy the marginal constraints up to a prescribed tolerance [30]. For strictly positive inputs, this projection is differentiable and coincides with the unique Kullback-Leibler (KL) projection onto the target polytope [31].
3.2 Double-Centering Operator and Zero-Marginal Space
To map complex constrained distributions into a tractable representation, we rely on the double-centering operator. For any arbitrary matrix , the double-centering operator subtracts its row and column means, expressed as:
The image of this operator defines the zero-marginal subspace:
Because is a linear subspace, it serves as a well-behaved Euclidean manifold whose tangent space is isomorphic to itself. This makes a convenient Euclidean space for defining generative vector fields while preserving the zero-sum structure induced by the constraints.
(a)

(b)
Formula Constraint
Disordered Crystal (A, F, L)
(c)
Figure 2: Overview of EP-Flow for disordered crystal generation. (a) Disordered crystal represented by . (b) Occupancy matrix canonicalized from formula polytope to double-centered space via log-domain double centering, which recovers back by Sinkhorn projection. (c) Joint flow matching over conditioned on , with projection back to for the final structure.
4 Proposed Approach: EP-Flow
4.1 Task Definition
We represent a disordered crystal as , where is the ODM over sites and species, denotes fractional coordinates, and denotes the lattice parameters, as shown in Fig. 2a. Given a chemical formula, we encode its stoichiometry as , where is the total occupancy of species over all sites. Physical validity requires to satisfy row-sum constraints for full site occupancy, column-sum constraints for global mass conservation, and non-negativity . Hence, lies in a formula-dependent transportation polytope . By introducing vacancy as a pseudo-species, this representation naturally covers ordered crystals, substitutional disorder, and vacancy disorder.
Disordered CSP is then formulated as learning the conditional distribution by flow matching (details see Appendix A.5). This differs fundamentally from conventional CSP formulations that assume fixed site-wise assignments and model only . Here the model receives only c and must generate a full crystal triplet whose occupancy matrix remains inside while coordinating consistently with atomic positions and lattice geometry. This shift from explicit site labels to a continuous, constraint-aware occupancy representation is the key to exploring a much richer space of disordered materials, without assuming prior knowledge of specific doping patterns or site preferences.
4.2 Occupancy Distribution Matrix Generation
The primary challenge in generating is that its support, the transportation polytope , changes with the stoichiometry and the number of sites . ODMs therefore live on a heterogeneous family of constrained domains with no shared geometry, making direct generative modeling difficult. We resolve this by canonicalizing each ODM into the shared double-centered space , where all matrices satisfy zero-sum marginals regardless of the underlying formula.
Definition 1 (Space Canonicalization). Given an ODM , we define a forward mapping by
where is the double-centering operator, as shown in Eq. (2). The image lies in .
Intuitively, double-centering removes the additive row- and column-wise components of log A, which can be interpreted as site- and species-specific chemical potentials, and retains only the residual interaction structure in a stoichiometry-invariant space [32]. In practice, we apply -smoothing to prevent numerical instability during logarithm operations. Algorithm details are provided in Appendix D.3.
To recover a valid ODM under a target stoichiometry c, we map back from using a Sinkhorn projection [29]:
In this context, S acts as a projection that finds the matrix in that minimizes the Kullback-Leibler (KL) divergence to the exponentiated centered matrix , thereby restoring the physical stoichiometry. We illustrate the process in Fig. 2b, and provide more details in Appendix D.4.
As established in Eqs. (4) and (5), the function is a bijective mapping, as stated in the following proposition:
Proposition 1 (Bijectivity of Canonicalization). For any fixed stoichiometry vector , the mapping establishes a one-to-one correspondence between the interior of the transportation polytope and the double-centered space . Specifically, for any , there exists a unique matrix such that , which is uniquely recoverable via the Sinkhorn operator: . This bijectivity ensures that the generative trajectory in maps to a unique and physically consistent path in the valid ODM space. A proof is provided in Appendix A.1.
With this shared representation, we learn the centered ODM distribution by flow matching. We use the linear path for , where comes from data and is sampled from a prior supported on . Since is linear, the entire path remains in as long as the predicted velocity is projected back by , and we provide the proof of trajectory feasibility in Appendix A.2. We additionally apply a formula-derived mask to restrict training to site-species pairs that are feasible in the data. The resulting target velocity is the constant field , which supervises the projected network output in .
4.3 Fractional Coordinates Generation
Fractional coordinates are periodic along each lattice direction, so we define their flow on the -torus . Given a noise sample and a data sample , the target velocity is the shortest periodic displacement
This torus-aware displacement is the geodesic direction on the periodic coordinate space. The corresponding interpolation is
The model is trained to predict from , ensuring periodicity is respected throughout the trajectory.
4.4 Lattice Parameters Generation
Following FlowMM [4], we model the lattice parameters in an unconstrained latent space for stable learning. The lengths are parameterized in log space to guarantee positivity, while the angles are parameterized by unconstrained logits and mapped to the Niggli-reduced range . This yields a canonical lattice representation (i.e., ) while preserving the coupled statistics between cell geometry and atomic arrangement. Flow matching supervision is defined in the unconstrained space with target velocity .
4.5 Unified Training Objective
The model is trained by jointly regressing the target velocity fields of all structural components. At time , the intermediate state is , and the network outputs three velocity heads for occupancy, coordinates, and lattice variables, conditioned on the stoichiometry .
To account for the different scales of lattice lengths and angles, the lattice head is further split into length and angle components, denoted by and . The overall objective is a weighted sum of mean-squared errors:
(8)
where , , , balance occupancy, coordinate, and lattice learning. Optimizing this objective encourages a physically consistent joint distribution over these structural components under the stoichiometric constraint. The training and inference process is illustrated in Fig. 2c.
4.6 Stoichiometry-Conditioned Joint Velocity Network
To predict the coupled velocity fields for occupancy, coordinates, and lattice parameters, we use a lightweight stoichiometry-conditioned message-passing network. At time t, the input consists of the centered occupancy state , fractional coordinates , lattice state , and stoichiometry vector c. We provide physical intuition and conceptual inspirations in Appendix B. Specifically, we draw a heuristic analogy between statistical thermodynamics and our mathematical formulations, such as the logarithmic mapping, double-centering, and Sinkhorn recovery.
For each site i, we construct an initial node embedding by combining a local occupancy embedding, a global formula embedding, a global lattice embedding, and a time embedding:
where are lightweight MLPs. Within each crystal, we build a fully connected graph and perform several rounds of message passing. For an edge , the message depends on the current node states, the coordinate displacement , the occupancy difference , and the global formula/lattice context. Denoting the hidden state at layer by , the updates are
where , , and are MLPs, and SinEmb is the sinusoidal embedding used to encode periodic displacements [3]. The residual update preserves local information while enabling each site to aggregate composition- and geometry-aware messages from the full crystal.
After the final message-passing layer, the backbone outputs three heads. Two site-wise heads predict the coordinate velocity and occupancy velocity , with the latter projected by back into . A graph-level pooled representation is then used to predict the lattice velocity . This network satisfies SO(3) invariance and translation invariance, as shown in Appendices A.3 and A.4.
5 Experiments
5.1 Experimental Setup
Currently, there are no publicly available benchmarks or models specifically designed for disordered occupancy distribution tasks. Therefore, we establish a comprehensive evaluation framework, encompassing self-constructed datasets, modified strong baselines, and a multi-tiered metric suite.
Datasets. Our benchmark is curated from two complementary databases, COD [7] and MPDS [8]. The benchmark contains 17,239 structures from COD and 110,966 structures from MPDS. We organize four subsets: Sub-20 and Sub-50 for substitutional disorder, and Disorder-20 and Disorder-50 for the more general setting that additionally includes vacancies. Here, 20 and 50 indicate that the crystal contains at most 20 or 50 atomic sites, respectively. This split allows us to separately evaluate the disorder type and scaling with the number of sites. For each subset, we use an approximate 8:1:1 train/validation/test split. Detailed statistics and processing details are deferred to Appendix C.1.
Baselines. Existing crystal generators are primarily designed for ordered structures and therefore cannot be directly applied to our more challenging disordered setting. To construct strong and fair
Table 1: Disordered CSP Performance on the COD dataset. When match rate is zero (i.e., all failed), RMSD and OccMAE are undefined (N/A). The best results are marked in bold. “Ada” denotes the adapted baselines.
| Dataset | Model | Match Rate (↑) | RMSD (↓) | OccMAE (↓) | Validity (↑) |
|---|---|---|---|---|---|
| Sub-20 | Ada-FlowMM | 0.65% | 0.0146 | 0.0002 | 87.40% |
| Ada-OMatG | 10.21% | 0.0298 | 0.0147 | 90.40% | |
| Ada-DMFlow | 21.61% | 0.0580 | 0.0189 | 90.60% | |
| EP-Flow | 45.39% | 0.0393 | 0.0111 | 95.10% | |
| Sub-50 | Ada-FlowMM | 0.67% | 0.0728 | 0.0092 | 86.90% |
| Ada-OMatG | 3.28% | 0.0459 | 0.0218 | 90.90% | |
| Ada-DMFlow | 10.84% | 0.0229 | 0.0503 | 80.00% | |
| EP-Flow | 26.77% | 0.0357 | 0.0107 | 92.60% | |
| Disorder-20 | Ada-FlowMM | 0.49% | 0.0365 | 0.0407 | 83.80% |
| Ada-OMatG | 9.78% | 0.0193 | 0.0154 | 88.40% | |
| Ada-DMFlow | 15.16% | 0.0279 | 0.0298 | 87.20% | |
| EP-Flow | 31.80% | 0.036 | 0.0163 | 89.20% | |
| Disorder-50 | Ada-FlowMM | 0.64% | 0.0146 | 0.0079 | 75.70% |
| Ada-OMatG | 3.59% | 0.0472 | 0.0154 | 79.70% | |
| Ada-DMFlow | 9.74% | 0.0348 | 0.0517 | 74.10% | |
| EP-Flow | 17.10% | 0.0334 | 0.0148 | 77.70% |
baselines, we adapt representative SOTA methods, including FlowMM [4] and OMatG [33], to operate on continuous site-wise occupancies rather than discrete one-hot species representations. On the generation side, these baselines first predict an unconstrained ODM in Euclidean space, which is then mapped to the positive orthant through a sigmoid transformation, enabling the subsequent application of the Sinkhorn projection. Furthermore, we adapt DMFlow [20], a strong baseline specifically designed for disordered crystal generation. We adopt the spherical reparameterization mechanism from its DNG, enabling the occupancy to diffuse on the sphere, which naturally satisfies the site-wise row-sum constraint. For all baselines, we apply the same formula-derived mask based on the ground-truth chemical composition as used in EP-Flow during both training and generation. In the inference phase, we uniformly apply the same Sinkhorn projection to project the occupancies onto the transportation polytope space, enforcing both the global formula sum and site-wise sum constraints. Further implementation details of all baseline adaptations are provided in Appendix C.2.
Evaluation Metrics. Our models are evaluated by four metrics: (1) Match Rate, which measures structure-level matching under the extended matcher; (2) RMSD, which quantifies coordinate accuracy for matched structures; (3) OccMAE, which measures the error in site-wise occupancy distributions; and (4) Validity, which measures the fraction of physically plausible outputs. The exact metric definitions, matcher tolerances, and implementation details are provided in Appendix C.3.
5.2 Main Results on Disordered Crystal Generation
We summarize the quantitative performance in Tables 1 and 2. Three observations stand out: (1) EP-Flow achieves the highest Match Rate across all evaluated subsets. Across all eight subsets, EP-Flow reaches Match Rate, while FlowMM remains below , OMatG reaches , and DMFlow reaches . EP-Flow outperforms the strongest baseline, DMFlow, by 7.36–23.78 percentage points, suggesting the benefit of modeling dynamics on a formula-dependent transportation polytope rather than in a generic Euclidean space. This comparison should also be read together with RMSD and OccMAE: since both are averaged only over matched cases, a model with higher Match Rate can include harder successful matches and therefore exhibit slightly larger average RMSD, so these metrics should be interpreted jointly rather than in isolation. (2) High validity does not imply correct structure recovery. The adapted baselines can obtain high validity despite low Match Rate. For instance, on MPDS Disorder-20, FlowMM achieves validity but only Match Rate. This indicates that generating physically plausible structures alone does not ensure correct recovery of coupled site-wise occupancy and geometry. This further highlights
Table 2: Disordered CSP Performance on the MPDS dataset. When match rate is zero (i.e., all failed), RMSD and OccMAE are undefined (N/A). The best results are marked in bold. “Ada” denotes the adapted baselines.
| Dataset | Model | Match Rate (↑) | RMSD (↓) | OccMAE (↓) | Validity (↑) |
|---|---|---|---|---|---|
| Sub-20 | Ada-FlowMM | 0.49% | 0.0335 | 0.0457 | 96.90% |
| Ada-OMatG | 11.78% | 0.0331 | 0.0813 | 88.30% | |
| Ada-DMFlow | 45.17% | 0.0416 | 0.0096 | 92.10% | |
| EP-Flow | 60.82% | 0.0483 | 0.0075 | 97.80% | |
| Sub-50 | Ada-FlowMM | 0.18% | 0.0501 | 0.0391 | 98.10% |
| Ada-OMatG | 5.25% | 0.0242 | 0.0594 | 93.50% | |
| Ada-DMFlow | 25.00% | 0.0354 | 0.0320 | 81.50% | |
| EP-Flow | 39.33% | 0.0538 | 0.0076 | 91.90% | |
| Disorder-20 | Ada-FlowMM | 0.24% | 0.0136 | 0.0474 | 95.90% |
| Ada-OMatG | 9.91% | 0.0263 | 0.0860 | 92.40% | |
| Ada-DMFlow | 42.59% | 0.0329 | 0.0211 | 94.10% | |
| EP-Flow | 57.74% | 0.0413 | 0.0092 | 94.90% | |
| Disorder-50 | Ada-FlowMM | 0.13% | 0.0354 | 0.0401 | 97.30% |
| Ada-OMatG | 3.76% | 0.0178 | 0.0460 | 87.10% | |
| Ada-DMFlow | 23.84% | 0.0485 | 0.0250 | 84.10% | |
| EP-Flow | 32.60% | 0.0550 | 0.0069 | 89.60% |
Table 3: Ablation results on MPDS-Sub-20.
| Variant | Match Rate (↑) | RMSD (↓) | OccMAE (↓) | Validity (↑) |
|---|---|---|---|---|
| w/o Formula | 20.01% | 0.0529 | 0.0106 | 96.7% |
| w/o Energy-diff | 35.23% | 0.0527 | 0.0159 | 93.50% |
| w/o Double Centering | 46.06% | 0.0537 | 0.0115 | 91.0% |
| w/o Projection | 15.78% | 0.0434 | 0.1277 | 90.5% |
| w/o DC & Sinkhorn | 0.00% | N/A | N/A | 0.00% |
| Full Model (Reference) | 60.82% | 0.0483 | 0.0075 | 97.8% |
the necessity of employing stringent structure-level matching metrics to evaluate the true predictive capacity of models in disordered CSP. (3) Larger and more disordered systems are intrinsically harder. From 20 to 50 sites, and from substitutional to vacancy-inclusive disorder subsets, both EP-Flow and the strong baseline Ada-DMFlow degrade consistently on both COD and MPDS, reflecting the greater combinatorial ambiguity of site assignment and the higher sparsity of occupancy patterns. Meanwhile, they perform consistently better on MPDS than on COD, suggesting that larger disordered datasets provide richer supervision for learning transferable site–species compatibility.
5.3 Ablation Studies
To isolate the contribution of each core component, we conduct five ablations on MPDS-Sub-20 in Table 3: (1) w/o Formula, which removes chemical-formula conditioning embedded at the network layers and sharply reduces Match Rate from 60.82% to 20.01%, showing that accurate occupancy prediction requires explicit stoichiometric guidance beyond local geometry; (2) w/o Energy-diff, which removes the relative energy-difference edge feature and lowers Match Rate to 35.23% while increasing OccMAE to 0.0159, indicating that pairwise relative affinities provide important local signals for resolving fine-grained disorder. A more detailed physical interpretation is deferred to Appendix B.4; (3) w/o Double Centering, which removes the ℛ operator and learns in the log space, reducing Match Rate to 46.06% and confirming that mapping formula-dependent polytopes into a shared centered space improves structural alignment; (4) w/o Projection, which learns directly in the raw bounded polytope and causes OccMAE to surge from 0.0075 to 0.1277, showing that the unflattened constraint geometry is too irregular for occupancy learning, even if the matched-sample RMSD appears competitive; and (5) w/o DC & Sinkhorn, which removes both normalization and

Figure 3: Reconstruction results for disordered functional materials. Each row compares predicted vs. ground-truth structures, with RMSD and OccMAE. Key-site occupancies are annotated; the rightmost column shows the site with largest occupancy error. Three disorder types are covered: oxygen-vacancy, interstitial/partial-occupancy, and mixed-cation/anion substitutional.
constraint projection and collapses completely to 0.00% Match Rate, demonstrating that geometric normalization and marginal preservation are critically important for staying on the feasible manifold.
5.4 More Analysis
5.4.1 Case Studies on Functional Disordered Materials
To assess whether EP-Flow captures realistic disorder beyond simple cation mixing, we examine three representative functional materials spanning substitutional, vacancy, and interstitial disorder. As shown in Fig. 3, these examples probe whether the model recovers not only average occupancies but also property-relevant local configurations.
Layered cuprate with oxygen-vacancy disorder. is an Al-substituted -type cuprate with dilute Cu/Al substitution and oxygen-vacancy disorder. In these high- materials, the functional impact of vacancies depends critically on whether they appear in the charge-regulating Cu–O chains or in the superconducting planes. EP-Flow localizes the vacancies outside the planes rather than distributing them randomly, indicating that it captures chemically meaningful defect preferences rather than only average geometry.
ThMn -type magnet with interstitial disorder. YTi Fe N is a ThMn -type Fe-rich compound with dilute Fe/Ti substitution and partially occupied interstitial nitrogen sites. While the Ti occupancy is only about 8.3% and the interstitial N site has 0.5, both disorder channels are directly tied to permanent-magnet behavior through their effects on structural stability, Fe–Fe distances, and magnetocrystalline anisotropy. This case shows EP-Flow can capture the coupling between dilute substitutional disorder and interstitial N/vacancy disorder in a physically meaningful way.
Mixed-anion perovskite with multi-sublattice substitution. can be approximately written as , corresponding to an oxyfluoride perovskite with simultaneous A-site Sr/La mixing, B-site Fe/Co mixing, and anion-site O/F mixing. This is a challenging multi-sublattice disorder case because both cation and anion sublattices are disordered, and the O/F arrangement directly affects local charge balance, covalency, and crystal-field splitting around the transition-metal centers. The example therefore tests whether EP-Flow can recover coupled mixed-cation and mixed-anion disorder within a single framework.
Taken together, these examples show that EP-Flow is not restricted to simple cation-site disorder: it recovers mixed-anion substitution in a perovskite, interstitial N/vacancy disorder in a Fe-rich magnetic framework, and oxygen-vacancy disorder in a layered superconducting oxide. Because these disorder patterns are directly linked to functional properties, successful reconstruction provides stronger evidence that the model captures realistic, property-relevant local chemistry. For reconstructions and analyses of more complex cases, please see Appendix D.5.
5.4.2 Disorder-Pattern Analysis
To probe what the model learns, Fig. 4 visualizes site-wise occupancy correlations. EP-Flow produces sparse, structured site-species assignments rather than diffuse occupancies: strong diagonal blocks indicate stable site preferences, while localized off-diagonal responses capture mixed-occupancy behavior. Moreover, some predicted mixing patterns absent from the smaller COD training split can still be verified in the larger MPDS dataset, suggesting that the model learns transferable site-species compatibility rather than merely memorizing observed occupancy pairs.
MPDS 20 Disorder

COD 20 Disorder
Figure 4: Site-wise occupancy-pattern analysis.
6 Conclusion
We presented EP-Flow, a geometric flow matching framework for disordered CSP conditioned on the formula and site number. A key contribution is formalizing this generation task to unify ordered structures with substitutional, vacancy, and interstitial disorder through the Occupancy Distribution Matrix (ODM). Methodologically, EP-Flow canonicalizes heterogeneous, formula- and site-dependent occupancy polytopes into a shared, unbounded double-centered subspace. Here, it learns a marginal-preserving flow and maps samples back via Sinkhorn projection to effectively ensure physical validity. Together with a complete evaluation framework built from large-scale COD and MPDS data and metrics such as the Structure Match Rate tailored for disordered structures, this yields a unified pipeline for jointly generating occupancies, fractional coordinates, and lattice parameters directly from the given formula and site count. Experiments show that EP-Flow achieves state-of-the-art performance across disorder types and site-count scales, highlighting the advantage of jointly modeling occupancy, geometry, and lattice under exact compositional constraints.
References
[1] Tian Xie, Xiang Fu, Octavian-Eugen Ganea, Regina Barzilay, and Tommi S. Jaakkola. Crystal diffusion variational autoencoder for periodic material generation. In International Conference on Learning Representations, 2022.
[2] Amil Merchant, Simon Batzner, Samuel S Schoenholz, Muratahan Aykol, Gowoon Cheon, and Ekin Dogus Cubuk. Scaling deep learning for materials discovery. Nature, 624(7990):80–85, 2023.
[3] Rui Jiao, Wenbing Huang, Peijia Lin, Jiaqi Han, Pin Chen, Yutong Lu, and Yang Liu. Crystal structure prediction by joint equivariant diffusion. Advances in Neural Information Processing Systems, 36:17464–17497, 2023.
[4] Benjamin Kurt Miller, Ricky TQ Chen, Anuroop Sriram, and Brandon M Wood. Flowmm: Generating materials with riemannian flow matching. In International Conference on Machine Learning, pages 35664–35686. PMLR, 2024.
[5] Claudio Zeni, Robert Pinsler, Daniel Zügner, Andrew Fowler, Matthew Horton, Xiang Fu, Zilong Wang, Aliaksandra Shysheya, Jonathan Crabbé, Shoko Ueda, et al. A generative model for inorganic materials design. Nature, 639(8055):624–632, 2025.
[6] Alec Belsky, Mariette Hellenbrandt, Vicky Lynn Karen, and Peter Luksch. New developments in the inorganic crystal structure database (icsd): accessibility in support of materials research and design. Structural Science, 58(3):364–369, 2002.
[7] Saulius Gražulis, Adriana Daškevič, Andrius Merkys, Daniel Chateigner, Luca Lutterotti, Miguel Quiros, Nadezhda R Serebryanaya, Peter Moeck, Robert T Downs, and Armel Le Bail. Crystallography open database (cod): an open-access collection of crystal structures and platform for world-wide collaboration. Nucleic acids research, 40(D1):D420–D427, 2012.
[8] Evgeny Blokhin and Pierre Villars. Materials platform for data science, 2022.
[9] Xiaoshan Luo, Zhenyu Wang, Pengyue Gao, Jian Lv, Yanchao Wang, Changfeng Chen, and Yanming Ma. Deep learning generative model for crystal structure prediction. npj Computational Materials, 10(1):254, 2024.
[10] Peijia Lin, Pin Chen, Rui Jiao, Qing Mo, Cen Jianhuan, Wenbing Huang, Yang Liu, Dan Huang, and Yutong Lu. Equivariant diffusion for crystal structure prediction. In Forty-first International Conference on Machine Learning, 2024.
[11] Liming Wu, Wenbing Huang, Rui Jiao, Jianxing Huang, Liwei Liu, Yipeng Zhou, Hao Sun, Yang Liu, Fuchun Sun, Yuxiang Ren, and Ji-Rong Wen. Siamese foundation models for crystal structure prediction. Nature Communications, 2026.
[12] Chaitanya K Joshi, Xiang Fu, Yi-Lun Liao, Vahe Gharakhanyan, Benjamin Kurt Miller, Anuroop Sriram, and Zachary W Ulissi. All-atom diffusion transformers: Unified generative modelling of molecules and materials. arXiv preprint arXiv:2503.03965, 2025.
[13] Xiaohan Yi, Guikun Xu, Zhong Zhang, Liu Liu, Yatao Bian, Xi Xiao, and Peilin Zhao. Crystaldit: Simple diffusion transformers for crystal generation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 40, pages 1462–1470, 2026.
[14] Xiaoshan Luo, Zhenyu Wang, Qingchang Wang, Jian Lv, Lei Wang, Yanchao Wang, and Yanming Ma. Crystalflow: A flow-based generative model for crystalline materials. arXiv preprint arXiv:2412.11693, 2024.
[15] Qi Li, Rui Jiao, Liming Wu, Tiannian Zhu, Wenbing Huang, Shifeng Jin, Yang Liu, Hongming Weng, and Xiaolong Chen. Powder diffraction crystal structure determination using generative models. Nature Communications, 16(1):7428, 2025.
[16] Rui Jiao, Hanlin Wu, Wenbing Huang, Yuxuan Song, Yawen Ouyang, Yu Rong, Tingyang Xu, Pengju Wang, Hao Zhou, Wei-Ying Ma, et al. Mof-bfn: Metal-organic frameworks structure prediction via bayesian flow networks. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.
[17] Laura Ruple, Luca Torresi, Henrik Schopmans, and Pascal Friederich. Symmetry-aware bayesian flow networks for crystal generation. arXiv preprint arXiv:2502.03146, 2025.
[18] Hanlin Wu, Yuxuan Song, Jingjing Gong, Ziyao Cao, Yawen Ouyang, Jianbing Zhang, Hao Zhou, Wei-Ying Ma, and Jingjing Liu. A periodic bayesian flow for material generation. arXiv preprint arXiv:2502.02016, 2025.
[19] Martin Hoffmann Petersen, Ruiming Zhu, Haiwen Dai, Savyasanchi Aggarwal, Nong Wei, Andy Paul Chen, Arghya Bhowmik, Juan Maria Garcia Lastra, and Kedar Hippalgaonkar. Dis-gen: Disordered crystal structure generation. arXiv preprint arXiv:2507.18275, 2025.
[20] Liming Wu, Rui Jiao, Qi Li, Mingze Li, Songyou Li, Shifeng Jin, and Wenbing Huang. Dmflow: Disordered materials generation by flow matching. arXiv preprint arXiv:2602.04734, 2026.
[21] Valentin De Bortoli, Emile Mathieu, Michael Hutchinson, James Thornton, Yee Whye Teh, and Arnaud Doucet. Riemannian score-based generative modelling. Advances in neural information processing systems, 35:2406–2422, 2022.
[22] Hannes Stark, Bowen Jing, Chenyu Wang, Gabriele Corso, Bonnie Berger, Regina Barzilay, and Tommi Jaakkola. Dirichlet flow matching with applications to dna sequence design. In International Conference on Machine Learning, pages 46495–46513. PMLR, 2024.
[23] Itai Gat, Tal Remez, Neta Shaul, Felix Kreuk, Ricky TQ Chen, Gabriel Synnaeve, Yossi Adi, and Yaron Lipman. Discrete flow matching. Advances in Neural Information Processing Systems, 37:133345–133385, 2024.
[24] Oscar Davis, Samuel Kessler, Mircea Petrache, Ismail I Ceylan, Michael Bronstein, and Avishek J Bose. Fisher flow matching for generative modeling over discrete data. Advances in Neural Information Processing Systems, 37:139054–139084, 2024.
[25] Tomek Diederen and Nicola Zamboni. Flows on convex polytopes. arXiv preprint arXiv:2503.10232, 2025.
[26] Utkarsh Utkarsh, Pengfei Cai, Alan Edelman, Rafael Gomez-Bombarelli, and Christopher Vincent Rackauckas. Physics-constrained flow matching: Sampling generative models with hard constraints. arXiv preprint arXiv:2506.04171, 2025.
[27] Nic Fishman, Leo Klarner, Valentin De Bortoli, Emile Mathieu, and Michael Hutchinson. Diffusion models for constrained domains. arXiv preprint arXiv:2304.05364, 2023.
[28] Guan-Horng Liu, Tianrong Chen, Evangelos Theodorou, and Molei Tao. Mirror diffusion models for constrained and watermarked generation. Advances in Neural Information Processing Systems, 36:42898–42917, 2023.
[29] Richard Sinkhorn. A relationship between arbitrary positive matrices and doubly stochastic matrices. The annals of mathematical statistics, 35(2):876–879, 1964.
[30] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26, 2013.
[31] Gabriel Peyré and Marco Cuturi. Computational optimal transport: With applications to data science. Now Foundations and Trends, 2019.
[32] Warren S Torgerson. Multidimensional scaling: I. theory and method. Psychometrika, 17(4):401–419, 1952.
[33] Philipp Höllmer, Thomas Egg, Maya Martirossyan, Eric Fuemmeler, Zeren Shui, Amit Gupta, Pawan Prakash, Adrian Roitberg, Mingjie Liu, George Karypis, Mark Transtrum, Richard Hennig, Ellad B. Tadmor, and Stefano Martiniani. Open materials generation with stochastic interpolants. In Forty-second International Conference on Machine Learning, 2025.
[34] Michael Albergo and Eric Vanden-Eijnden. Building normalizing flows with stochastic interpolants. In ICLR 2023 Conference, 2023.
[35] Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matthew Le. Flow matching for generative modeling. In The Eleventh International Conference on Learning Representations, 2023.
[36] Ricky T. Q. Chen and Yaron Lipman. Flow matching on general geometries. In The Twelfth International Conference on Learning Representations, 2024.
[37] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955.
[38] Shyue Ping Ong, William Davidson Richards, Anubhav Jain, Geoffroy Hautier, Michael Kocher, Shreyas Cholia, Dan Gunter, Vincent L Chevrier, Kristin A Persson, and Gerbrand Ceder. Python materials genomics (pymatgen): A robust, open-source python library for materials analysis. Computational Materials Science, 68:314–319, 2013.
A Proofs and Foundational Concepts
A.1 Proof of the Bjectivity of Canonicalization
We restate the main claim using the notation of the paper. For a fixed stoichiometry vector with total mass , define the transportation polytope
and the centered space
Proof. We first prove surjectivity. Fix any and define elementwise. Since is strictly positive, the Sinkhorn–Knopp theorem guarantees the existence of positive diagonal matrices and such that
We can explicitly express these strictly positive diagonal matrices using real-valued vectors and as and .
Substituting these into the scaling equation and taking the element-wise logarithm seamlessly translates the multiplicative Sinkhorn scaling into additive row and column shifts:
Applying the double-centering operator gives
because removes all additive row-wise and column-wise components and is already centered. Hence every has a preimage.
To prove injectivity, suppose satisfy . Then both and are strictly positive matrices whose logarithms differ from only by row-wise and column-wise additive terms. Exponentiating shows that both matrices are diagonal scalings of with the same target marginals . By uniqueness of Sinkhorn scaling for strictly positive matrices, these two scalings must coincide, so .
Therefore is bijective, and its inverse is exactly the Sinkhorn recovery
A.2 Trajectory Feasibility in the Centered Space
We next justify why projecting the occupancy velocity onto preserves the centered constraints along the entire ODE trajectory.
Proof. Let satisfy the ODE
and it satisfies for all . Consider the row-sum vector and the column-sum vector . Differentiating yields
and similarly
Since , we have and . Therefore and for every , which implies for all .
Combining this fact with the inverse map immediately shows that the recovered trajectory stays inside at all times.
A.3 Invariance of the Joint Velocity Field
For our model, a global rigid rotation acts only on the orientation of the lattice basis in Cartesian space. However, the network does not use the oriented basis directly. Instead, it takes the lattice parameters as input, together with , , and . These six lattice parameters are invariant under any global rotation , because such a rotation changes the embedding of the unit cell in Euclidean space but does not change its lengths or inter-axis angles. Therefore,
At the same time, the fractional coordinates are intrinsic coordinates with respect to the lattice basis, so they are unchanged by a simultaneous rotation of the whole crystal. Hence the full model input is rotation-invariant. Since the network is a deterministic function of these rotation-invariant inputs, its outputs are also invariant.
Therefore, a global rotation does not affect the predicted occupancy, coordinate, or lattice-parameter velocities. In this sense, the model is rotation-invariant at the level of its input representation and output predictions.
A.4 Translation Invariance of the Joint Velocity Field
We next consider periodic translations on the torus. It suffices to focus on the fractional coordinates , since the other inputs , , and are unaffected by a global shift of the crystal origin. Let denote the elementwise wrapping operator on the torus, and consider a periodic translation by :
Because the network only uses relative fractional displacements, for any edge we have
Hence the periodic offset is unchanged under a common translation of all sites,
and therefore its sinusoidal embedding is also unchanged. Since the remaining inputs are unchanged as well, the entire network input representation is translation-invariant.
A.5 Flow Matching
Flow Matching (FM) [34, 35] defines a continuous-time transformation between a base distribution and a target data distribution . Let denote a time-dependent data point along the probability path , where . This path is governed by an Ordinary Differential Equation (ODE): , where is a time-dependent vector field. Since the true score or vector field of the marginal distribution is typically intractable, Conditional FM [35] introduces a conditional probability path that interpolates between a noise sample and a data sample . Under a linear interpolation scheme, the intermediate state is defined as . The model is trained to approximate the ideal vector field by minimizing the expected distance between the learned vector field and the tractable conditional vector field . Once trained, new samples are generated by numerically integrating the ODE from to .
Notably, when data are naturally constrained to specific geometric structures, such as the torus or the simplex, standard Euclidean FM is extended to Riemannian FM [36]. This framework defines the probability path and vector field directly on the manifold's tangent bundle, ensuring that the generative trajectory respects the underlying geometric boundaries.
B Physical Intuition and Conceptual Inspirations
The algebraic operations of the canonicalization map and its inverse can be understood as a conceptual analogy to the principles of statistical thermodynamics governing continuous atomic distributions. We detail the physical mappings of the four main modeling components below.
B.1 Logarithmic Mapping as Energy Space Evolution
In our continuous formulation, the fractional occupancy represents the probability of species j occupying site i. This suggests a Boltzmann-type interpretation, where the occupancy is conceptually related to a latent local formation energy via:
where Q is the partition function and T serves as an effective temperature. Taking the element-wise logarithm yields:
By mapping the bounded probability simplex into an unconstrained energy space, the generative ODE avoids learning a velocity field over restricted probability boundaries. Consequently, the vector field learned by the model can be viewed as an analogy to the rate of change of an energy landscape with respect to generative time ( ). This enables the network to simulate a continuous thermodynamic-like evolution, driving the system from high-entropy noise toward a low-energy configuration. Note that this formulation characterizes the generative trajectory as an evolution toward potential stability, rather than assuming the system maintains global thermodynamic equilibrium at every intermediate step.
B.2 Double-Centering as Relative Potential Extraction
In thermodynamics, absolute energy scales are unobservable; system dynamics are driven exclusively by relative energy differences. We decompose the effective local formation energy into a centered core interaction and macroscopic background fields:
Here, is the site-specific potential well, is the species-specific chemical potential determined by stoichiometry , and is the intrinsic relative energy. Applying the double-centering operator to log algebraically eliminates these additive background fields and constant terms, leaving:
Therefore, Z represents a dimensionless relative affinity, acting as an intrinsic structural invariant of the local chemical bonding. Operating in therefore preserves the information needed to recover the ODM under fixed marginals, while providing an energy-like representation for learning.
B.3 Sinkhorn Recovery as Thermodynamic Annealing
The inverse mapping reconstructs the physical occupancy A by applying the Sinkhorn algorithm to , converging to:
In the context of a grand canonical ensemble, the scaling variables and function as dynamic chemical potentials. The iterative Sinkhorn scaling provides a mathematical analogy to an isothermal annealing process where atomic distributions are adjusted to satisfy global stoichiometric constraints. Structural formation is finalized when the system reaches a state that effectively satisfies the physical boundary constraints imposed by the target formula.
B.4 Physical Interpretation of Energy-Difference Edge Features
In the message-passing network, we include the difference between connected sites in the double-centered log-domain representation:
This feature is computed from the centered representation , which removes background terms and can be interpreted as a relative affinity field. This log-domain difference has a direct probabilistic interpretation: for a given species , a difference in log occupancy corresponds to a probability ratio . Under the Boltzmann-type interpretation, this ratio further corresponds to a relative energy difference . Subtraction in the log-domain space thus encodes relative site preferences. By providing the network with explicit information about how the relative energy landscape changes across the crystal graph, helps the model distinguish locally compatible site-species configurations. The ablation results in Table 3 confirm that this feature is critical for recovering accurate local disorder patterns.
Concluding Remarks on Physical Analogy. This conceptual bridge between manifold-constrained flow and statistical mechanics represents an exploratory attempt to provide physical intuition for disordered crystal generation. While these analogies are intended as a heuristic framework rather than a formal derivation, they offer a new vantage point for designing constraint-aware generative models in materials science. We hope this perspective stimulates further cross-disciplinary exploration between the machine learning and physical science communities.
C Data Preprocessing and Metrics
C.1 Datasets
We evaluate the model on four subsets derived from the COD and MPDS databases: substitutional-disorder and general-disorder settings, each at two scales (up to 20 and 50 sites). Following the protocol in the main text, each subset is split into training, validation, and test sets with an approximate ratio of 8:1:1. All models are trained conditionally on the stoichiometry vector c. Crucially, to provide a unified thermodynamic representation, we treat crystallographic vacancies as an explicit pseudo-atom. Consequently, the stoichiometry vector c includes this vacancy species, ensuring that the total sum of the formula strictly equals the number of crystallographic sites ( ).
All raw CIF files are standardized by primitive-cell reduction followed by Niggli reduction.
We then apply a set of filters to ensure physical validity, computational tractability, and sufficient statistical support. Structures with interatomic distances below 0.5 Å, cell volume below 0.1 ų, or any lattice parameter larger than 40 Å are removed.
To evaluate different structural scales, we construct subsets with the number of crystallographic sites satisfying or .
To control the compositional complexity, we limit the number of distinct species in each extended formula to , including the vacancy pseudo-atom when present.
To focus on inorganic crystals and avoid molecular orientational disorder, we exclude structures containing both C and H.
To restrict local disorder complexity, we allow at most four co-occupying species on each mixed site and require each retained structure to contain at least one disordered site.
To ensure statistically reliable elemental embeddings, we remove structures containing rare elements, defined as elements appearing fewer than 5 times in raw COD or fewer than 50 times in raw MPDS.
Figure 5 illustrates the element-to-position index map used in this work and the resulting element-occurrence distribution in the MPDS Disorder-50 subset.
To prevent data leakage during evaluation, we apply a strict structural deduplication protocol before the train/validation/test split. Structures with matching formulas and site counts are compared using structure matchers with
Table 4: Dataset statistics for COD and MPDS databases.
| Database | Setting | Train | Val | Test | Total | Ratio (Train:Val:Test) |
|---|---|---|---|---|---|---|
| COD | Substitution 20 | 7,100 | 879 | 921 | 8,900 | 7.98 : 0.99 : 1.03 |
| Substitution 50 | 9,483 | 1,141 | 1,190 | 11,814 | 8.03 : 0.97 : 1.01 | |
| Disorder 20 | 9,408 | 1,185 | 1,217 | 11,810 | 7.97 : 1.00 : 1.03 | |
| Disorder 50 | 13,825 | 1,689 | 1,725 | 17,239 | 8.02 : 0.98 : 1.00 | |
| MPDS | Substitution 20 | 53,492 | 6,648 | 6,786 | 66,926 | 7.99 : 0.99 : 1.01 |
| Substitution 50 | 65,187 | 8,412 | 8,499 | 82,098 | 7.94 : 1.02 : 1.03 | |
| Disorder 20 | 69,032 | 8,715 | 8,835 | 86,582 | 7.97 : 1.01 : 1.02 | |
| Disorder 50 | 87,882 | 11,531 | 11,553 | 110,966 | 7.92 : 1.04 : 1.04 |

Elements Map
MPDS 50 Disorder
Figure 5: Element index map and MPDS Disorder-50 distribution. Left: the element-to-position index map used in this work. Right: the element-occurrence heatmap for the MPDS Disorder-50 subset.
Duplicates are rigorously removed from the validation and test sets.
Table 4 reports the size of each de-duplicated subset. The Sub-20/50 subsets contain substitutional disorder only, whereas Disorder-20/50 additionally include vacancy disorder and therefore represent a more challenging generation regime.
C.2 Baseline Adaptations
Ordered Baselines. Since FlowMM [4] and OMatG [33] are originally designed for ordered crystal structure prediction, we adapt them to support continuous site-wise occupancies while preserving their original backbone architectures. Specifically, we replace the discrete atomic-species representation with continuous occupancy distributions and introduce an additional prediction head to jointly generate site occupancies with fractional coordinates and lattice parameters. The input chemical formula is used to mask species absent from the target composition, and a Sinkhorn projection is applied to the predicted occupancy matrix at inference time to enforce the target composition and site-wise normalization constraints. For OMatG, we additionally incorporate the disordered formula embedding used in EP-Flow, which provides explicit composition and site information to the network. Other components of the original FlowMM and OMatG architectures are kept unchanged.
Disordered Baselines. The original CSP setting of DMFlow [20] assumes that site-wise occupancy distributions are provided as input and remain fixed during generation, which is incompatible with our formula-conditioned setting where the occupancies are unknown. We therefore adapt the occupancy-generation mechanism from DMFlow's De Novo Generation (DNG) setting to predict site-wise occupancies from the chemical formula. In particular, we employ its Riemannian spherical reparameterization to constrain the generated occupancy distributions, while jointly generating the structural variables using the original DMFlow framework. At inference time, we further apply a Sinkhorn projection to the predicted occupancies to enforce consistency with the target chemical formula. Thus, Adapted-DMFlow does not use ground-truth site-level occupancy information as input and receives the same task-level conditioning information as EP-Flow.
Summary of constraint handling. These adaptations also provide a progressive comparison of how occupancy constraints are incorporated into the generative process. Adapted-FlowMM and Adapted-OMatG generate occupancies without explicitly enforcing either the row or column constraints during generation, and rely on a post-hoc Sinkhorn projection to satisfy both constraints. Adapted-DMFlow introduces the site-wise row constraint through its spherical reparameterization, such that each site represents a normalized occupancy distribution, but does not enforce the column constraint corresponding to the target composition during generation; the latter is again imposed through the Sinkhorn post-processing. In contrast, EP-Flow explicitly preserves both the row and column constraints throughout the generative process. Therefore, these baselines form a progressive comparison from unconstrained generation, to row-constrained generation, and finally to the jointly row- and column-constrained generation of EP-Flow, allowing us to directly assess the benefit of incorporating the full transportation-polytope constraints into the generative dynamics.
C.3 Evaluation Metrics
To rigorously evaluate disordered crystals, we propose an extended structure matching metric suite. Building upon the standard evaluation protocol for ordered crystals, we additionally incorporate continuous site-wise occupancies into the structural matching process. Based on this, our models are evaluated using four key metrics: Match Rate, RMSD, OccMAE, and structural validity.
Let denote the generated/reference pairs. The structure-matching stage uses
where ltol is the relative lattice-length tolerance, stol is the normalized site-distance tolerance, angle_tol is the lattice-angle tolerance in degrees, and occtol is the occupancy tolerance.
The choice of occtol = 0.3 is designed to align seamlessly with the relative scale of the lattice and spatial tolerances (ltol = 0.3, stol = 0.5). This threshold permits reasonable generative variance in continuous fractional occupancies while rigorously rejecting fundamentally mismatched atomic assignments.
To demonstrate that this threshold does not artificially inflate performance, we comprehensively evaluated EP-Flow on the representative MPDS Sub-20 dataset under increasingly stringent occupancy tolerances, ranging from 0.30 down to a highly strict 0.01.
As summarized in Table 5, tightening occtol from 0.30 to 0.01 only reduces the Match Rate from 60.82% to 50.09%, while the OccMAE naturally decreases to 0.0004. The robust retention of the Match Rate under such extreme constraints confirms that the model genuinely captures highly precise continuous site-wise occupancies, rather than merely passing a loose matching threshold.
Table 5: Performance of EP-Flow on the MPDS Sub-20 dataset under varying occupancy tolerances.
| occtol | Successful Matches | Match Rate | Normalized RMSD | OccMAE |
|---|---|---|---|---|
| 0.30 | 4,127 | 60.82% | 0.0483 | 0.0075 |
| 0.25 | 4,067 | 59.93% | 0.0483 | 0.0058 |
| 0.20 | 4,012 | 59.12% | 0.0480 | 0.0048 |
| 0.15 | 3,916 | 57.71% | 0.0480 | 0.0033 |
| 0.10 | 3,804 | 56.06% | 0.0479 | 0.0020 |
| 0.05 | 3,653 | 53.83% | 0.0475 | 0.0010 |
| 0.01 | 3,399 | 50.09% | 0.0444 | 0.0004 |
| 0.005 | 3,186 | 46.95% | 0.0438 | 0.0002 |
For each pair, we first compute a vacancy-aware site-wise occupancy discrepancy matrix. Let and denote the occupancies of species at predicted site and reference site , respectively, with vacancy included explicitly as an additional species. Then
which is exactly the total variation distance. A site pair is chemically feasible if .
Next, for every lattice-aligned candidate and periodic shift, the pairwise spatial distance is computed on the ground-truth lattice and normalized by the average free length
where denotes the volume and is the distance between two atoms. A site pair is spatially feasible if .
The final valid edge set is the intersection of the occupancy-feasible and spatially feasible masks. In this bipartite graph, we solve a Hungarian assignment [37] by minimizing the normalized spatial cost. A sample is counted as a successful match only when a perfect -to- assignment exists.
Let and are both valid 3D structures}, denote the optimal assignment for sample , and
be the set of successful matches. In the implementation, because the matching stage is evaluated only when both the prediction and the ground truth pass the validity checks. Then the Match Rate reported by the code is
For each successful sample , the per-structure normalized RMSD is
and the reported dataset-level RMSD is the average over successful samples,
Similarly, the per-structure occupancy error is
and the reported OccMAE is
The Validity score follows the crystal-construction and sanity checks: a prediction is valid only if it can be converted to a pymatgen structure [38] and passes the structural validity test. Therefore,
D Implementation Details
D.1 Disordered Crystal Structure
Crucially, the Occupancy Distribution Matrix (ODM) should not be interpreted as a single, static snapshot of a disordered crystal. Instead, it serves as a statistical summary of all possible local atomic arrangements. As illustrated in Fig. 6, while an ordered structure assigns exactly one specific element to each crystallographic site, a disordered structure allows equivalent sites to host different elements—or remain completely empty—across different regions of the material. The vacancy-extended ODM captures this variability by assigning each site a probability distribution over all candidate species, explicitly including the vacancy pseudo-atom. Therefore, each entry simply represents the probability, or the average fraction, that species j occupies site i. This formulation enables EP-Flow to model disordered crystals at an average, macroscopic level. It elegantly translates the physical complexity of mixed atomic arrangements into clear geometric marginal constraints, while still preserving physically meaningful, site-specific disorder patterns.

Figure 6: Unified representation of diverse disorder types via the vacancy-extended Occupancy Distribution Matrix (ODM). In an ordered crystal (left), the site count N is well-defined by the formula with discrete occupancies. When transitioning to disordered systems (right), this assumption breaks down. For substitutional disorder (top right), occupancies become continuously fractional while N remains unchanged. For vacancy (middle right) and interstitial disorder (bottom right), the site count cannot be determined from the raw formula alone. To resolve this ambiguity, a vacancy pseudo-atom (Vac, depicted as grey/white spheres) is introduced to ensure that the occupancy at each site sums to one. This yields an extended formula c that incorporates the total vacancy count, satisfying . This formulation explicitly conditions the structural representation on both the formula and the site number, allowing all disorder types to be modeled within a unified ODM framework.
D.2 Formula and Number of Sites
In ordered crystal generation, the number of atomic sites is usually well defined from the reduced chemical formula. Each crystallographic site is occupied by a single atom, and therefore the total number of atoms in the formula naturally equals the number of nodes in the crystal graph. This convention is adopted by many graph-based crystal generation models, such as DiffCSP and FlowMM, where the model typically needs to know or sample the number of nodes before generating fractional coordinates and lattice parameters.
However, this assumption does not directly hold for disordered crystals. In a disordered structure, a crystallographic site may be fractionally occupied by multiple species, or may be partially vacant.
As a result, the raw chemical formula may contain non-integer stoichiometric coefficients and its total sum does not necessarily reveal the number of crystallographic sites. For example, a partially occupied site with occupancy 0.5 contributes only half an atom to the chemical formula, while it still corresponds to one crystallographic site in the structure representation. Therefore, the site count cannot be inferred by simply summing the non-vacancy species in the formula.
To obtain a consistent representation, we explicitly introduce a vacancy species, denoted as Vac, to complete each crystallographic site to full occupancy. For each site i, the occupancy vector satisfies
where M includes both real chemical species and the vacancy species. Accordingly, the extended stoichiometric vector c also includes the total vacancy count. This gives
where N is the number of crystallographic sites. In other words, after vacancy completion, the extended formula is fully occupied at the site level, and the sum of the extended formula equals the number of sites.
To better illustrate how the vacancy-augmented formula bridges macroscopic chemical formulas with microscopic site occupancies, let us consider a common macroscopic formula, .
Case 1 (A structure with 3 sites): Suppose we read the structural information of a crystal with this formula and find it has exactly crystallographic sites. The actual site occupancies might be: Site 1 (A, occupancy = 1.0), Site 2 (B, occupancy = 1.0), and Site 3 (A, occupancy = 0.5). To address the partial occupancy on Site 3, we introduce a “vacancy” (Vac) pseudo-atom to pad the remaining probability. Thus, Site 3 becomes a mixed site: (A: 0.5, Vac: 0.5). This transforms the vacancy defect into a purely substitution-disorder format. The corresponding augmented formula becomes . The sum of the base formula subscripts perfectly matches the actual number of sites .
Case 2 (A structure with 4 sites): Now, suppose another structure with the exact same conventional formula has crystallographic sites. Its actual site occupancies might be: Site 1 (A, occupancy = 1.0), Site 2 (B, occupancy = 1.0), Site 3 (A, occupancy = 0.25), and Site 4 (A, occupancy = 0.25). We pad the empty probabilities on Sites 3 and 4 with the vacancy pseudo-atom, resulting in Site 3 (A: 0.25, Vac: 0.75) and Site 4 (A: 0.25, Vac: 0.75). The augmented formula for this specific structure becomes . Again, the sum of the base formula subscripts perfectly matches the site count .
In practice, this simple yet effective padding mechanism guarantees that our transportation-polytope framework can unify substitution disorder and vacancy defects under a single mathematical formulation. During training, we utilize these fully padded, vacancy-augmented formulas alongside their corresponding ODMs. During inference, the augmented formula serves as the deterministic conditional input. It is directly derived from the conventional chemical formula and the target number of sites N by calculating the vacancy amount as:
For our examples, this is for Case 1, and for Case 2.
This treatment is important for disordered crystal generation. It allows substitutional disorder and vacancy disorder to be represented in a unified occupancy distribution matrix (ODM), while preserving the same node-level structure as graph-based crystal models. The model therefore generates a fixed number of crystallographic sites N, each associated with a fractional coordinate and a probability distribution over real species and vacancies. The final physical composition is recovered by marginalizing out the vacancy species, whereas the extended formula ensures that every site remains fully occupied in the ODM representation.
D.3 Log-domain Double Centering
-smoothing and log-domain canonicalization. Real ODMs are highly sparse, and many entries of A are exactly zero. Directly applying log A is therefore ill-defined. We first apply a small -smoothing to move the ODM from the boundary of the transportation polytope to its relative interior:
We then perform masked log-domain double centering:
Log-domain Double Centering
Ensure: Centered representation
1:
2:
3:
4:
5:
6:
7:
8:
9: return
This removes site-wise and species-wise additive effects and provides a shared zero-marginal representation for flow matching.
D.4 Sinkhorn Recovery
Formula-conditioned recovery with truncation. The generated centered matrix is not itself a valid occupancy matrix. We first mask species absent from the target formula and exponentiate the stabilized logits to obtain a positive kernel:
The kernel is then projected onto the formula-conditioned transportation polytope by Sinkhorn normalization:
Sinkhorn Recovery
Ensure: Recovered ODM A
1:
2:
3:
4:
5:
6: , if
7:
8: return A
Specifically, the Sinkhorn algorithm seeks two positive scaling vectors and such that the scaled matrix meets the prescribed marginals. This is efficiently achieved through alternating multiplicative updates:
where the division is performed element-wise, and is typically initialized to . After a finite number of iterations , the recovered matrix satisfies the marginal constraints up to numerical precision:
During CIF reconstruction, we observe that the recovered ODM may contain very small nonzero occupancies on some site–species pairs with negligible contribution, sometimes around . If directly written into CIF files, these trace values may be interpreted as additional mixed species, leading to unnecessarily dense occupancy annotations.
This behavior is mainly caused by the numerical recovery procedure. First, Sinkhorn recovery operates on strictly positive kernels induced by -smoothing, so valid entries may retain small positive masses after normalization. Second, Sinkhorn normalization is implemented with a finite number of iterations, which can leave tiny residual values on numerically feasible site–species pairs.
To obtain cleaner reconstructed structures, we truncate entries with to zero after the first Sinkhorn projection. In our experiments, we set , corresponding to occupancies below 0.5% of a crystallographic site. This threshold is intentionally conservative: it removes only trace values below the occupancy scale considered meaningful in our reconstruction protocol, while preserving genuine fractional occupancies. After truncation, we apply a second Sinkhorn projection to restore the prescribed row and column marginals up to numerical tolerance.
This post-processing produces a sparse and formula-consistent ODM, helps avoid interpreting negligible numerical residuals as meaningful mixed-site disorder during CIF reconstruction, and yields reconstructed crystals with more physically interpretable occupancies.
D.5 Structural Reconstruction
Figure 7 visualizes representative reconstruction trajectories for three disordered oxide systems. At , the structures are highly noisy and mainly preserve coarse compositional information. As the trajectory evolves toward , EP-Flow progressively recovers ordered atomic positions and site-wise occupancy patterns. The final predictions are valid, formula-matched, and successfully matched to the corresponding ground-truth structures.

Figure 7: Structural reconstruction trajectories of three representative disordered oxides. Each row shows the evolution from the noisy state at to the reconstructed structure at , compared with the ground truth.
Table 6: Reconstruction metrics for the representative disordered oxide cases in Fig. 7.
| Formula | RMSD (↓) | OccMAE (↓) | Max Occ Error (↓) |
|---|---|---|---|
| 0.0188 | 0.0006 | 0.0019 | |
| 0.0191 | 0.0053 | 0.0371 | |
| 0.0151 | 0.0052 | 0.0335 |
Table 6 summarizes the quantitative reconstruction accuracy. All three examples achieve RMSD below 0.02, indicating accurate reconstruction of fractional coordinates and lattice geometry. The OccMAE values are also small, showing that EP-Flow recovers site-wise fractional occupancies with high fidelity. The largest occupancy errors mainly occur on mixed cation sites, where multiple chemically similar species compete for the same crystallographic positions.
Table 7: Site-wise occupancy comparison for representative structural reconstruction cases. Only mixed-occupancy sites are reported; fully occupied sites are omitted for clarity.
| Formula | Mixed site | Reference occupancy | Predicted occupancy | ΔOcc |
|---|---|---|---|---|
| B-site | 0.0013 | |||
| A-site | 0.0019 | |||
| Cation site | 0.0371 | |||
| Mg/Fe site | 0.0335 | |||
| Al/Cr site | 0.0016 |
Table 7 further compares the reference and predicted occupancies on mixed sites. For , EP-Flow almost exactly recovers both A-site Sr/Ca/La disorder and
B-site Mn/Cr disorder, with maximum occupancy errors below 0.002. This case demonstrates that EP-Flow can accurately reconstruct coupled A/B-site disorder in a perovskite-like oxide framework.
For , the Mg/Zn/Co mixed site is more challenging because three species compete on the same cation sublattice. The prediction preserves the global formula but slightly redistributes occupancy between the two mixed sites: one site becomes slightly Mg-rich, while the other becomes relatively Zn/Co-rich. This suggests that the main residual error arises from local redistribution among multiple mixed species rather than failure to satisfy the global composition.
For , the Al/Cr mixed sites are reconstructed accurately, with maximum occupancy error around 0.0016. The main residual error comes from the Mg/Fe mixed sites, where EP-Flow predicts one site as slightly Mg-rich and the other as slightly Fe-rich. Importantly, the two predicted Mg/Fe sites still sum to the correct total composition, . Thus, the error mainly reflects local redistribution among chemically similar mixed sites rather than violation of the global stoichiometry. Such site-level differentiation is chemically plausible in disordered crystals, although the crystallographic average structure remains the reference for quantitative evaluation.
D.6 Hyperparameters
Table 8 summarizes the concrete architecture hyperparameters and optimization-related quantities exposed by the current implementation. All experiments were conducted on NVIDIA GeForce RTX 4090 GPUs with 24 GB memory. Models on COD were trained on a single GPU, while MPDS models were trained with two-GPU distributed data parallelism due to the larger dataset scale. We used 16-bit mixed precision for all training runs.
Table 8: Architecture and training-related hyperparameters.
| Hyperparameter | Symbol / module | Value |
|---|---|---|
| Hidden dimension | 512 | |
| Message-passing layers | 6 | |
| Activation function | SiLU | |
| Learning rate | ||
| LR decay factor | 0.85 | |
| LR scheduler patience (epochs) | 50 | |
| Training epochs | 1000 | |
| Sinkhorn iterations | 100 | |
| ODE steps | 200 |
Table 9: Dataset-specific training hyperparameters and generative loss weights.
| Database | Setting | Batch Size | Sampling step_lr | ||||
|---|---|---|---|---|---|---|---|
| COD | Substitution | 256 | 3 | 20.0 | 100.0 | 1.0 | 100.0 |
| Disorder | 20.0 | 100.0 | 1.0 | 100.0 | |||
| MPDS | Substitution | 512 | 5 | 20.0 | 100.0 | 5.0 | 500.0 |
| Disorder | 20.0 | 100.0 | 5.0 | 500.0 |
E Limitations
EP-Flow currently focuses on formula-conditioned generation for disordered crystals. Although the global stoichiometry provides the main compositional constraint, the generation process also implicitly depends on the number of crystallographic sites. In practice, the site count is either specified or sampled from the empirical distribution of the benchmark setting. Therefore, fully determining the site number directly from the formula alone remains an open problem, especially for disordered structures where the summed non-vacancy stoichiometry does not necessarily equal the number of crystallographic sites.
Second, EP-Flow does not currently support property-conditioned generation. The present framework is designed to generate structurally valid disordered crystals under stoichiometric constraints, but it does not directly optimize target properties such as ionic conductivity, magnetism, superconductivity, or thermodynamic stability. Extending EP-Flow to property-guided or inverse-design settings is an important direction for future work.
Finally, EP-Flow does not currently condition on experimental measurements such as PXRD, PDF, or spectroscopy data. Incorporating such information could further constrain the generation process and make the framework more useful for experimental structure determination and refinement.