# infant83/vaspberry architecture

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

- Interactive diagram: https://gitdiagram.com/infant83/vaspberry
- Repository: https://github.com/infant83/vaspberry

## Overview

VASPBERRY postprocesses VASP electronic-structure outputs to calculate topology and response functions, then exports numerical data for analysis and plotting. The documented workflow starts with a VASP calculation and WAVECAR, proceeds through native calculations, and may continue through Python postprocessing. The tree does not expose the native Fortran implementation, so its node uses the existing tools/ directory as the nearest supported path; feature links beyond explicit README statements are omitted. The graph also includes documented capabilities and sampled Python subsystems.

Main entry points: [`tools`](https://github.com/infant83/vaspberry/tree/master/tools) (Native tasks), [`tools/berry_data.py`](https://github.com/infant83/vaspberry/blob/master/tools/berry_data.py) (Curvature data), [`tools/vaspberry_transport.py`](https://github.com/infant83/vaspberry/blob/master/tools/vaspberry_transport.py) (Hall transport), [`tools/vaspberry_kubo.py`](https://github.com/infant83/vaspberry/blob/master/tools/vaspberry_kubo.py) (Kubo curvature)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_native["Native calculations"]
  node_native_app["Native tasks"]
end

subgraph group_wave["Wavefunction analysis"]
  node_fukui["Fukui Chern<br/>[wavecar_fukui.py]"]
  node_z2["FH Z₂"]
  node_spin_chern["Spin Chern<br/>[spin_operators.py]"]
  node_wavefunction["Wavefunction output"]
end

subgraph group_response["Response analysis"]
  node_kubo_curv["Kubo curvature<br/>[vaspberry_kubo.py]"]
  node_spin_kubo["Spin Kubo"]
  node_kubo_pairs["Kubo pairs<br/>[kubo_pairs.py]"]
  node_optics["Optical spectra<br/>[waveder_optics.py]"]
  node_matrix_export["Matrix import"]
  node_matrix_kubo["Matrix Kubo"]
  node_wannier["Wannier operators"]
end

subgraph group_post["Postprocessing"]
  node_hall["Hall transport"]
  node_berry_data["Curvature data<br/>[berry_data.py]"]
  node_plot["Curvature plots"]
  node_hall_plot["Hall plots<br/>[plot_hall.py]"]
end

node_vasp(("VASP calculation"))
node_wavecar["WAVECAR"]
node_results["Numerical outputs"]
node_analysis(("Analysis and plots"))

node_vasp -->|"produces"| node_wavecar
node_wavecar -->|"supplies input"| node_native_app
node_native_app -->|"writes results"| node_results
node_results -->|"supports analysis"| node_analysis
node_wavecar -->|"reads"| node_fukui
node_native_app -.->|"calculates"| node_fukui
node_native_app -->|"calculates"| node_z2
node_native_app -->|"calculates"| node_spin_chern
node_native_app -->|"calculates"| node_kubo_curv
node_native_app -->|"calculates"| node_spin_kubo
node_native_app -->|"calculates"| node_kubo_pairs
node_native_app -->|"calculates"| node_optics
node_native_app -->|"calculates"| node_wavefunction
node_matrix_export -.->|"supplies matrices"| node_matrix_kubo
node_wannier -.->|"supplies operators"| node_matrix_kubo
node_kubo_pairs -->|"supplies curvature"| node_hall
node_berry_data -->|"integrates"| node_hall
node_kubo_curv -.->|"exports data"| node_berry_data
node_berry_data -.->|"plots"| node_plot
node_hall -->|"plots"| node_hall_plot
node_plot -.->|"presents"| node_analysis
node_hall_plot -.->|"presents"| node_analysis

click node_native_app "https://github.com/infant83/vaspberry/tree/master/tools"
click node_fukui "https://github.com/infant83/vaspberry/blob/master/tools/wavecar_fukui.py"
click node_z2 "https://github.com/infant83/vaspberry/tree/master/tools"
click node_spin_chern "https://github.com/infant83/vaspberry/blob/master/tools/spin_operators.py"
click node_kubo_curv "https://github.com/infant83/vaspberry/blob/master/tools/vaspberry_kubo.py"
click node_spin_kubo "https://github.com/infant83/vaspberry/blob/master/tools/spin_hall_workflow.py"
click node_kubo_pairs "https://github.com/infant83/vaspberry/blob/master/tools/kubo_pairs.py"
click node_optics "https://github.com/infant83/vaspberry/blob/master/tools/waveder_optics.py"
click node_wavefunction "https://github.com/infant83/vaspberry/tree/master/tools"
click node_matrix_export "https://github.com/infant83/vaspberry/blob/master/tools/vasp_spin_export.py"
click node_matrix_kubo "https://github.com/infant83/vaspberry/blob/master/tools/exported_matrix_kubo.py"
click node_wannier "https://github.com/infant83/vaspberry/blob/master/tools/wannier_operators.py"
click node_hall "https://github.com/infant83/vaspberry/blob/master/tools/vaspberry_transport.py"
click node_berry_data "https://github.com/infant83/vaspberry/blob/master/tools/berry_data.py"
click node_plot "https://github.com/infant83/vaspberry/blob/master/tools/plot_berry_curvature.py"
click node_hall_plot "https://github.com/infant83/vaspberry/blob/master/tools/plot_hall.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_native_app toneBlue
class node_fukui,node_z2,node_spin_chern,node_wavefunction toneAmber
class node_kubo_curv,node_spin_kubo,node_kubo_pairs,node_optics,node_matrix_export,node_matrix_kubo,node_wannier toneMint
class node_hall,node_berry_data,node_plot,node_hall_plot toneRose
class node_vasp,node_wavecar,node_results,node_analysis toneIndigo
```

## Components

### Native calculations

- [Native tasks](https://github.com/infant83/vaspberry/tree/master/tools): `tools`

### Wavefunction analysis

- [Fukui Chern](https://github.com/infant83/vaspberry/blob/master/tools/wavecar_fukui.py): `tools/wavecar_fukui.py`
- [FH Z₂](https://github.com/infant83/vaspberry/tree/master/tools): `tools`
- [Spin Chern](https://github.com/infant83/vaspberry/blob/master/tools/spin_operators.py): `tools/spin_operators.py`
- [Wavefunction output](https://github.com/infant83/vaspberry/tree/master/tools): `tools`

### Response analysis

- [Kubo curvature](https://github.com/infant83/vaspberry/blob/master/tools/vaspberry_kubo.py): `tools/vaspberry_kubo.py`
- [Spin Kubo](https://github.com/infant83/vaspberry/blob/master/tools/spin_hall_workflow.py): `tools/spin_hall_workflow.py`
- [Kubo pairs](https://github.com/infant83/vaspberry/blob/master/tools/kubo_pairs.py): `tools/kubo_pairs.py`
- [Optical spectra](https://github.com/infant83/vaspberry/blob/master/tools/waveder_optics.py): `tools/waveder_optics.py`
- [Matrix import](https://github.com/infant83/vaspberry/blob/master/tools/vasp_spin_export.py): `tools/vasp_spin_export.py`
- [Matrix Kubo](https://github.com/infant83/vaspberry/blob/master/tools/exported_matrix_kubo.py): `tools/exported_matrix_kubo.py`
- [Wannier operators](https://github.com/infant83/vaspberry/blob/master/tools/wannier_operators.py): `tools/wannier_operators.py`

### Postprocessing

- [Hall transport](https://github.com/infant83/vaspberry/blob/master/tools/vaspberry_transport.py): `tools/vaspberry_transport.py`
- [Curvature data](https://github.com/infant83/vaspberry/blob/master/tools/berry_data.py): `tools/berry_data.py`
- [Curvature plots](https://github.com/infant83/vaspberry/blob/master/tools/plot_berry_curvature.py): `tools/plot_berry_curvature.py`
- [Hall plots](https://github.com/infant83/vaspberry/blob/master/tools/plot_hall.py): `tools/plot_hall.py`

### Other components

- **VASP calculation**
- **WAVECAR**
- **Numerical outputs**
- **Analysis and plots**

## Connections

- VASP calculation → WAVECAR: produces (evidence: `README.md`)
- WAVECAR → Native tasks: supplies input (evidence: `README.md`)
- Native tasks → Numerical outputs: writes results (evidence: `README.md`)
- Numerical outputs → Analysis and plots: supports analysis (evidence: `README.md`)
- WAVECAR → Fukui Chern: reads (evidence: `tools/wavecar_fukui.py`)
- Native tasks → Fukui Chern: calculates (evidence: `tools/kubo_pairs.py`)
- Native tasks → FH Z₂: calculates (evidence: `README.md`)
- Native tasks → Spin Chern: calculates (evidence: `README.md`)
- Native tasks → Kubo curvature: calculates (evidence: `README.md`)
- Native tasks → Spin Kubo: calculates (evidence: `README.md`)
- Native tasks → Kubo pairs: calculates (evidence: `README.md`)
- Native tasks → Optical spectra: calculates (evidence: `README.md`)
- Native tasks → Wavefunction output: calculates (evidence: `README.md`)
- Matrix import → Matrix Kubo: supplies matrices (evidence: `tools/vasp_spin_export.py`)
- Wannier operators → Matrix Kubo: supplies operators (evidence: `tools/wannier_operators.py`)
- Kubo pairs → Hall transport: supplies curvature (evidence: `tools/kubo_pairs.py`)
- Curvature data → Hall transport: integrates (evidence: `tools/berry_data.py`)
- Kubo curvature → Curvature data: exports data (evidence: `tools/vaspberry_kubo.py`)
- Curvature data → Curvature plots: plots
- Hall transport → Hall plots: plots (evidence: `tools/plot_hall.py`)
- Curvature plots → Analysis and plots: presents
- Hall plots → Analysis and plots: presents
