|
Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
|
Q3 is a modern, from-scratch plane-wave density functional theory (DFT) code written in C++17. It solves the Kohn–Sham equations self-consistently to compute the ground-state electronic structure of periodic crystalline systems — the same fundamental problem addressed by established, widely used plane-wave DFT codes.
In ~55,000 lines of header-heavy C++ (plus ~27,000 lines of tests — exact, auto-generated figures in STATISTICS.md), Q3 implements the core plane-wave pseudopotential DFT pipeline: crystal structure setup, pseudopotential parsing, plane-wave basis generation, Hamiltonian construction, self-consistent field iteration, and post-SCF forces and stress — with norm-conserving (NC), ultrasoft (US) and projector augmented-wave (PAW) pseudopotentials wired end-to-end, MPI k-point pool + band parallelism, and GPU backends for NVIDIA (CUDA), Apple Silicon (Metal), AMD (HIP), and Intel (SYCL). PAW reads UPF v2 datasets, and further input, dataset and output formats plug in as build-time add-ons that core never names.
Q3 is developed as part of the Mat3ra ecosystem and targets interoperability with the ESSE (Exabyte Source of Schemas and Examples) data standard for structured input and output.
The landscape of plane-wave DFT codes is dominated by a handful of mature projects:
These are mature, battle-tested, and widely used, and Q3's own validation rests on one of them, Quantum ESPRESSO. They are largely written in Fortran 90/2003 and were designed as standalone applications, before AI coding agents and today's data platforms existed.
Q3 exists because the materials simulation field needs a clean, modern, extensible quantum simulation engine that can serve as the computational core of a larger platform — not as a standalone monolithic application.
Q3 is written from scratch in C++17. Every design decision reflects modern software engineering:
number_of_plane_waves not npw, pseudopotential_set not ppset. The codebase is self-documenting.std::unique_ptr, std::vector, move semantics throughout.For comparison: a mature Fortran plane-wave code's core solver alone is ~150,000 lines across ~300 files, the accumulation of decades of capability. Q3 achieves validated core SCF + forces + stress functionality — plus MPI and four GPU backends — in ~55,000 lines with clear module boundaries.
Q3's input and output are designed around ESSE:
scripts/repo/generate_cpp_from_schemas.py) produces C++ types under src/generated/ from ESSE and Q3 JSON schemas.Full schema validation and complete ESSE property coverage are still in progress. See FUNCTIONALITY.md §3.1 for the current I/O inventory.
Q3 writes structured data from the start, so downstream tools read results rather than parse text output.
Q3 is not a toy implementation. Automated validation tests compare Q3 directly against an established plane-wave DFT code (LibXC-enabled build) on identical inputs for NC and US pseudopotentials:
This level of numerical agreement demonstrates that Q3's physics is correct at the same level of theory as established codes. PAW is validated against QE (UPF datasets, ~1 mRy/atom).
Q3 supports norm-conserving and ultrasoft pseudopotentials within a single inheritance-based design:
In Q3, NC and US are integrated from the start with parallel class hierarchies (basis, quantum system, SCF iterator, forces, stress).
Q3's codebase is developed with AI coding agents as first-class contributors. The naming conventions, documentation standards, and architectural patterns are specifically chosen to be unambiguous to both human and AI readers:
The entire Q3 source tree is ~55,000 lines of C++ in ~321 header files plus 28 translation units (entry points and GPU backends) — small enough for a single developer (or AI agent) to understand in its entirety. For context:
| Code | Language | Lines (core solver) | Lines (total) |
|---|---|---|---|
| Q3 | C++17 | ~55,000 | ~83,000 |
| Reference PW DFT | Fortran | ~150,000 | ~500,000+ |
| ABINIT | Fortran | ~100,000 | ~800,000+ |
| GPAW | Python/C | ~50,000 | ~100,000+ |
This compactness reflects a focused scope: ground-state SCF, forces, stress, band structure, DOS, and geometry relaxation for NC/US/PAW — not the full feature surface of codes developed over three decades. Advanced functionals (meta-GGA, hybrids) are on the roadmap, not yet shipped.
All FetchContent dependencies (LibXC, spglib, spdlog, yaml-cpp, nlohmann_json, GoogleTest) are resolved automatically at configure time. FFTW3 and LAPACK must be installed on the system; LibXC is used from the system when it is from a tested series (5.2 or 7.0), otherwise 7.0.0 is built from source.
Q3 is in active development. The core SCF engine is production-quality for semiconductors and metals with NC, US and PAW pseudopotentials. Forces, stress, band structure, DOS, geometry relaxation, JSON results, and binary checkpoints are validated against reference implementations on silicon and copper examples. MPI k-point pool + band parallelism and the CUDA/Metal GPU backends are validated on a single node. Spin polarization is cross-code validated for norm-conserving and ultrasoft pseudopotentials — NC on ferromagnetic Fe/Ni and antiferromagnetic Cr, ultrasoft against QE. All five smearing schemes are cross-code validated; HIP/SYCL backends await hardware validation. DFT+U runs for all three families and reproduces QE's total energy to 4.5e-7 Ry when handed QE's own input file.
For the authoritative breakdown, see: