Skip to main content
Chemistry· 14-page report· 1 figure

QM9 HOMO-LUMO Gap Prediction

Predict QM9 HOMO–LUMO gaps with ML regression and validate predicted-versus-true parity plots.

What this research found

The HOMO–LUMO gap — the energy difference between a molecule's highest occupied and lowest unoccupied orbital — sets its optical and reactivity behaviour, and predicting it from geometry alone is far cheaper than computing it. A gradient-boosted tree ensemble was trained on 130,831 curated QM9 molecules encoded as sorted Coulomb matrices, reaching a held-out mean absolute error of 0.3126 eV with an R² of 0.8785. Stratifying the error by gap size then showed that the narrow-gap molecules of greatest practical interest are predicted 1.77 times less accurately, and systematically too high.

  • The selected gradient-boosting model reached a test mean absolute error of 0.3126 eV (312.6 meV), a root-mean-square error of 0.4479 eV and R² = 0.8785 across 10,831 held-out molecules, against 1.0627 eV for a constant-mean baseline. Test error reproduced validation error to within 1 meV.
  • Errors are right-skewed: the median absolute error is 0.225 eV, with 53.8% of molecules predicted within 0.25 eV of the reference calculation, 81.5% within 0.5 eV and 96.3% within 1.0 eV.
  • Narrow-gap molecules — the lowest decile of true gaps, at or below 5.2763 eV, 1084 molecules — were predicted with a mean absolute error of 553.9 meV and a root-mean-square error of 0.7931 eV, roughly 1.77 times worse than the test set as a whole.
  • That degradation is bias, not noise. The model is essentially unbiased overall (mean signed error +0.015 eV) but over-predicts narrow gaps by +0.50 eV on average, with 84.8% of narrow-gap errors positive. The highest decile shows the mirror image at −0.31 eV, the signature of regression toward the population mean at both edges.
  • Non-linearity matters more than network depth here. Ridge regression on the same features reached only 0.7128 eV validation error (R² = 0.504), while a multilayer perceptron reached 0.4054 eV and showed clear overfitting, with training error of 0.1512 eV against validation error of 0.4054 eV.
  • The practical implication is that a model reported only by aggregate error would overstate its usefulness for finding semiconductors, dyes or photocatalysts by nearly a factor of two, and would systematically miss genuinely narrow-gap candidates by predicting their gaps as larger than they are.

How it was done

Starting from the 133,885 QM9 molecules — up to nine heavy atoms of carbon, nitrogen, oxygen and fluorine with properties computed at the B3LYP/6-31G(2df,p) level — the canonical geometric-consistency filter removed the 3054 structures whose relaxed geometry fails the round-trip structure test, leaving 130,831. Each molecule was encoded as a sorted, zero-padded Coulomb matrix flattened to 435 dimensions, a descriptor invariant to translation, rotation and atom ordering. A single fixed permutation split the data into 110,000 training, 10,000 validation and 10,831 test molecules, with feature scaling fit on the training partition only to avoid leakage. Ridge regression, histogram-based gradient boosting and a multilayer perceptron were tuned and compared on validation error; the gradient-boosting model was selected and evaluated on the test set exactly once. Test error was then stratified by gap decile, and per-molecule predictions were released with their original dataset indices.

Data sources

  • QM9 (Ramakrishnan et al., Scientific Data 1:140022, 2014) — 133,885 molecules with B3LYP/6-31G(2df,p) properties, 130,831 retained after filtering
  • QM9 published list of 3054 geometry-inconsistent molecules
  • Coulomb matrix descriptor of Rupp et al., Phys. Rev. Lett. 108:058301 (2012)
  • scikit-learn and NumPy

Limitations

The target is the B3LYP orbital-energy gap, a computational label that systematically underestimates experimental optical and transport gaps, so the model emulates the calculation rather than the measurement. The sorted Coulomb matrix encodes nuclear geometry but not bond topology, imposing an accuracy ceiling — the best published graph neural networks reach 40 to 70 meV on this task — and a single fixed split gives point metrics rather than cross-validated variance estimates.

How this research was produced

K-Dense Web planned and ran this chemistry investigation end to end — gathering the sources, carrying out the analysis, producing the figures, and drafting the report. The full session transcript, including every intermediate step, is available to view.

Share:
Chemistry

METLIN Retention-Time QSAR Prediction

Predict METLIN chromatographic retention times with QSAR models against observed values.

Chemistry

nmrshiftdb2 NMR Structure Elucidation

Elucidate molecular structures from nmrshiftdb2 NMR shifts using a multi-stage candidate funnel.

Chemistry

SAMPL6 First-Principles pKa Prediction

Predict SAMPL6 pKa values from first principles and correlate predictions against experimental benchmarks.

Run this kind of analysis on your own question

Try K-Dense Web free and see how an AI co-scientist accelerates your research.