# deepmodeling/abacus-develop architecture

> Architecture diagram of the GitHub repository deepmodeling/abacus-develop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deepmodeling/abacus-develop
- Repository: https://github.com/deepmodeling/abacus-develop

## Overview

ABACUS is a DFT-based electronic-structure package supporting plane-wave and numerical atomic-orbital bases, pseudopotentials, geometry optimization, molecular dynamics, and advanced functionals and corrections. The principal workflow is to launch a calculation, interpret its atomic structure and settings, construct a basis, solve the electronic state, and produce results. The graph also captures documented capabilities and the Python and interoperability surfaces visible in the tree. The sampled runtime excerpts confirm the executable entry point and selected specialized components; several central solver links are based on the documented product workflow, not inspected implementation calls.

Main entry points: [`source/source_main`](https://github.com/deepmodeling/abacus-develop/tree/develop/source/source_main) (Calculation Driver), [`source`](https://github.com/deepmodeling/abacus-develop/tree/develop/source) (Electronic Solver), [`source/source_basis`](https://github.com/deepmodeling/abacus-develop/tree/develop/source/source_basis) (Basis Construction), [`source/source_main/main.cpp`](https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_main/main.cpp) (ABACUS Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Calculation Runtime"]
  node_entry["ABACUS Entry<br/>[main.cpp]"]
  node_driver["Calculation Driver"]
  node_structure["Structure And Inputs<br/>[read_stru.cpp]"]
  node_results["Calculation Results<br/>[output.cpp]"]
end

subgraph group_physics["Electronic Structure"]
  node_basis["Basis Construction"]
  node_pw["Plane-Wave Basis<br/>[pw_basis.cpp]"]
  node_nao["Atomic-Orbital Basis<br/>[orb_atomic.cpp]"]
  node_solver["Electronic Solver"]
  node_scf["SCF Iteration"]
end

subgraph group_capabilities["Simulation Capabilities"]
  node_geometry["Geometry Optimization"]
  node_molecular["Ab-Initio Dynamics"]
  node_functionals["DFT Functionals"]
  node_corrections["Advanced Corrections"]
  node_kedf["Orbital-Free KEDF<br/>[kedf_manager.cpp]"]
  node_timefield["Time-Dependent Fields"]
end

subgraph group_interfaces["Python And Interfaces"]
  node_pyapi["Python Bindings"]
  node_ase["ASE Interface<br/>[core.py]"]
  node_wannier["Wannier90 Interface<br/>[interface.py]"]
  node_postprocess["Plotting Tools<br/>[main.py]"]
  node_shengbte["ShengBTE Conversion"]
end

node_user(("Calculation User"))

node_user -->|"starts calculation"| node_entry
node_entry -->|"calls init"| node_driver
node_driver -->|"reads structure"| node_structure
node_driver -->|"prepares calculation"| node_basis
node_basis -->|"constructs"| node_pw
node_basis -->|"constructs"| node_nao
node_driver -->|"runs electronic solve"| node_solver
node_solver -->|"iterates state"| node_scf
node_driver -->|"writes results"| node_results
node_solver -->|"evaluates"| node_functionals
node_solver -->|"applies"| node_corrections
node_solver -.->|"uses when selected"| node_kedf
node_solver -.->|"uses for field runs"| node_timefield
node_driver -.->|"supports optimization"| node_geometry
node_driver -.->|"supports dynamics"| node_molecular
node_user -.->|"uses Python API"| node_pyapi
node_pyapi -->|"controls LCAO SCF"| node_scf
node_user -.->|"runs through ASE"| node_ase
node_user -.->|"uses interface"| node_wannier
node_user -.->|"converts data"| node_shengbte
node_results -.->|"plots results"| node_postprocess

click node_entry "https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_main/main.cpp"
click node_driver "https://github.com/deepmodeling/abacus-develop/tree/develop/source/source_main"
click node_structure "https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_cell/read_stru.cpp"
click node_basis "https://github.com/deepmodeling/abacus-develop/tree/develop/source/source_basis"
click node_pw "https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_basis/module_pw/pw_basis.cpp"
click node_nao "https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_basis/module_ao/orb_atomic.cpp"
click node_solver "https://github.com/deepmodeling/abacus-develop/tree/develop/source"
click node_scf "https://github.com/deepmodeling/abacus-develop/blob/develop/python/pyabacus/src/ModuleESolver/components/scf_controller_lcao.hpp"
click node_results "https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_base/output.cpp"
click node_geometry "https://github.com/deepmodeling/abacus-develop/tree/develop/source"
click node_molecular "https://github.com/deepmodeling/abacus-develop/tree/develop/source"
click node_functionals "https://github.com/deepmodeling/abacus-develop/tree/develop/source"
click node_corrections "https://github.com/deepmodeling/abacus-develop/tree/develop/source"
click node_kedf "https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_pw/module_ofdft/kedf_manager.cpp"
click node_timefield "https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_estate/module_pot/td_field_manager.cpp"
click node_pyapi "https://github.com/deepmodeling/abacus-develop/tree/develop/python/pyabacus/src/pyabacus"
click node_ase "https://github.com/deepmodeling/abacus-develop/blob/develop/interfaces/ASE_interface/abacuslite/core.py"
click node_wannier "https://github.com/deepmodeling/abacus-develop/blob/develop/interfaces/Wannier90_interface/abacusw90/interface.py"
click node_postprocess "https://github.com/deepmodeling/abacus-develop/blob/develop/tools/02_postprocessing/plot-tools/abacus_plot/main.py"
click node_shengbte "https://github.com/deepmodeling/abacus-develop/tree/develop/interfaces/ShengBTE_interface"

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_entry,node_driver,node_structure,node_results,node_user toneBlue
class node_basis,node_pw,node_nao,node_solver,node_scf toneAmber
class node_geometry,node_molecular,node_functionals,node_corrections,node_kedf,node_timefield toneMint
class node_pyapi,node_ase,node_wannier,node_postprocess,node_shengbte toneRose
```

## Components

### Calculation Runtime

- [ABACUS Entry](https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_main/main.cpp): `source/source_main/main.cpp`
- [Calculation Driver](https://github.com/deepmodeling/abacus-develop/tree/develop/source/source_main): `source/source_main`
- [Structure And Inputs](https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_cell/read_stru.cpp): `source/source_cell/read_stru.cpp`
- [Calculation Results](https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_base/output.cpp): `source/source_base/output.cpp`

### Electronic Structure

- [Basis Construction](https://github.com/deepmodeling/abacus-develop/tree/develop/source/source_basis): `source/source_basis`
- [Plane-Wave Basis](https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_basis/module_pw/pw_basis.cpp): `source/source_basis/module_pw/pw_basis.cpp`
- [Atomic-Orbital Basis](https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_basis/module_ao/orb_atomic.cpp): `source/source_basis/module_ao/orb_atomic.cpp`
- [Electronic Solver](https://github.com/deepmodeling/abacus-develop/tree/develop/source): `source`
- [SCF Iteration](https://github.com/deepmodeling/abacus-develop/blob/develop/python/pyabacus/src/ModuleESolver/components/scf_controller_lcao.hpp): `python/pyabacus/src/ModuleESolver/components/scf_controller_lcao.hpp`

### Simulation Capabilities

- [Geometry Optimization](https://github.com/deepmodeling/abacus-develop/tree/develop/source): `source`
- [Ab-Initio Dynamics](https://github.com/deepmodeling/abacus-develop/tree/develop/source): `source`
- [DFT Functionals](https://github.com/deepmodeling/abacus-develop/tree/develop/source): `source`
- [Advanced Corrections](https://github.com/deepmodeling/abacus-develop/tree/develop/source): `source`
- [Orbital-Free KEDF](https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_pw/module_ofdft/kedf_manager.cpp): `source/source_pw/module_ofdft/kedf_manager.cpp`
- [Time-Dependent Fields](https://github.com/deepmodeling/abacus-develop/blob/develop/source/source_estate/module_pot/td_field_manager.cpp): `source/source_estate/module_pot/td_field_manager.cpp`

### Python And Interfaces

- [Python Bindings](https://github.com/deepmodeling/abacus-develop/tree/develop/python/pyabacus/src/pyabacus): `python/pyabacus/src/pyabacus`
- [ASE Interface](https://github.com/deepmodeling/abacus-develop/blob/develop/interfaces/ASE_interface/abacuslite/core.py): `interfaces/ASE_interface/abacuslite/core.py`
- [Wannier90 Interface](https://github.com/deepmodeling/abacus-develop/blob/develop/interfaces/Wannier90_interface/abacusw90/interface.py): `interfaces/Wannier90_interface/abacusw90/interface.py`
- [Plotting Tools](https://github.com/deepmodeling/abacus-develop/blob/develop/tools/02_postprocessing/plot-tools/abacus_plot/main.py): `tools/02_postprocessing/plot-tools/abacus_plot/main.py`
- [ShengBTE Conversion](https://github.com/deepmodeling/abacus-develop/tree/develop/interfaces/ShengBTE_interface): `interfaces/ShengBTE_interface`

### Other components

- **Calculation User**

## Connections

- Calculation User → ABACUS Entry: starts calculation
- ABACUS Entry → Calculation Driver: calls init
- Calculation Driver → Structure And Inputs: reads structure
- Calculation Driver → Basis Construction: prepares calculation
- Basis Construction → Plane-Wave Basis: constructs
- Basis Construction → Atomic-Orbital Basis: constructs
- Calculation Driver → Electronic Solver: runs electronic solve
- Electronic Solver → SCF Iteration: iterates state
- Calculation Driver → Calculation Results: writes results
- Electronic Solver → DFT Functionals: evaluates
- Electronic Solver → Advanced Corrections: applies
- Electronic Solver → Orbital-Free KEDF: uses when selected
- Electronic Solver → Time-Dependent Fields: uses for field runs
- Calculation Driver → Geometry Optimization: supports optimization
- Calculation Driver → Ab-Initio Dynamics: supports dynamics
- Calculation User → Python Bindings: uses Python API
- Python Bindings → SCF Iteration: controls LCAO SCF
- Calculation User → ASE Interface: runs through ASE
- Calculation User → Wannier90 Interface: uses interface
- Calculation User → ShengBTE Conversion: converts data
- Calculation Results → Plotting Tools: plots results
