Generating Doped Semiconductors That Absorb Visible Light Without Faking Their Magnetism

Many wide-bandgap oxides and nitrides, such as ZnO, TiO2 and GaN, only absorb ultraviolet light. Adding a few percent of transition-metal atoms like cobalt or chromium, often together with oxygen vacancies, can make them absorb visible light and can also make them magnetic. That combination would be useful for solar-driven chemistry and for devices that use electron spin. The catch is well documented experimentally. The same high dopant and defect densities that extend absorption also tend to make the dopants clump together into small clusters. A bulk magnetometer still reads a net moment from such a sample, but the moment no longer comes from dopants spread through the crystal. X-ray spectroscopy that looks at each element separately has shown that in Co-doped ZnO fewer than 1% of Co ions contribute to ferromagnetism, and that the rest couple antiferromagnetically, so their spins cancel (Kobayashi et al.). In Cr-doped GaN, adding silicon donors produced antiferromagnetic Cr-rich clusters with only about 0.25 μB per Cr (Song et al.).

Generative models for crystals now accept property targets. MatterGen can be steered toward a band gap and a "magnetic density." That target is exactly the bulk quantity that experiments show can be faked by clusters. We propose a host-conditioned generative model that places dopants and vacancies inside a given wide-gap host. It is trained and evaluated against a computable stand-in for element-specific magnetism verification rather than against net moment. The claim is that conditioning on this "intrinsic magnetism" label changes which configurations get generated, and that a bulk-moment target cannot recover those configurations. The generator is a diffusion model: it learns to turn random noise into structures by removing noise step by step.

Core Claim

Treat "is the magnetism intrinsic?" as a label that density functional theory (DFT) can compute, and condition generation on it jointly with a visible-range band gap. The model then finds dopant–vacancy arrangements in unseen hosts that absorb in the visible and keep dopants isolated and ferromagnetically coupled. It should do this more often, per unit of DFT verification budget, than three alternatives: screening an unconditional generator's output, MatterGen-style conditioning on bulk moment, or exhaustive enumeration with a surrogate predictor.

Two design choices follow from tensions in prior work. First, the conditioning has the same structure as reference-image-plus-text conditioning in image diffusion. Here the host crystal is a dense reference made of tens of atom tokens, and the property targets are a few sparse tokens. We therefore give them separate attention streams. Second, guidance from surrogate property predictors produces biased gradients, so we take the step rule for guidance from the theory of optimization under misaligned gradients rather than from ad hoc scaling.

The Intrinsic-Magnetism Label

The experimental studies above separate intrinsic from extrinsic magnetism using three signatures. The first is whether dopants prefer to sit next to each other, which leads to the aggregation seen after annealing in Co-doped ZnO. The second is whether neighboring dopants couple antiferromagnetically, which shows up as the negative Weiss temperatures in the same work. The third is whether each dopant's local moment is close to its isolated-ion value, which fails in the Cr-doped GaN cluster case.

Each signature has a direct DFT analogue that can be computed with spin-polarized DFT+U, meaning DFT with an on-site correlation correction:

  • the pair binding energy, the energy of a supercell with two dopants adjacent minus the energy with them separated;
  • the sign of the nearest-neighbor exchange, from ferromagnetic versus antiferromagnetic total energies;
  • the projected local moment per dopant.

A configuration passes the intrinsic label only if all three hold: dopants do not bind, coupling is not antiferromagnetic, and the local moment is within a tolerance of the isolated value. Vacancies are handled the same way. Weng et al. found in Co-doped anatase TiO2 that a vacancy is about 0.33 eV more stable next to Co than next to Ti, and that this Co–vacancy pairing is what both opens visible absorption and mediates ferromagnetism. Vacancy–dopant binding is therefore allowed. Only dopant–dopant clustering is penalized.

This label is a computational proxy and not an XMCD measurement. Before the label is used anywhere, we calibrate it against the three systems in the file. The pipeline must reproduce three findings:

  • antiferromagnetic nearest-neighbor Co–Co coupling in ZnO;
  • the ~0.33 eV vacancy preference next to Co in anatase;
  • Cr–Cr binding in GaN becoming more favorable when the chemical potential is raised, matching the 0.2–0.3 eV upward shift and clustering in Song et al..

If the pipeline fails any of these, the label is not trusted and the project stops at that point.

