How an adaptive wavelet representation becomes a validated active-space Hamiltonian, with a fair N₂ benchmark, VQE, QSCI, and SQD.
Most quantum-chemistry workflows begin with atom-centered Gaussian orbitals. BigDFT offers a different starting point: compactly supported Daubechies wavelets on an adaptive real-space grid. This article follows that representation all the way from molecular orbitals to a qubit Hamiltonian and asks whether the resulting N₂ bond curve can be compared fairly with a conventional Gaussian-basis calculation.
N₂ is a useful test case because it is small enough for exact active-space checks but demanding enough to expose basis resolution, frozen-core conventions, bond breaking, and solver error. The workflow extracts one- and two-electron integrals from wavelet orbitals, validates every representation boundary, and connects the same Hamiltonian to full configuration interaction (FCI), variational quantum eigensolver (VQE), quantum-selected configuration interaction (QSCI), and sample-based quantum diagonalization (SQD).
The final workflow is compact enough to state in one line:
The complete implementation, datasets, analysis scripts, tests, and machine-readable results live in the agent/wavelet-qc-macos-revival branch of the GitHub codebase. Readers who want implementation or environment details should follow the README and documentation there.
The motivation is not that wavelets are automatically “better” than Gaussian orbitals. It is more specific.
Quantum chemistry must make two truncations. First, a classical electronic-structure calculation represents continuous orbitals in a finite numerical basis. Second, a quantum algorithm keeps a finite set of spatial orbitals, usually turning $m$ spatial orbitals into $2m$ spin-orbital qubits. A representation that gives controlled real-space accuracy while keeping the chemically useful orbital space compact could therefore help both sides of the pipeline.
BigDFT is attractive because it uses compactly supported Daubechies wavelets on an adaptive grid rather than a fixed list of atom-centered Gaussian functions
The standard is therefore stronger than obtaining a plausible energy: the calculation needs a complete potential-energy curve, a properly matched reference, and independent checks at every representation boundary.
A molecular orbital is still an expansion,
but the basis functions $\Phi_\alpha$ now live on a real-space grid. Scaling functions describe the smooth part of an orbital; wavelets add localized detail. Both have compact support, so a basis function is exactly zero outside a finite interval.
The three-dimensional basis is made from tensor products. At a coarse grid point there is one $\phi\phi\phi$ scaling function. In the fine region, the seven other $\phi/\psi$ combinations add detail. This is why the coefficient count in our cost analysis is naturally written as
The useful mental model is a microscope: retain a broad, inexpensive description of the vacuum and smooth orbital tails, then add resolution near the atoms where the functions vary rapidly.
Wavelets do not remove convergence choices. They make those choices geometric and systematic:
hgrid is the real-space spacing. Smaller values resolve shorter-length-scale features and cost more.crmult controls the radius of the coarse region around each atom.frmult controls the smaller fine-resolution region near each nucleus.
This is an important correction to the loose phrase “basis-set free.” There is no cc-pVDZ-style catalog to choose, but there is still a finite basis. Its error is controlled by grid spacing and spatial support.
Once BigDFT has converged the occupied and requested virtual orbitals, the downstream problem is familiar. For orthonormal orbitals, the electronic Hamiltonian is
The custom BigDFT postprocessor writes symmetry-unique hpq and hpqrs records. The maintained Python loader restores the matrix, electron-repulsion, and spin symmetries, reduces the problem to a chosen active space, and maps the fermionic operators to Pauli strings with Jordan–Wigner.
The expensive object is
Rather than introduce unrelated quadrature machinery, the extractor reuses BigDFT’s real-space Poisson solver. For each orbital pair it forms $\rho_{pq}(\mathbf r)=\phi_p(\mathbf r)\phi_q(\mathbf r)$, solves
and evaluates $\int \rho_{rs}(\mathbf r)V_{pq}(\mathbf r)d\mathbf r$. This is the central bridge from the wavelet representation to an ordinary second-quantized chemistry Hamiltonian.
A plausible energy is not enough. The rebuilt pipeline checks each handoff independently:
Only after those checks do I interpret the molecular curve.
The most subtle part of the benchmark is not fitting the curve. It is deciding what can be compared.
The BigDFT calculation uses an HGH-K/PBE pseudopotential and explicitly represents ten valence electrons. A normal all-electron N₂ calculation represents fourteen electrons. Comparing the two absolute totals—roughly $-20$ Ha and $-109$ Ha—would mostly compare different core conventions and energy zeros.
I therefore used two PySCF references:
gth-dzvp calculation with ten explicit electrons.Freezing the core does not make the absolute all-electron energy equal to a pseudopotential energy. It makes the correlated valence problem comparable. Each potential curve is then shifted to its own minimum,
so the comparison uses quantities that survive a change of energy zero: equilibrium distance, local curvature, harmonic frequency, and nearby curve shape.
| Method | Electrons represented | Correlated space | $r_e$ (Å) | $\omega_e$ (cm⁻¹) |
|---|---|---|---|---|
| BigDFT wavelet / HGH-PBE | 10 valence | CAS(10e,10o) | 1.0875 | 2548.5 |
| PySCF GTH-PBE / gth-dzvp | 10 valence | CAS(10e,10o) | 1.1066 | 2452.5 |
| PySCF all-electron / cc-pVDZ | 14 total; 4 frozen core | CAS(10e,10o) | 1.1050 | 2358.5 |
| Experiment | — | — | 1.0977 | 2358.6 |
The wavelet equilibrium distance is 0.0102 Å shorter than experiment, an error of about 0.93%. The fitted frequency is about 8% high. The bond length is the stronger result: the available scan is spaced by 0.2 Å near equilibrium and retains only five virtual orbitals, while a second derivative is especially sensitive to both choices. A denser near-minimum scan is the clearest scientific next step.
The all-electron frozen-core frequency happens to match experiment closely, but this small benchmark does not support a general accuracy ranking. The important result is that the wavelet curve has a physically sensible minimum and can be compared without subtracting incompatible absolute energies.
The parameter scan is useful because it exposes both convergence and computational price.
Decreasing hgrid from 0.45 to 0.20 bohr changes the BigDFT energy from $-19.905076$ to $-19.910426$ Ha and the fixed CAS(10e,10o) energy from $-19.568101$ to $-19.572608$ Ha. The hgrid=0.35 CAS result is already within 1.6 mHa of the finest tested point.
frmult=6,7,8 is essentially flat here. Increasing crmult converges the Kohn–Sham energy, but the fixed-size CAS energy is not monotonic. That is not a violation of the variational principle: changing the box can change which diffuse virtual orbitals occupy the five retained virtual slots, so it is not the same subspace at every point.
Across the parameter scan, the extractor grows from about 57 seconds and 0.5 GB RSS at hgrid=0.45 to about 406 seconds and 2.9 GB at hgrid=0.20. Three complete curves at hgrid=0.35, 0.25, and 0.20 give fitted bond lengths of 1.0876, 1.0875, and 1.0873 Å. That stability is reassuring even though the absolute frequency remains resolution- and sampling-sensitive. These timings describe the recorded benchmark environment rather than a universal performance model.
The next question is what happens after the wavelet Hamiltonian reaches a sample-based eigensolver.
QSCI samples a quantum state in the occupation-number basis, retains the important Slater determinants, and diagonalizes the Hamiltonian in that selected classical subspace
For a controlled software test, I used the real wavelet CAS(6e,6o) Hamiltonian: 12 Jordan–Wigner qubits but only
determinants in the fixed $(N_\alpha,N_\beta)=(3,3)$ sector. Samples were drawn from the squared coefficients of the exact PySCF FCI vector.
| Oracle shots | Unique determinants sampled | QSCI error (mHa) | SQD error (mHa) |
|---|---|---|---|
| 5,000 | 25 | 5.561 | 5.561 |
| 20,000 | 36 | 5.558 | 5.558 |
| 100,000 | 40 | 1.536 | 1.536 |
| 500,000 | 43 | 0.184 | 0.184 |
The convergence has a simple interpretation: rare but energetically important determinants appear as sample coverage grows. QSCI and SQD agree exactly here because every sample already has the correct particle number and both routes diagonalize the same set of unique configurations. Recovery has nothing extra to repair in this clean experiment.
A separate QURI-QSCI diagnostic did not converge: its energy stayed 3.979 Ha from the CASCI reference and did not respond to the requested subspace size. It is recorded in the codebase as a negative diagnostic rather than presented as a successful result.
The codebase also contains data from a 109Asp calculation with 132 spatial orbitals. That is exactly where scientific restraint matters.
For real orbitals, the number of symmetry-unique two-electron records is
At $n=132$, this is 38,531,031 records. The complete text export is 1.387 GB and is not vendored. A separate file stops at 100,000 records—only 0.26%—and comes from a different run, so the two cannot be concatenated. Expanding the 132 spatial orbitals into a dense 264-spin-orbital float64 tensor would require about 38.9 GB before solver intermediates.
The current workflow therefore records provenance and resource estimates only. It does not invent a 109Asp molecular energy from a truncated tensor. Sparse/out-of-core integrals, density fitting, localization, embedding, or a different active-space strategy are required before that system becomes a real downstream calculation.
What I am comfortable claiming:
What I am not claiming:
The central lesson is that a useful end-to-end demonstration depends as much on matched comparisons and explicit limitations as it does on the solver result.
Implementation and installation details are intentionally kept in the repository rather than duplicated in this article. The codebase includes a locked Python environment, numbered analysis scripts, tests, source JSON, generated figures, and detailed method notes. Start with the agent/wavelet-qc-macos-revival branch. Within that codebase, the main entry points are:
README.md for the overview and result table;INSTALL.md for the environment and installation guide;docs/METHODOLOGY.md for the comparison protocol;RESULTS.md for numerical results and limitations;docs/SQD_QSCI.md for the sample-based solver workflow;docs/PROVENANCE.md for data and contributor provenance.The compact analyses start from committed integral fixtures, so readers can reproduce the figures and solver checks without first generating a new wavelet calculation. Read the repository documentation for implementation boundaries, data provenance, and contributor attribution.