# aoneillmark/capstone architecture

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

- Interactive diagram: https://gitdiagram.com/aoneillmark/capstone
- Repository: https://github.com/aoneillmark/capstone

## Overview

##### Main Components
- Simulation Engines & Modules: Your codebase contains multiple simulation scripts (e.g., VOTPP_[n-e]-(n).py, VOTPP_[n-e]-(e).py, VOTPP_class.py, and their revised versions). These encapsulate the core physics calculations using the Cluster Correlation Expansion method (PyCCE) and implement the analytical product rule.
– Convergence Data (e.g., Revised_VOTPP/Results_revised/Pickle_files/Convergence)
– Simulation Results (found under both Revised_VOTPP and VOTPP folder subdirectories)
– Fit and Post-processing Results (such as files in “Fits” directories)
- Plotting and Analysis Module: Several scripts are dedicated to plotting (plotter_script.py, VOTPP_results_and_fit_plotter.py, and visualization scripts in the Results/Plots_editing/ folder). This component represents the post-simulation analysis that interprets and visualizes the simulation outputs.
- Configuration and Input Files: Files like VOTPP_opt.Atens, VOTPP_opt.gtens, and .xyz files serve as configuration or input data (spin system configurations or material properties). This component should feed simulation modules with the necessary initial conditions.

##### Relationships and Interactions
- Data Flow: Begin with input data/configuration files feeding into the simulation modules. These, running under an MPI-managed environment, process the physics simulation and then output results as pickle files into the Data Storage component.

##### Architectural Patterns & Design Principles
- Data Pipeline Flow: Emphasize an end-to-end workflow from input configuration through simulation, storage, and analysis.
- Scalability: Note that the MPI-based design allows scaling to multiple cores/nodes and that the system is designed to run on large HPC clusters (e.g., Boyle cluster).

##### Technologies/Frameworks Highlight
- Python as the primary language.
- mpi4py for parallel processing.
- PyCCE for simulating the quantum dynamics.
- Pickle module for data storage.
- Plotting libraries (likely matplotlib or similar tools) for visualization.

##### Elements
– From “Input” to “Simulation Engine”
– From “Simulation Engine” to “Data Storage”
– From “Data Storage” to “Visualization & Analysis”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Layer
    Config("Configuration & Input Files"):::config

    %% MPI & Job Scheduling Layer
    MPI("MPI Processing"):::mpi
    Job("Slurm Job Scripts"):::job

    %% Simulation Engines
    RevSim("Revised Simulation Engine"):::sim
    OriSim("Original Simulation Engine"):::sim

    %% Data Storage Layer
    RevData("Revised Data Storage"):::storage
    OriData("Original Data Storage"):::storage

    %% Analysis Layer
    Viz("Visualization & Analysis"):::viz

    %% Connections
    Config -->|"feeds"| RevSim
    Config -->|"feeds"| OriSim
    Config -->|"provides"| MPI

    MPI -->|"coordinates"| RevSim
    MPI -->|"coordinates"| OriSim
    Job -->|"triggers"| MPI

    RevSim -->|"outputs"| RevData
    OriSim -->|"outputs"| OriData

    RevData -->|"supplies"| Viz
    OriData -->|"supplies"| Viz

    %% Click Events for Configuration & Input Files (Representative)
    click Config "https://github.com/aoneillmark/capstone/blob/master/Revised_VOTPP/VOTPP_opt.Atens"
    click Config "https://github.com/aoneillmark/capstone/blob/master/VOTPP folder/VOTPP_opt.Atens"

    %% Click Events for MPI Processing
    click MPI "https://github.com/aoneillmark/capstone/blob/master/Revised_VOTPP/runner_revised.py"

    %% Click Events for Slurm Job Scripts
    click Job "https://github.com/aoneillmark/capstone/tree/master/Slurm_2024"
    click Job "https://github.com/aoneillmark/capstone/tree/master/Slurm_2024_n"

    %% Click Events for Revised Simulation Engine
    click RevSim "https://github.com/aoneillmark/capstone/blob/master/Revised_VOTPP/VOTPP_class_revised.py"

    %% Click Events for Original Simulation Engine
    click OriSim "https://github.com/aoneillmark/capstone/blob/master/VOTPP folder/VOTPP_class.py"
    click OriSim "https://github.com/aoneillmark/capstone/blob/master/VOTPP folder/VOTPP_[n-e]-(n).py"
    click OriSim "https://github.com/aoneillmark/capstone/blob/master/VOTPP folder/VOTPP_[n-e]-(e).py"
    click OriSim "https://github.com/aoneillmark/capstone/blob/master/VOTPP folder/VOTPP_product_rule.py"
    click OriSim "https://github.com/aoneillmark/capstone/blob/master/VOTPP folder/element_wise_product_rule.py"

    %% Click Events for Revised Data Storage
    click RevData "https://github.com/aoneillmark/capstone/tree/master/Revised_VOTPP/Results_revised/Pickle_files/Convergence"
    click RevData "https://github.com/aoneillmark/capstone/tree/master/Revised_VOTPP/Results_revised/Pickle_files/Simulation"

    %% Click Events for Original Data Storage
    click OriData "https://github.com/aoneillmark/capstone/tree/master/VOTPP folder/Results/Convergence"
    click OriData "https://github.com/aoneillmark/capstone/tree/master/VOTPP folder/Results/Pickle files 2/Simulation Results"
    click OriData "https://github.com/aoneillmark/capstone/tree/master/VOTPP folder/Results/Pickle files 2/Fits"

    %% Click Events for Visualization & Analysis
    click Viz "https://github.com/aoneillmark/capstone/blob/master/VOTPP folder/VOTPP_results_and_fit_plotter.py"
    click Viz "https://github.com/aoneillmark/capstone/blob/master/Revised_VOTPP/plotter_script.py"
    click Viz "https://github.com/aoneillmark/capstone/blob/master/VOTPP folder/E vs B visualiser.py"
    click Viz "https://github.com/aoneillmark/capstone/tree/master/VOTPP folder/Results/Plots_editing"

    %% Styles
    classDef config fill:#f9e79f,stroke:#7d6608,stroke-width:2px;
    classDef mpi fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef job fill:#abebc6,stroke:#1e8449,stroke-width:2px;
    classDef sim fill:#f5cba7,stroke:#a04000,stroke-width:2px;
    classDef storage fill:#d5f5e3,stroke:#28b463,stroke-width:2px;
    classDef viz fill:#f9c4c4,stroke:#c0392b,stroke-width:2px;
    
    %% Layout adjustments for vertical orientation
    Config --- MPI
    MPI --- RevSim
    MPI --- OriSim
    RevSim --- RevData
    OriSim --- OriData
    RevData --- Viz
    OriData --- Viz
```
