← The C17 & WL15 Library
Library Standard · Wavefunction Interchange Across ℒchem

QTAIM-WFX-3.0 & Wide-WFN Wavefunction Standard

Standard .wfn and .wfx files were designed for single-reference clamped-nucleus Born–Oppenheimer molecules (ℒBO) of modest size: fixed I3/I5 Fortran columns in .wfn overflow past 999 nuclei or 99,999 primitives, third-party codes disagree on high-angular-momentum shell orderings, and neither format carries state-averaged multireference 1-/2-RDMs, Z-vector relaxed response densities, four-component Dirac quaternion spinors, external electromagnetic fields, quantum nuclei, pseudopotential core reconstructions, or periodic Brillouin-zone Bloch states. Here we specify Wide-WFN, QTAIM-WFX-3.0, and the direct in-memory C-ABI wavefunction constructors (qtaim_wfn_create_raw_prims, qtaim_wfn_set_active_2rdm) linked across DIRAC, Dalton, OpenMolcas, PySCF, and CP2K.

Under audit (4 December 2026).An internal audit by an AI agent reports the problems below on this page. They are not yet corrected or independently confirmed. Please do not rely on these statements meanwhile.

1. Classic .wfn and Arbitrary-Width Free-Form Wide-WFN

qtaim_wfn_load_file autodetects and parses three ASCII wavefunction families without external libraries:

2. Canonical Keith 1..84 Primitive Types (s…i), Native Spherical Shells, & CSprimC†=I Guard

In .wfn, Wide-WFN, and .wfx files, unnormalized Cartesian primitives χp(𝐫)=(x−XA)ℓx(y−YA)ℓy(z−ZA)ℓzexp(−αp|𝐫−𝐑A|2) absorb primitive normalization factors directly into <Molecular Orbital Primitive Coefficients>. Notice the critical convention change at ℓ=5 (h shells): types 1..35 (s,p,d,f,g) place pure axial powers (ℓ,0,0),(0,ℓ,0),(0,0,ℓ) first, whereas Todd Keith's AIMAll specification switches at h = 36..56 to reverse-lexicographic order:

Canonical Keith <Primitive Types> bijection (1..84) enforced in CONVENTIONS.md, libqtaim, QTAIM.wl, and DIRAC
Shell ℓ Count Type IDs Canonical (ℓx, ℓy, ℓz) ordering rule
s 0 1 1 (0,0,0)
p 1 3 2..4 (1,0,0), (0,1,0), (0,0,1)
d 2 6 5..10 Axis-first: (2,0,0), (0,2,0), (0,0,2), (1,1,0), (1,0,1), (0,1,1)
f 3 10 11..20 Axis-first: (3,0,0), (0,3,0), (0,0,3), (2,1,0), (2,0,1), (0,2,1), (1,2,0), (1,0,2), (0,1,2), (1,1,1)
g 4 15 21..35 Axis-first: (4,0,0)..(0,0,4), (3,1,0)..(0,1,3), (2,2,0)..(0,2,2), (2,1,1), (1,2,1), (1,1,2)
h 5 21 36..56 Reverse-lex switch: ℓx = 0..5, ℓy = 0..(5−ℓx), ℓz = 5−ℓx−ℓy, i.e. (0,0,5), (0,1,4), …, (5,0,0)
i 6 28 57..84 Reverse-lex continuation: ℓx = 0..6, ℓy = 0..(6−ℓx), ℓz = 6−ℓx−ℓy, i.e. (0,0,6), (0,1,5), …, (6,0,0)
ℓ ≥ 7 ≥ 7 (ℓ+1)(ℓ+2)/2 > 84 Explicit <Primitive Exponents Lx Ly Lz> 3×Nprim integer block

When a quantum-chemistry calculation uses contracted Spherical Harmonics (5d, 7f, 9g, 11h, 13i), QTAIM-WFX-3.0 preserves the exact contracted spherical basis in <Native Spherical Shells> alongside the unfolded Cartesian primitive representation. Upon loading any .wfn or .wfx file, qtaim_wfn_load_file evaluates the analytic primitive overlap matrix Sprim and verifies orbital orthonormality εovlp=maxp,q|(CSprimC†)pq−δpq|; if a third-party exporter wrote lexicographic Cartesian d/f coefficients against Keith type labels (εovlp>10−6), the loader tests known third-party shell permutations and repairs the coefficient ordering automatically when εovlp<10−8.

3. Multireference KS/KR-SA-GASSCF(8), Z-Vector Relaxed RDMs, & Transition Couplings

Single-determinant natural occupations cannot represent state-averaged generalized-active-space wavefunctions, conical intersections, or analytic orbital-response properties. Both libqtaim and DIRAC's pga_wfx_export.F90 therefore emit and consume:

4. Relativistic 4c/X2C Quaternion Spinors, External 𝐄/𝐁/𝐀 Fields, & Non-BO Species

4c Dirac & X2C Quaternion Blocks

<Relativistic Hamiltonian> (4C_DC, 4C_DCB, 4C_DCG, X2C, c_au), Visscher–Dyall Gaussian nuclear charge exponents, separate small-component kinetic-balance primitives, and real four-component quaternion spinor coefficients (Q0, Q1, Q2, Q3) + <KRDM Block> / <KTDM Block> / <K2RDM Block> with zero complex numbers.

Electromagnetic & Cavity Fields

<External Electromagnetic Fields> records static 𝐄0, magnetic induction 𝐁0, London GIAO phase / gauge origin 𝐑G, laser pulse carrier/CEP/envelope parameters, excluded Aharonov–Bohm flux-line axes and Φ/Φ0, and quantized cavity modes (ωcav,𝛌cav).

Non-BO Rovibronic Quantum Matter

<Non-BO Quantum Species> stores per-species masses Ma/me, charges Za, spins Ia, boson/fermion statistics, nuclear basis primitives, intraspecies 1-RDMs Γa, and electron–nuclear correlation 2-RDMs Γea for rovibronic HD, H₂, and muonic molecules.

5. <EDF>/ECP/PAW/Muffin-Tin Core Restoration & 14-Bravais Monkhorst–Pack Solids

Heavy-element pseudopotentials omit inner-shell orbitals and would otherwise create hollow valence density minima instead of (3,−3) nuclear attractors. QTAIM-WFX-3.0 supports both AIMAll's <Number of EDF Primitives> / <EDF Primitive Centers, Types, Exponents, Coefficients> Gaussian core electron density functions (evaluated directly inside libqtaim's density, gradient, Hessian, and Maxwell-field kernels) and <Pseudopotential and Core Reconstruction> blocks for semilocal ECPs, PAW_AUGMENTATION radial projectors, and all-electron MUFFIN_TIN_SPHERE grids.

Finally, <Periodic Lattice and Reciprocal Grid> extends QTAIM and 3D Ewald-regularized IQA across polymers (d=1), surfaces/interfaces (d=2), and bulk crystals (d=3) across all 14 Bravais lattices (cP, cI, cF, hP, hR, tP, tI, oP, oC, oI, oF, mP, mC, aP) and 230 space groups, storing primitive lattice vectors 𝐚1,𝐚2,𝐚3, Monkhorst–Pack meshes and irreducible 𝐤-weights, Bloch crystal-orbital coefficients or plane-wave reciprocal 𝐆-vectors, and Ewald splitting parameters ηEwald.

References

Provenance tags indicate whether the primary text ([read]) or bibliographic record ([record]) was checked directly during preparation.

Comments, questions or contributions? Please open an issue or a pull request on GitHub.