# haivuvanwork-lab/neuralxc architecture

> Architecture diagram of the GitHub repository haivuvanwork-lab/neuralxc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/haivuvanwork-lab/neuralxc
- Repository: https://github.com/haivuvanwork-lab/neuralxc

## Overview

ML-XC is a notebook-driven QM9 research pipeline: it prepares molecular systems, computes PBE densities and CCSD(T) reference labels, trains a density-based XC correction, then benchmarks it. The README documents this sequence and the dataset formats; utility modules provide data handling, electronic-structure calculations, and model/training functionality. Edges reflect documented workflow relationships; notebook internals were not sampled, so their specific calls and artifact wiring are not inferred.

Main entry points: [`utils/data_utils.py`](https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/data_utils.py) (Density-label dataset), [`notebooks/02_filter_prepare.ipynb`](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/02_filter_prepare.ipynb) (Filter and split), [`notebooks/03_run_dft_pbe.ipynb`](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/03_run_dft_pbe.ipynb) (PBE density), [`notebooks/04_run_ccsdt.ipynb`](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/04_run_ccsdt.ipynb) (CCSD(T) labels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["QM9 preparation"]
  node_download["Download QM9"]
  node_prepare["Filter and split"]
end

subgraph group_compute["Reference calculations"]
  node_pbe["PBE density"]
  node_ccsdt["CCSD&#40;T&#41; labels<br/>[04_run_ccsdt.ipynb]"]
  node_dataset[("Density-label dataset<br/>[data_utils.py]")]
end

subgraph group_learning["ML-XC modeling"]
  node_train["Train ML-XC"]
  node_benchmark["Benchmark methods<br/>[06_benchmark.ipynb]"]
end

subgraph group_support["Runtime utilities"]
  node_model["XC model and training<br/>[model_utils.py]"]
  node_metrics["Atomization metrics<br/>[data_utils.py]"]
  node_dftutil["DFT and CC utilities<br/>[dft_utils.py]"]
end

node_researcher(("Researcher"))
node_qm9[("QM9 dataset")]

node_researcher -->|"runs pipeline"| node_download
node_qm9 -->|"provides molecules"| node_download
node_download -->|"passes candidates"| node_prepare
node_prepare -->|"supplies systems"| node_pbe
node_prepare -->|"supplies systems"| node_ccsdt
node_pbe -->|"provides densities"| node_dataset
node_ccsdt -->|"provides labels"| node_dataset
node_dataset -->|"provides training data"| node_train
node_train -->|"trains model"| node_model
node_dataset -->|"provides test data"| node_benchmark
node_model -->|"provides correction"| node_benchmark
node_benchmark -->|"computes errors"| node_metrics
node_pbe -.->|"uses DFT routines"| node_dftutil
node_ccsdt -.->|"uses CC routines"| node_dftutil

click node_download "https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/01_download_qm9.ipynb"
click node_prepare "https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/02_filter_prepare.ipynb"
click node_pbe "https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/03_run_dft_pbe.ipynb"
click node_ccsdt "https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/04_run_ccsdt.ipynb"
click node_dataset "https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/data_utils.py"
click node_train "https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/05_train_ml_xc.ipynb"
click node_model "https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/model_utils.py"
click node_benchmark "https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/06_benchmark.ipynb"
click node_metrics "https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/data_utils.py"
click node_dftutil "https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/dft_utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_download,node_prepare toneBlue
class node_pbe,node_ccsdt,node_dataset,node_qm9 toneAmber
class node_train,node_benchmark toneMint
class node_model,node_metrics,node_dftutil toneRose
class node_researcher toneIndigo
```

## Components

### QM9 preparation

- [Download QM9](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/01_download_qm9.ipynb): `notebooks/01_download_qm9.ipynb`
- [Filter and split](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/02_filter_prepare.ipynb): `notebooks/02_filter_prepare.ipynb`

### Reference calculations

- [PBE density](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/03_run_dft_pbe.ipynb): `notebooks/03_run_dft_pbe.ipynb`
- [CCSD(T) labels](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/04_run_ccsdt.ipynb): `notebooks/04_run_ccsdt.ipynb`
- [Density-label dataset](https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/data_utils.py): `utils/data_utils.py`

### ML-XC modeling

- [Train ML-XC](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/05_train_ml_xc.ipynb): `notebooks/05_train_ml_xc.ipynb`
- [Benchmark methods](https://github.com/haivuvanwork-lab/neuralxc/blob/main/notebooks/06_benchmark.ipynb): `notebooks/06_benchmark.ipynb`

### Runtime utilities

- [XC model and training](https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/model_utils.py): `utils/model_utils.py`
- [Atomization metrics](https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/data_utils.py): `utils/data_utils.py`
- [DFT and CC utilities](https://github.com/haivuvanwork-lab/neuralxc/blob/main/utils/dft_utils.py): `utils/dft_utils.py`

### Other components

- **Researcher**
- **QM9 dataset**

## Connections

- Researcher → Download QM9: runs pipeline (evidence: `README.md`)
- QM9 dataset → Download QM9: provides molecules (evidence: `README.md`)
- Download QM9 → Filter and split: passes candidates (evidence: `README.md`)
- Filter and split → PBE density: supplies systems (evidence: `README.md`)
- Filter and split → CCSD(T) labels: supplies systems (evidence: `README.md`)
- PBE density → Density-label dataset: provides densities (evidence: `README.md`)
- CCSD(T) labels → Density-label dataset: provides labels (evidence: `README.md`)
- Density-label dataset → Train ML-XC: provides training data (evidence: `README.md`)
- Train ML-XC → XC model and training: trains model (evidence: `README.md`)
- Density-label dataset → Benchmark methods: provides test data (evidence: `README.md`)
- XC model and training → Benchmark methods: provides correction (evidence: `README.md`)
- Benchmark methods → Atomization metrics: computes errors (evidence: `README.md`)
- PBE density → DFT and CC utilities: uses DFT routines
- CCSD(T) labels → DFT and CC utilities: uses CC routines
