# aatyaa/hqda architecture

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

- Interactive diagram: https://gitdiagram.com/aatyaa/hqda
- Repository: https://github.com/aatyaa/hqda

## Overview

HQDA is a PbTiO₃ ferroelectric-transition analysis framework. Its documented user workflow starts the analysis with `run_hqda.py`, audits VASP baselines, analyzes simulation data and finite-size effects, synthesizes Judge-Witness results, and validates them against experiment. The graph also preserves the documented plotting and scientific-report capabilities. Several links come from the README’s pipeline description; unsampled orchestration details are not inferred beyond that documentation.

Main entry points: [`engine/hqda_constants.py`](https://github.com/aatyaa/hqda/blob/main/engine/hqda_constants.py) (VASP baseline audit), [`run_hqda.py`](https://github.com/aatyaa/hqda/blob/main/run_hqda.py) (Pipeline runner), [`synthesis/judge_witness_engine.py`](https://github.com/aatyaa/hqda/blob/main/synthesis/judge_witness_engine.py) (Judge-Witness synthesis), [`engine/hqda_data_core.py`](https://github.com/aatyaa/hqda/blob/main/engine/hqda_data_core.py) (Simulation data ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Analysis entry"]
  node_runner["Pipeline runner<br/>[run_hqda.py]"]
end

subgraph group_physics["Physics analysis"]
  node_vasp_audit["VASP baseline audit<br/>[hqda_constants.py]"]
  node_sim_ingest["Simulation data ingestion<br/>[hqda_data_core.py]"]
  node_macroscopic["Macroscopic properties"]
  node_order_disorder["Order-disorder analysis"]
  node_fes["Free-energy surfaces<br/>[hqda_fes_engine.py]"]
  node_finite_size["Finite-size scaling"]
end

subgraph group_evaluation["Synthesis and validation"]
  node_synthesis["Judge-Witness synthesis"]
  node_validation["Experimental validation"]
end

subgraph group_reporting["Results and reporting"]
  node_plotter["Results plotting<br/>[hqda_plotter.py]"]
  node_manuscript["Manuscript generation"]
  node_results["Analysis results"]
end

node_researcher(("Researcher"))
node_vasp_files["VASP raw files"]
node_simulation_files["Simulation data"]
node_experimental_data["Experimental data"]
node_scientific_report["Scientific report"]

node_researcher -->|"starts analysis"| node_runner
node_runner -->|"runs audit"| node_vasp_audit
node_vasp_audit -->|"reads baselines"| node_vasp_files
node_runner -->|"runs scaling"| node_finite_size
node_runner -->|"runs synthesis"| node_synthesis
node_runner -->|"runs validation"| node_validation
node_sim_ingest -->|"uses constants"| node_vasp_audit
node_macroscopic -->|"uses constants"| node_vasp_audit
node_macroscopic -->|"uses simulation data"| node_sim_ingest
node_order_disorder -->|"uses constants"| node_vasp_audit
node_fes -->|"uses constants"| node_vasp_audit
node_finite_size -->|"uses constants"| node_vasp_audit
node_finite_size -->|"uses FES scaling"| node_fes
node_synthesis -->|"uses baselines"| node_vasp_audit
node_synthesis -->|"computes FSS verdict"| node_fes
node_synthesis -->|"computes strain verdict"| node_macroscopic
node_validation -->|"compares baselines"| node_vasp_audit
node_sim_ingest -.->|"reads trajectories"| node_simulation_files
node_validation -->|"compares measurements"| node_experimental_data
node_plotter -->|"reads results"| node_results
node_manuscript -->|"reads results"| node_results
node_manuscript -->|"generates report"| node_scientific_report

click node_runner "https://github.com/aatyaa/hqda/blob/main/run_hqda.py"
click node_vasp_audit "https://github.com/aatyaa/hqda/blob/main/engine/hqda_constants.py"
click node_sim_ingest "https://github.com/aatyaa/hqda/blob/main/engine/hqda_data_core.py"
click node_macroscopic "https://github.com/aatyaa/hqda/blob/main/engine/hqda_macroscopic.py"
click node_order_disorder "https://github.com/aatyaa/hqda/blob/main/engine/hqda_order_disorder.py"
click node_fes "https://github.com/aatyaa/hqda/blob/main/engine/hqda_fes_engine.py"
click node_finite_size "https://github.com/aatyaa/hqda/blob/main/engine/hqda_finite_size.py"
click node_synthesis "https://github.com/aatyaa/hqda/blob/main/synthesis/judge_witness_engine.py"
click node_validation "https://github.com/aatyaa/hqda/blob/main/validation/validate_against_exp.py"
click node_plotter "https://github.com/aatyaa/hqda/blob/main/hqda_plotter.py"
click node_manuscript "https://github.com/aatyaa/hqda/blob/main/generate_final_manuscript.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_runner toneBlue
class node_vasp_audit,node_sim_ingest,node_macroscopic,node_order_disorder,node_fes,node_finite_size toneAmber
class node_synthesis,node_validation toneMint
class node_plotter,node_manuscript,node_results toneRose
class node_researcher,node_vasp_files,node_simulation_files,node_experimental_data,node_scientific_report toneIndigo
```

## Components

### Analysis entry

- [Pipeline runner](https://github.com/aatyaa/hqda/blob/main/run_hqda.py): `run_hqda.py`

### Physics analysis

- [VASP baseline audit](https://github.com/aatyaa/hqda/blob/main/engine/hqda_constants.py): `engine/hqda_constants.py`
- [Simulation data ingestion](https://github.com/aatyaa/hqda/blob/main/engine/hqda_data_core.py): `engine/hqda_data_core.py`
- [Macroscopic properties](https://github.com/aatyaa/hqda/blob/main/engine/hqda_macroscopic.py): `engine/hqda_macroscopic.py`
- [Order-disorder analysis](https://github.com/aatyaa/hqda/blob/main/engine/hqda_order_disorder.py): `engine/hqda_order_disorder.py`
- [Free-energy surfaces](https://github.com/aatyaa/hqda/blob/main/engine/hqda_fes_engine.py): `engine/hqda_fes_engine.py`
- [Finite-size scaling](https://github.com/aatyaa/hqda/blob/main/engine/hqda_finite_size.py): `engine/hqda_finite_size.py`

### Synthesis and validation

- [Judge-Witness synthesis](https://github.com/aatyaa/hqda/blob/main/synthesis/judge_witness_engine.py): `synthesis/judge_witness_engine.py`
- [Experimental validation](https://github.com/aatyaa/hqda/blob/main/validation/validate_against_exp.py): `validation/validate_against_exp.py`

### Results and reporting

- [Results plotting](https://github.com/aatyaa/hqda/blob/main/hqda_plotter.py): `hqda_plotter.py`
- [Manuscript generation](https://github.com/aatyaa/hqda/blob/main/generate_final_manuscript.py): `generate_final_manuscript.py`
- **Analysis results**

### Other components

- **Researcher**
- **VASP raw files**
- **Simulation data**
- **Experimental data**
- **Scientific report**

## Connections

- Researcher → Pipeline runner: starts analysis (evidence: `README.md`)
- Pipeline runner → VASP baseline audit: runs audit (evidence: `README.md`)
- VASP baseline audit → VASP raw files: reads baselines (evidence: `engine/hqda_constants.py`)
- Pipeline runner → Finite-size scaling: runs scaling (evidence: `README.md`)
- Pipeline runner → Judge-Witness synthesis: runs synthesis (evidence: `README.md`)
- Pipeline runner → Experimental validation: runs validation (evidence: `README.md`)
- Simulation data ingestion → VASP baseline audit: uses constants (evidence: `engine/hqda_data_core.py`)
- Macroscopic properties → VASP baseline audit: uses constants (evidence: `engine/hqda_macroscopic.py`)
- Macroscopic properties → Simulation data ingestion: uses simulation data (evidence: `engine/hqda_macroscopic.py`)
- Order-disorder analysis → VASP baseline audit: uses constants (evidence: `engine/hqda_order_disorder.py`)
- Free-energy surfaces → VASP baseline audit: uses constants (evidence: `engine/hqda_fes_engine.py`)
- Finite-size scaling → VASP baseline audit: uses constants (evidence: `engine/hqda_finite_size.py`)
- Finite-size scaling → Free-energy surfaces: uses FES scaling (evidence: `engine/hqda_finite_size.py`)
- Judge-Witness synthesis → VASP baseline audit: uses baselines (evidence: `synthesis/judge_witness_engine.py`)
- Judge-Witness synthesis → Free-energy surfaces: computes FSS verdict (evidence: `synthesis/judge_witness_engine.py`)
- Judge-Witness synthesis → Macroscopic properties: computes strain verdict (evidence: `synthesis/judge_witness_engine.py`)
- Experimental validation → VASP baseline audit: compares baselines (evidence: `validation/validate_against_exp.py`)
- Simulation data ingestion → Simulation data: reads trajectories
- Experimental validation → Experimental data: compares measurements (evidence: `validation/validate_against_exp.py`)
- Results plotting → Analysis results: reads results (evidence: `hqda_plotter.py`)
- Manuscript generation → Analysis results: reads results (evidence: `generate_final_manuscript.py`)
- Manuscript generation → Scientific report: generates report (evidence: `generate_final_manuscript.py`)
