# dmftwdft/dmftwdft3 architecture

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

- Interactive diagram: https://gitdiagram.com/dmftwdft/dmftwdft3
- Repository: https://github.com/dmftwdft/dmftwdft3

## Overview

DMFTwDFT3 is a Python-orchestrated framework for running DFT+DMFT calculations with VASP, Siesta, or Quantum ESPRESSO, using Wannier90 and an impurity solver. The main user workflow starts with a calculation directory and `DMFT.py dmft`, proceeds through the iterative DMFT runtime, and ends with `postDMFT.py` analysis. README and source-index references support the main orchestration links; unsampled Fortran runtime components and some documented integrations have limited implementation-level evidence.

Main entry points: [`bin/RUNDMFT.py`](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/RUNDMFT.py) (DMFT iteration), [`bin/DMFT.py`](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/DMFT.py) (DMFT launcher), [`bin/postDMFT.py`](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/postDMFT.py) (Post-processing CLI), [`utilities/electron_count.py`](https://github.com/dmftwdft/dmftwdft3/blob/master/utilities/electron_count.py) (Manifold electron count)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_dmft_cli["DMFT launcher<br/>[DMFT.py]"]
  node_post_cli["Post-processing CLI<br/>[postDMFT.py]"]
end

subgraph group_setup["Inputs and structure"]
  node_input["Input loader<br/>[input_loader.py]"]
  node_structure["Wannier structure<br/>[Struct.py]"]
  node_dft_adapter["DFT adapter<br/>[VASP.py]"]
  node_electron_count["Manifold electron count<br/>[electron_count.py]"]
end

subgraph group_calculation["DMFT calculation"]
  node_iteration["DMFT iteration<br/>[RUNDMFT.py]"]
  node_dmft_model["DMFT model<br/>[DMFT_MOD.py]"]
  node_impurity["Impurity solver<br/>[IMP_SOLVER.py]"]
  node_wannier["Wannier interface<br/>[WAN90.py]"]
  node_hf_k_sum["Hartree-Fock k-sum<br/>[XHF0.py]"]
  node_file_io["Scientific file I/O<br/>[Fileio.py]"]
end

subgraph group_analysis["Analysis"]
  node_post_analysis["Continuation, DOS, bands<br/>[postDMFT.py]"]
  node_plot_utilities["Plot utilities<br/>[plotDMFT.py]"]
  node_electron_utility["Electron-count utility<br/>[electron_count.py]"]
end

subgraph group_kernels["Numerical kernels"]
  node_fortran_main["Fortran runtime<br/>[main.F90]"]
  node_fortran_ksum["Fortran k-sum<br/>[dmft_ksum.F90]"]
end

node_user(("Calculation user"))
node_dft_codes["DFT codes"]
node_wannier90["Wannier90"]
node_ctqmc["CTQMC solver"]

node_user -->|"starts calculation"| node_dmft_cli
node_dmft_cli -->|"loads parameters"| node_input
node_dmft_cli -->|"uses structure"| node_structure
node_dmft_cli -->|"uses DFT adapter"| node_dft_adapter
node_dmft_cli -.->|"launches workflow"| node_iteration
node_iteration -->|"updates model"| node_dmft_model
node_iteration -->|"runs solver"| node_impurity
node_iteration -->|"uses structure"| node_structure
node_iteration -->|"uses DFT adapter"| node_dft_adapter
node_iteration -->|"runs k-sum"| node_hf_k_sum
node_iteration -->|"writes parameters"| node_file_io
node_iteration -->|"runs DFT"| node_dft_codes
node_iteration -.->|"uses interface"| node_wannier
node_wannier -->|"runs Wannier90"| node_wannier90
node_impurity -.->|"uses solver"| node_ctqmc
node_user -->|"requests analysis"| node_post_cli
node_post_cli -->|"loads parameters"| node_input
node_post_cli -->|"reads results"| node_file_io
node_post_cli -->|"uses structure"| node_structure
node_post_cli -->|"dispatches analysis"| node_post_analysis
node_user -->|"runs utility"| node_electron_count
node_electron_count -->|"loads parameters"| node_input
node_electron_count -->|"uses DFT adapter"| node_dft_adapter

click node_dmft_cli "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/DMFT.py"
click node_post_cli "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/postDMFT.py"
click node_input "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/input_loader.py"
click node_structure "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/Struct.py"
click node_dft_adapter "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/VASP.py"
click node_electron_count "https://github.com/dmftwdft/dmftwdft3/blob/master/utilities/electron_count.py"
click node_iteration "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/RUNDMFT.py"
click node_dmft_model "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/DMFT_MOD.py"
click node_impurity "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/IMP_SOLVER.py"
click node_wannier "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/WAN90.py"
click node_hf_k_sum "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/XHF0.py"
click node_file_io "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/Fileio.py"
click node_post_analysis "https://github.com/dmftwdft/dmftwdft3/blob/master/bin/postDMFT.py"
click node_plot_utilities "https://github.com/dmftwdft/dmftwdft3/blob/master/utilities/plotDMFT.py"
click node_electron_utility "https://github.com/dmftwdft/dmftwdft3/blob/master/utilities/electron_count.py"
click node_fortran_main "https://github.com/dmftwdft/dmftwdft3/blob/master/sources/src/main.F90"
click node_fortran_ksum "https://github.com/dmftwdft/dmftwdft3/blob/master/sources/src/dmft_ksum.F90"

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_dmft_cli,node_post_cli,node_user toneBlue
class node_input,node_structure,node_dft_adapter,node_electron_count toneAmber
class node_iteration,node_dmft_model,node_impurity,node_wannier,node_hf_k_sum,node_file_io toneMint
class node_post_analysis,node_plot_utilities,node_electron_utility toneRose
class node_fortran_main,node_fortran_ksum,node_dft_codes,node_wannier90,node_ctqmc toneIndigo
```

## Components

### User entry

- [DMFT launcher](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/DMFT.py): `bin/DMFT.py`
- [Post-processing CLI](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/postDMFT.py): `bin/postDMFT.py`

### Inputs and structure

- [Input loader](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/input_loader.py): `bin/input_loader.py`
- [Wannier structure](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/Struct.py): `bin/Struct.py`
- [DFT adapter](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/VASP.py): `bin/VASP.py`
- [Manifold electron count](https://github.com/dmftwdft/dmftwdft3/blob/master/utilities/electron_count.py): `utilities/electron_count.py`

### DMFT calculation

- [DMFT iteration](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/RUNDMFT.py): `bin/RUNDMFT.py`
- [DMFT model](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/DMFT_MOD.py): `bin/DMFT_MOD.py`
- [Impurity solver](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/IMP_SOLVER.py): `bin/IMP_SOLVER.py`
- [Wannier interface](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/WAN90.py): `bin/WAN90.py`
- [Hartree-Fock k-sum](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/XHF0.py): `bin/XHF0.py`
- [Scientific file I/O](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/Fileio.py): `bin/Fileio.py`

### Analysis

- [Continuation, DOS, bands](https://github.com/dmftwdft/dmftwdft3/blob/master/bin/postDMFT.py): `bin/postDMFT.py`
- [Plot utilities](https://github.com/dmftwdft/dmftwdft3/blob/master/utilities/plotDMFT.py): `utilities/plotDMFT.py`
- [Electron-count utility](https://github.com/dmftwdft/dmftwdft3/blob/master/utilities/electron_count.py): `utilities/electron_count.py`

### Numerical kernels

- [Fortran runtime](https://github.com/dmftwdft/dmftwdft3/blob/master/sources/src/main.F90): `sources/src/main.F90`
- [Fortran k-sum](https://github.com/dmftwdft/dmftwdft3/blob/master/sources/src/dmft_ksum.F90): `sources/src/dmft_ksum.F90`

### Other components

- **Calculation user**
- **DFT codes**
- **Wannier90**
- **CTQMC solver**

## Connections

- Calculation user → DMFT launcher: starts calculation (evidence: `README.md`)
- DMFT launcher → Input loader: loads parameters (evidence: `bin/DMFT.py`)
- DMFT launcher → Wannier structure: uses structure (evidence: `bin/DMFT.py`)
- DMFT launcher → DFT adapter: uses DFT adapter (evidence: `bin/DMFT.py`)
- DMFT launcher → DMFT iteration: launches workflow
- DMFT iteration → DMFT model: updates model (evidence: `bin/RUNDMFT.py`)
- DMFT iteration → Impurity solver: runs solver (evidence: `bin/RUNDMFT.py`)
- DMFT iteration → Wannier structure: uses structure (evidence: `bin/RUNDMFT.py`)
- DMFT iteration → DFT adapter: uses DFT adapter (evidence: `bin/RUNDMFT.py`)
- DMFT iteration → Hartree-Fock k-sum: runs k-sum (evidence: `bin/RUNDMFT.py`)
- DMFT iteration → Scientific file I/O: writes parameters (evidence: `bin/RUNDMFT.py`)
- DMFT iteration → DFT codes: runs DFT (evidence: `README.md`)
- DMFT iteration → Wannier interface: uses interface
- Wannier interface → Wannier90: runs Wannier90 (evidence: `README.md`)
- Impurity solver → CTQMC solver: uses solver (evidence: `README.md`)
- Calculation user → Post-processing CLI: requests analysis (evidence: `README.md`)
- Post-processing CLI → Input loader: loads parameters (evidence: `bin/postDMFT.py`)
- Post-processing CLI → Scientific file I/O: reads results (evidence: `bin/postDMFT.py`)
- Post-processing CLI → Wannier structure: uses structure (evidence: `bin/postDMFT.py`)
- Post-processing CLI → Continuation, DOS, bands: dispatches analysis (evidence: `README.md`)
- Calculation user → Manifold electron count: runs utility (evidence: `utilities/electron_count.py`)
- Manifold electron count → Input loader: loads parameters (evidence: `utilities/electron_count.py`)
- Manifold electron count → DFT adapter: uses DFT adapter (evidence: `utilities/electron_count.py`)
