Six stations
The Spectrum Atlas has a new page: the pipeline show. It follows one molecule from its name to its predicted infrared spectrum, step by step, and ends with a certificate that says how far the prediction can be trusted. This post explains what you see on that page and why each step is there.
What the page shows
The page has three columns. On the left you pick a molecule, sorted by its number of carbon atoms. In the middle the pipeline is drawn as a metro line with six stations, and the stations light up as the molecule passes through them. On the right the spectrum appears, with the certificate under it.
Every number on the page is read from the files of a real run. The page itself contains no numbers that someone typed in. If a run had gone wrong, the page would show the wrong result, not a nicer one.
Molecule pages in the Atlas now link to the show. Where the Atlas lists a molecule that went through the pipeline, its page has a card “Through the pipeline” that opens the show at that molecule. Phenanthrene is one example.
The six stations
1. Molecule. The input is a short line of text that describes the molecule, a SMILES string. The pipeline first checks whether the molecule is one it may answer for: neutral, with paired electrons, and made only of elements the network has seen in training. That check happens before any computation, so a molecule outside the network’s range costs nothing.
2. Start geometry. A free chemistry library, RDKit, turns the text into a first three-dimensional shape.
3. Optimisation. A quantum chemistry program, psi4, moves the atoms until the forces on them vanish. This gives the molecule’s resting shape, its equilibrium geometry, with the cheap method B3LYP.
4. Hessian. A second program, PySCF, computes how stiff the molecule is in every direction, the Hessian, and how much each vibration changes the molecule’s charge distribution. The stiffness decides where the bands of the spectrum lie. The charge change decides how strong each band is.
5. The network. Here the project’s own part comes in. The neural network predicts a correction to the cheap stiffness. Three copies of the network, trained from different random starts (seeds), each give their correction, and the pipeline adds their average to the B3LYP Hessian. Where the three copies disagree, the certificate shows the spread.
6. Spectrum and certificate. From the corrected stiffness the pipeline computes the positions of the bands, and from step 4 their heights. Then it writes the certificate: for every band, which family of vibrations it belongs to, how large the network’s error was on molecules it never saw, and whether that family is licensed.
What the network corrects towards
The network does not yet correct towards the expensive reference this project is about, coupled cluster. For now it corrects B3LYP towards ωB97X, a more careful DFT method that we can afford to compute for hundreds of molecules. ωB97X plays the role of the better method, a proxy, so that we can test whether the whole machine works before we pay for the real reference.
That choice also gives every molecule in the show a known right answer, because the corpus holds an ωB97X calculation for each of them. So the certificate can put the network’s spectrum next to the right answer and give the difference.
How close it comes
The show holds 38 molecules. None of them was used to train the network. They fall into three groups.
Eight molecules belong to the first hold-out set, hold-out (a): the molecules we set aside before training to measure the error. They have 12 to 26 atoms. Their band positions are on average 1.64 wavenumbers from the ωB97X answer (the median over the eight), and 3.22 in the worst case.
Four belong to the second hold-out set, hold-out (b), with 23 to 28 atoms. Their median is 2.39 wavenumbers, their worst 2.73.
The other 26 are in the catalogue but were never part of training or of either hold-out set. Their median is 1.48 wavenumbers, their worst 4.60, for a naphthalene with two nitro groups.
To give a sense of scale: for phenanthrene, B3LYP alone is 23.5 wavenumbers from ωB97X on average. With the network’s correction the distance is 1.2.
Thirty-four of the 38 molecules come within 3 wavenumbers on average. That average includes the bands the certificate does not license. The licence works per family of vibrations, not per molecule. A family is licensed where the network’s measured error is at most 3 wavenumbers on both hold-out sets. Three families pass: the ring vibrations in the plane, the C–H stretches and the C–H bends out of the plane. The fourth family, “other”, holds the vibrations that fit none of the three, most of them slow motions of the whole skeleton at the low end of the spectrum. It misses the line with 3.62 and 3.89. So the certificate marks those bands “not licensed”, even where they happen to be right.
Three things the pipeline taught us
Running whole molecules through the chain found three faults that tests on single parts had missed.
The order of the atoms mattered. The same molecule can be written as several different SMILES strings, and each writing numbers the atoms differently. B3LYP does not care: its bands moved by less than a billionth of a wavenumber. The network did care. For phenanthrene another writing moved single corrected bands by up to 2.9 wavenumbers. Until we find the cause, the pipeline always starts from one fixed writing, the canonical SMILES, so the same molecule always gets the same answer.
Two of our test molecules had been seen. The certificate now also says whether the network trained on the molecule. That check found that two of the ten molecules in hold-out (a) were in the training set under another name. So part of hold-out (a)’s error had been measured on molecules the network knew. Those two are now out of the training for the next version, and the show uses only the eight clean ones. Hold-out (b) was clean: none of its 39 molecules had been seen.
A flat molecule sits on a seam. In a flat molecule many angles lie at exactly half a turn, where the number jumps from plus to minus. A tiny change in the shape can flip such an angle to the other side, and the network then sees a different input. We measured how much this costs: at most 0.12 wavenumbers on the average error of hold-out (a). So it is a reproducibility flaw, not a large error.
What is not in the show yet
The 38 runs in the show did not compute steps 3 and 4 on the laptop. The corpus had already done exactly those calculations at the same settings, so the pipeline takes them from there and says so on the station. That is why a run in the show takes less than three seconds. When the corpus computed steps 3 and 4, they took about an hour and a half for a typical molecule (the median) and three hours for the longest. A new molecule pays that time. A full run of phenanthrene on 30 October, with every step computed, took 76 minutes.
The page and the pipeline were written and tested with an AI assistant, like the rest of the project’s code.
The scripts, the runs and the records behind every number are in the project’s repository.