How google-deepmind/ferminet works
Main Components
• Configurations & Input: Represent the configuration system (using ml_collections) that loads various config files (e.g., under ferminet/configs/ and excited configurations) which govern the physics settings (atoms, molecules, basis sets, etc.) and training hyperparameters.
• Core Modules & Network Architecture: Highlight the main FermiNet algorithm. This includes:
– The neural network implementation (ferminet/networks.py and ferminet/psiformer.py) responsible for calculating the wavefunction.
– Supporting blocks (network_blocks.py), envelopes, and pseudopotentials.
• Monte Carlo Engine: Mark the components handling variational Monte Carlo sampling (mcmc.py), which produces “walkers” (configurations) used during training and inference.
• Physics Computation Modules: Indicate the modules performing physics evaluations like computing the Hamiltonian (hamiltonian.py, ferminet/pbc/hamiltonian.py) and observables (observables.py), including modules for density calculation and Jastrow factors.
• Utility and Auxiliary Components: Include helper modules found under utils (e.g., system.py, gto.py, statistical tools, writing outputs) and the constant/initialization files (constants.py, base_config.py).
• Testing & Notebooks: Although they are not part of the runtime system, note that tests (in tests/ directories) and notebooks (in ferminet/notebooks) serve as important artifacts for development and analysis.
Relationships and Interactions
• Model Training: Show the training process where the network architecture receives parameters and data (MCMC walkers) to iteratively update the wavefunction.
• Auxiliary Data: Highlight how external libraries (such as JAX for computation, ml_collections for configuration, and PySCF for molecular input) integrate into the workflow.
Architectural Patterns and Design Principles
• Configurability: Emphasize the flexible configuration system (using ml_collections) which leads to easy experimentation with different atomic/molecular systems.
• Extensibility & Testing: Indicate that additional configs (especially under excited states) and tests are included, enabling rapid experimentation and thorough verification.
• Integration with JAX: Mark the use of JAX (with pmap for multi-GPU support) as a key element supporting parallel computation and efficient hardware utilization.
Mention Relevant Technologies, Frameworks, and Libraries
• JAX (including jaxlib): For high-performance neural network training with automatic differentiation and GPU support.
• ml_collections: For managing hierarchical configuration.
• PySCF: For constructing molecular systems (used optionally for inference).
• NumPy: For handling large arrays in output and checkpoint data.
• Additional tools: pytest for testing and GitHub Actions (per the .github/workflows directory) for CI.