# west-code-development/west architecture

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

- Interactive diagram: https://gitdiagram.com/west-code-development/west
- Repository: https://github.com/west-code-development/west

## Overview

WEST is a massively parallel electronic-structure package for many-body perturbation theory. Its repository separates screening, frequency-dependent calculations, Bethe–Salpeter/excited-state work, and result post-processing into distinct Fortran applications, with shared kernels and I/O. Python tools support input handling, Qbox coordination, and reading or converting selected result data. The README establishes the product purpose, while the sampled sources show specific Python and Base64 behavior; Fortran subsystem connections are not shown, so their internal call relationships are omitted.

Main entry points: [`Wstat/wstat.f90`](https://github.com/west-code-development/west/blob/master/Wstat/wstat.f90) (Static screening), [`Wfreq/wfreq.f90`](https://github.com/west-code-development/west/blob/master/Wfreq/wfreq.f90) (Frequency response), [`Wbse/wbse.f90`](https://github.com/west-code-development/west/blob/master/Wbse/wbse.f90) (Excited states), [`Westpp/westpp.f90`](https://github.com/west-code-development/west/blob/master/Westpp/westpp.f90) (Result analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_applications["Calculation applications"]
  node_wstat["Static screening<br/>[wstat.f90]"]
  node_wfreq["Frequency response<br/>[wfreq.f90]"]
  node_wbse["Excited states<br/>[wbse.f90]"]
  node_westpp["Result analysis<br/>[westpp.f90]"]
end

subgraph group_shared["Shared scientific runtime"]
  node_dfpt["Perturbation theory<br/>[dfpt_module.f90]"]
  node_hamiltonian["Hamiltonian operations"]
  node_fft["Fourier transforms<br/>[fft_at_k.f90]"]
  node_parallel["Parallel distribution"]
  node_coulomb["Coulomb kernel<br/>[class_coulomb.f90]"]
end

subgraph group_python["Python tools"]
  node_input["Input parsing"]
  node_qbox["Qbox coordination"]
  node_function3d["3D function conversion<br/>[west_function3d.py]"]
  node_bse_reader["BSE data reader<br/>[west_read_bse.py]"]
  node_utilities["Python utilities<br/>[west_utils.py]"]
  node_json_reader["JSON reader<br/>[read_json.py]"]
end

subgraph group_io["Persistence and formats"]
  node_west_io["WEST I/O<br/>[mod_west_io.f90]"]
  node_pdep_io["PDEP persistence<br/>[pdep_io.f90]"]
  node_wfreq_io["Frequency persistence<br/>[wfreq_io.f90]"]
  node_wbse_io["BSE persistence<br/>[wbse_io.f90]"]
  node_base64["Base64 encoding<br/>[cbase64.c]"]
end

node_user(("Researcher"))

node_user -.->|"runs calculations"| node_wstat
node_user -.->|"runs calculations"| node_wfreq
node_user -.->|"runs calculations"| node_wbse
node_user -.->|"analyzes results"| node_westpp

click node_wstat "https://github.com/west-code-development/west/blob/master/Wstat/wstat.f90"
click node_wfreq "https://github.com/west-code-development/west/blob/master/Wfreq/wfreq.f90"
click node_wbse "https://github.com/west-code-development/west/blob/master/Wbse/wbse.f90"
click node_westpp "https://github.com/west-code-development/west/blob/master/Westpp/westpp.f90"
click node_dfpt "https://github.com/west-code-development/west/blob/master/DFPT_kernel/dfpt_module.f90"
click node_hamiltonian "https://github.com/west-code-development/west/blob/master/Hamiltonian_kernel/apply_hqp_to_m_wfcs.f90"
click node_fft "https://github.com/west-code-development/west/blob/master/FFT_kernel/fft_at_k.f90"
click node_parallel "https://github.com/west-code-development/west/blob/master/Para_kernel/parallel_distributed_diago.f90"
click node_coulomb "https://github.com/west-code-development/west/blob/master/Coulomb_kernel/class_coulomb.f90"
click node_input "https://github.com/west-code-development/west/blob/master/Pytools/west_fetch_input.py"
click node_qbox "https://github.com/west-code-development/west/blob/master/Pytools/west_clientserver.py"
click node_function3d "https://github.com/west-code-development/west/blob/master/Pytools/west_function3d.py"
click node_bse_reader "https://github.com/west-code-development/west/blob/master/Pytools/west_read_bse.py"
click node_utilities "https://github.com/west-code-development/west/blob/master/Pytools/west_utils.py"
click node_json_reader "https://github.com/west-code-development/west/blob/master/Pytools/read_json.py"
click node_west_io "https://github.com/west-code-development/west/blob/master/IO_kernel/mod_west_io.f90"
click node_pdep_io "https://github.com/west-code-development/west/blob/master/IO_kernel/pdep_io.f90"
click node_wfreq_io "https://github.com/west-code-development/west/blob/master/IO_kernel/wfreq_io.f90"
click node_wbse_io "https://github.com/west-code-development/west/blob/master/IO_kernel/wbse_io.f90"
click node_base64 "https://github.com/west-code-development/west/blob/master/Libraries/Base64/cbase64.c"

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_wstat,node_wfreq,node_wbse,node_westpp toneBlue
class node_dfpt,node_hamiltonian,node_fft,node_parallel,node_coulomb toneAmber
class node_input,node_qbox,node_function3d,node_bse_reader,node_utilities,node_json_reader toneMint
class node_west_io,node_pdep_io,node_wfreq_io,node_wbse_io,node_base64 toneRose
class node_user toneIndigo
```

## Components

### Calculation applications

- [Static screening](https://github.com/west-code-development/west/blob/master/Wstat/wstat.f90): `Wstat/wstat.f90`
- [Frequency response](https://github.com/west-code-development/west/blob/master/Wfreq/wfreq.f90): `Wfreq/wfreq.f90`
- [Excited states](https://github.com/west-code-development/west/blob/master/Wbse/wbse.f90): `Wbse/wbse.f90`
- [Result analysis](https://github.com/west-code-development/west/blob/master/Westpp/westpp.f90): `Westpp/westpp.f90`

### Shared scientific runtime

- [Perturbation theory](https://github.com/west-code-development/west/blob/master/DFPT_kernel/dfpt_module.f90): `DFPT_kernel/dfpt_module.f90`
- [Hamiltonian operations](https://github.com/west-code-development/west/blob/master/Hamiltonian_kernel/apply_hqp_to_m_wfcs.f90): `Hamiltonian_kernel/apply_hqp_to_m_wfcs.f90`
- [Fourier transforms](https://github.com/west-code-development/west/blob/master/FFT_kernel/fft_at_k.f90): `FFT_kernel/fft_at_k.f90`
- [Parallel distribution](https://github.com/west-code-development/west/blob/master/Para_kernel/parallel_distributed_diago.f90): `Para_kernel/parallel_distributed_diago.f90`
- [Coulomb kernel](https://github.com/west-code-development/west/blob/master/Coulomb_kernel/class_coulomb.f90): `Coulomb_kernel/class_coulomb.f90`

### Python tools

- [Input parsing](https://github.com/west-code-development/west/blob/master/Pytools/west_fetch_input.py): `Pytools/west_fetch_input.py`
- [Qbox coordination](https://github.com/west-code-development/west/blob/master/Pytools/west_clientserver.py): `Pytools/west_clientserver.py`
- [3D function conversion](https://github.com/west-code-development/west/blob/master/Pytools/west_function3d.py): `Pytools/west_function3d.py`
- [BSE data reader](https://github.com/west-code-development/west/blob/master/Pytools/west_read_bse.py): `Pytools/west_read_bse.py`
- [Python utilities](https://github.com/west-code-development/west/blob/master/Pytools/west_utils.py): `Pytools/west_utils.py`
- [JSON reader](https://github.com/west-code-development/west/blob/master/Pytools/read_json.py): `Pytools/read_json.py`

### Persistence and formats

- [WEST I/O](https://github.com/west-code-development/west/blob/master/IO_kernel/mod_west_io.f90): `IO_kernel/mod_west_io.f90`
- [PDEP persistence](https://github.com/west-code-development/west/blob/master/IO_kernel/pdep_io.f90): `IO_kernel/pdep_io.f90`
- [Frequency persistence](https://github.com/west-code-development/west/blob/master/IO_kernel/wfreq_io.f90): `IO_kernel/wfreq_io.f90`
- [BSE persistence](https://github.com/west-code-development/west/blob/master/IO_kernel/wbse_io.f90): `IO_kernel/wbse_io.f90`
- [Base64 encoding](https://github.com/west-code-development/west/blob/master/Libraries/Base64/cbase64.c): `Libraries/Base64/cbase64.c`

### Other components

- **Researcher**

## Connections

- Researcher → Static screening: runs calculations
- Researcher → Frequency response: runs calculations
- Researcher → Excited states: runs calculations
- Researcher → Result analysis: analyzes results
