This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · lib/qcfuzz

Two ways of computing the same integral, raced on random molecules

A contract is a claim about what a stage of a calculation must produce, not about how. lib/gto computes two-electron integrals from the closed form for s-type Gaussians; lib/gto_md expands the same product in Hermite Gaussians and sums against Boys functions. They share no arithmetic. On any molecule made of s functions they must agree to the last few bits, and if they ever do not, one of them is wrong and the disagreement says which molecule to look at.

The method is meant to be used at every stage. Every stage gets a contract, then more than one implementation of it, then random inputs to argue over. An implementation may be as clever as it likes so long as it still satisfies the contract; the fastest one that does is the one that ships. PySCF settles the real molecules; the fuzzer settles the ones nobody thought to write down.

The geometries here are random and deliberately awkward — atoms placed close enough to overlap strongly but never on top of each other, because two basis functions at the same point make the overlap matrix singular and that is a different bug than the one being looked for.

Used with import qcfuzz.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 27–245