How n-gao/neural-pfaffian works
Project Type and Purpose
• This is a scientific computing and machine learning project for quantum chemistry applications. Its purpose is to provide various neural network architectures (like FermiNet, PsiFormer, and Moon) to model electron wave functions accurately.
• The README emphasizes different calculation types (single structure, PES surfaces, etc.) that set off different configurations.
Main Components
a. Command Interfaces:
• The main entry point is through the “neural_pfaffian” command (executed via the __main__.py entrypoint in src/neural_pfaffian). Illustrate how command-line arguments (configuration files) trigger the execution.
b. Configuration and Modular System:
• Configuration hierarchy split into “configs/models”, “configs/systems”, and “configs/seml”. These files dictate which model (e.g., psiformer, pesnet, ferminet) and experiment setup (e.g., single or PES-based calculations) are run.
• Mention the modular design that allows the user to swap configurations freely, tailoring the wave functions and system properties.
c. Core Computational Modules:
• Data handling (src/neural_pfaffian/data) with datasets like “deeperwin” for geometries and other quantum properties.
• Model and neural network definitions (under src/neural_pfaffian/nn). Include components such as antisymmetrizers (pfaffian.py, slater.py), embedding modules (for each of FermiNet, PsiFormer, Moon) and other network utilities.
• Physics-related routines such as the Hamiltonian, MCMC sampling (mcmc.py), variational Monte Carlo (vmc.py), and preconditioning.
• Utility modules (logger, linear algebra, optimization, etc.) that support the core calculations.
d. Execution and Experiment Management:
e. Testing and CI/CD:
• Automated workflows located in .github/workflows (pre-commit and test pipelines). Also include test directories that verify the functionality of different computational modules.
Relationships and Data Flow
• That through the command-line interface, the application dispatches work to:
• Data loading -> Neural network computations (embedding, antisymmetrizer) -> Physical solvers (Hamiltonian, MCMC, VMC) -> Output/logging.
• That the experimental manager (“seml”) coordinates the overall experiment life-cycle, interfacing with the core pipeline.
Architectural Patterns and Relevant Technologies
• A modular architecture that separates configuration, data handling, model building, and physical simulations.
• That the project also includes continuous integration and adherence to a configuration-driven design (YAML files in config and pyproject.toml indicate structured dependency management).
• Design principles such as separation-of-concerns (e.g., neural network models vs. physical simulations), flexibility via configuration, and an extensible testing framework.