Visible absorption is scored by the band gap, or by the onset of mid-gap absorption, landing in a visible window (we use 1.8–3.0 eV). Band gaps come from DFT+U with a scissor correction for training labels, following Weng et al.'s practice. A hybrid-functional check is run on the final shortlisted candidates, because the file notes that standard DFT misplaces band edges.

Research Program

Dataset. We build a dataset that does not currently exist. Hosts are wide-gap oxides and nitrides drawn from MP-20 and Alex-MP-20. Supercells go up to roughly 52 atoms, which matches MPTS-52 and is large enough for a few percent doping. Dopants are Co, Mn, Cr, V, Fe and Ni. Each configuration contains one to three substitutions and zero to two vacancies. Every configuration is labeled with gap, formation energy, and the intrinsic label. Hosts are split so that test hosts never appear in training.

Generator. The generator is a single-stream diffusion transformer over the supercell's atom tokens, in the style of CrystalDiT. It denoises which element sits on each site, whether a site is vacant, and small coordinate relaxations. Two conditions enter through separate cross-attention streams that share the generator's queries. One stream attends to the pristine host's atom tokens. The other attends to a few property tokens: target gap window, intrinsic flag, and dopant species. The two outputs are summed with a learned gate. This is the decoupled injection used by RelationAdapter, CustomNet and MasterWeaver, where it stopped dense image features from drowning out sparse text.

The reason to expect the same failure here is concrete. When ~50 host tokens and 3 property tokens share one softmax, the host tokens dominate the normalization, so the property targets get little attention weight.

The constraint comes from CrystalDiT, which found that adding dual-stream cross-attention to a crystal diffusion transformer caused memorization on MP-20. We respond in three ways. Our extra stream is small, carrying only property tokens. The host stream reuses the backbone's own token embeddings rather than a second encoder. We measure memorization directly instead of assuming it away.

Guidance at sampling time. Optional guidance comes from surrogate predictors of gap and pair binding energy. These gradients are biased relative to DFT, and in the language of Descent with Misaligned Gradients the bias is a misalignment that drifts slowly along the denoising trajectory. That paper shows iterate averaging, which it proves equivalent to momentum, handles slowly drifting misalignment. For general misalignment, it shows normalized steps with a pullback regularizer prevent the iterates from blowing up.

We therefore apply normalized, momentum-averaged guidance with a pullback toward the unguided score. We measure how badly the surrogate is biased instead of assuming a level. On ~100 held-out structures we compute the cosine between the surrogate gradient and a finite-difference DFT gradient. From those samples we estimate the constants of the Biased ABC bound from A Guide Through the Zoo of Biased SGD, which bounds the gradient estimator's second moment by $A(f-f^*) + B\|\nabla f\|^2 + C$. We use the estimated constants to set the guidance scale.

Baselines

The naive reference point is random placement of the requested dopants and vacancies in the held-out host, followed by the same DFT verification. It tells us how often the target is hit by chance.

The strongest unconditional competitor is generate-and-screen. We train the same CrystalDiT-style backbone without property conditioning, sample from it, rank the samples with the same surrogate predictors, and send the top candidates to DFT. CrystalDiT reports a SUN (stable, unique, novel) rate of 8.78% on MP-20, versus 4.21% for FlowMM and 3.66% for MatterGen (CrystalDiT). That makes it the strongest available unconditional generator. No reported result found on Lacuna for any model on host-conditioned dopant/vacancy design, so all task numbers will be produced here.

The strongest existing conditional method is MatterGen-style conditioning (MatterGen): adapter modules plus classifier-free guidance on band gap and bulk magnetic moment. We re-implement it on our backbone so that architecture is held fixed.

For combinatorially small cases we also run exhaustive symmetry-reduced enumeration of placements, ranked by the surrogates.

Fairness rules apply to every method. All methods use the same training configurations, the same surrogates, the same tuning budget, and above all the same number of DFT verifications per host.

Two ablations isolate the proposal's ingredients. The first keeps decoupled attention but conditions on bulk moment instead of the intrinsic label; it isolates the label. The second conditions on the intrinsic label but concatenates host and property tokens into one attention; it isolates decoupling.

The primary metric is verified hits per 100 DFT calculations on held-out hosts. A verified hit has a visible-range gap, passes the intrinsic label, and lies within a fixed formation-energy margin of the lowest-energy configuration of that composition. Beating the baselines means a higher hit rate than both generate-and-screen and the MatterGen-style variant on held-out hosts, with non-overlapping bootstrap intervals across hosts. On held-in hosts it also means a memorization rate, the fraction of samples identical to training configurations, no worse than the unconditional backbone.

Why not just…?

Why not just generate unconditionally and filter? This is the most serious threat. If visible-absorbing, non-clustering configurations are common, screening wins on simplicity. Conditioning can only pay off where hits are rare. We therefore report hit rate stratified by how rare the target is among random placements. We also commit to the screening approach for any host class where it matches the conditional model at equal DFT budget.

Why not just condition on band gap and bulk magnetic moment, as MatterGen does? Bulk moment rewards exactly the configurations that experiments showed were not intrinsic. Clusters still carry net moment, as the 0.25 μB/Cr superparamagnetic clusters in Song et al. and the sub-1% ferromagnetic Co fraction in Kobayashi et al. illustrate. The bulk-moment ablation tests this directly. If its samples pass the intrinsic label as often as ours, the label adds nothing and we drop the claim.

Why not just enumerate placements and rank with a surrogate? For one or two dopants in a 48-site cell, enumeration is cheap and probably unbeatable. We expect it to win there, and we will report that. The generator's case rests on amortization. Once dopant species, three dopants, two vacancies, and many hosts are chosen jointly, the search space grows far beyond what can be enumerated. Meanwhile, a single trained model transfers to unseen hosts without new surrogate scoring of every configuration. The comparison crosses over as configuration count grows, and we report where that crossover falls.

Why not just concatenate the conditions into one attention? With only a handful of property tokens, concatenation might be enough. CrystalDiT's complexity penalty also argues for fewer streams. The concatenation ablation decides this. We additionally log the attention mass that property tokens receive under concatenation. If that mass is not suppressed by host tokens, the motivating mechanism is absent and the simpler design is adopted.

Decisive Checks

The project stands or falls on four results.

  1. Calibration. The DFT label must reproduce the three literature findings: Co–Co antiferromagnetic coupling in ZnO, the ~0.33 eV Co–vacancy preference in anatase, and donor-enhanced Cr clustering in GaN.
  2. Label versus bulk moment. On held-out hosts, the bulk-moment ablation must yield a substantially lower intrinsic pass rate than intrinsic conditioning at equal DFT budget.
  3. No memorization penalty. The decoupled model must not show CrystalDiT's memorization penalty relative to the single-stream unconditional backbone.
  4. Guidance under measured bias. Where the measured surrogate–DFT gradient cosine is low, plain guidance should lose validity as guidance scale grows, and normalized averaged guidance should hold validity. This is what the misaligned-gradient analysis predicts, because averaging cancels slowly drifting misalignment. If plain guidance is equally robust, the bias correction is unnecessary and is removed.

A final hybrid-functional recheck of the top candidates per held-out host guards against scissor-corrected gaps that look visible but are not.

References

  1. Antiferromagnetic interaction between paramagnetic Co ions in the diluted magnetic semiconductor<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"><mml:mrow><mml:msub><mml:mrow><mml:mtext>Zn</mml:mtext></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mtext>Co</mml:mtext></mml:mrow><mml:mi>x</mml:mi></mml:msub><mml:mtext>O</mml:mtext></mml:mrow></mml:math>
  2. Electronic structure of<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"><mml:mrow><mml:msub><mml:mrow><mml:mtext>Ga</mml:mtext></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mtext>Cr</mml:mtext></mml:mrow><mml:mi>x</mml:mi></mml:msub><mml:mtext>N</mml:mtext></mml:mrow></mml:math>and Si-doping effects studied by photoemission and x-ray absorption spectroscopy
  3. MatterGen: a generative model for inorganic materials design
  4. Electronic structure and optical properties of the Co-doped anatase<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="normal">TiO</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:math>studied from first principles
  5. CrystalDiT: A Diffusion Transformer for Crystal Generation
  6. RelationAdapter: Learning and Transferring Visual Relation with Diffusion Transformers
  7. CustomNet: Zero-shot Object Customization with Variable-Viewpoints in Text-to-Image Diffusion Models
  8. MasterWeaver: Taming Editability and Face Identity for Personalized Text-to-Image Generation
  9. Descent with Misaligned Gradients and Applications to Hidden Convexity
  10. A Guide Through the Zoo of Biased SGD