# alphal00p/vakint architecture

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

- Interactive diagram: https://gitdiagram.com/alphal00p/vakint
- Repository: https://github.com/alphal00p/vakint

## Overview

##### Main Components Identification

The system should be divided into these primary components:
- Core Library Engine
- External Tools Integration
- Computation Backends
- Input/Output Processing

##### Detailed Component Breakdown

- Submodules visible in src/:
- Graph Processing (graph.rs)
- Topology Management (topologies.rs)
- Symbol Handling (symbols.rs)

b) Computation Backends (Split into two parallel branches):
##### Analytical Backend
- FORM Integration
- FMFT Processing (fmft.rs, fmft_numerics.rs)
- MATAD Processing (matad.rs, matad_numerics.rs)

##### Numerical Backend
- pySecDec Integration (for unknown topologies)

c) External Tools Integration (Connected to both backends):
- Form Scripts (form_src/)
- Template Engine (templates/)
- External Dependencies:
- Symbolica
- FORM
- FMFT
- pySecDec

##### Input Flow
- User Input → Vakint Core
- Vakint Core → Topology Matching
- Topology Matching → Backend Selection

##### Processing Flow
- Known Topologies → Analytical Backend
- Unknown Topologies → Numerical Backend
- Results → Output Processing

##### Key Processes to Highlight

Main workflows:
##### Numerical Evaluation

- The hybrid nature of the system (analytical vs. numerical)
- The integration with external tools
- The clear separation of concerns between components
- The flexibility in handling both known and unknown topologies

Keep the abstraction level focused on the architectural components while showing the key interactions between the system's parts. This will help other engineers understand both the high-level structure and the detailed processing flow of the vacuum integral computations.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        VC[Vakint Core]
        GP["Graph Processing"]:::core
        TM["Topology Management"]:::core
        SH["Symbol Handling"]:::core
        UT["Utilities"]:::core
        CL["Core Library"]:::core
    end

    subgraph "Analytical Backend"
        FORM["FORM Integration"]:::analytical
        FMFT["FMFT Processing"]:::analytical
        MATAD["MATAD Processing"]:::analytical
        TR["Tensor Reduction"]:::analytical
    end

    subgraph "Numerical Backend"
        PSD["pySecDec Integration"]:::numerical
        PSDT["pySecDec Templates"]:::numerical
        PSDO["pySecDec Output"]:::numerical
    end

    subgraph "External Tools"
        TE["Template Engine"]:::external
        FSD["FORM Scripts Directory"]:::external
        ED["External Dependencies"]:::external
    end

    subgraph "Testing & Examples"
        IMT["Input Matching Tests"]:::testing
        BIT["Backend Integration Tests"]:::testing
        TRT["Tensor Reduction Tests"]:::testing
        EX["Example Usage"]:::testing
    end

    %% Core Relationships
    VC --> GP
    VC --> TM
    VC --> SH
    VC --> UT
    VC --> CL

    %% Backend Flows
    VC --> FORM
    FORM --> FMFT
    FORM --> MATAD
    FORM --> TR
    VC --> PSD
    PSD --> PSDT
    PSDT --> PSDO

    %% External Tool Integration
    FORM --> TE
    FORM --> FSD
    VC --> ED

    %% Testing Connections
    VC --> IMT
    VC --> BIT
    VC --> TRT
    VC --> EX

    %% Click Events
    click GP "https://github.com/alphal00p/vakint/blob/main/src/graph.rs"
    click TM "https://github.com/alphal00p/vakint/blob/main/src/topologies.rs"
    click SH "https://github.com/alphal00p/vakint/blob/main/src/symbols.rs"
    click UT "https://github.com/alphal00p/vakint/blob/main/src/utils.rs"
    click CL "https://github.com/alphal00p/vakint/blob/main/src/lib.rs"
    click FMFT "https://github.com/alphal00p/vakint/blob/main/src/fmft.rs"
    click MATAD "https://github.com/alphal00p/vakint/blob/main/src/matad.rs"
    click TR "https://github.com/alphal00p/vakint/blob/main/form_src/alphaloop/tensorreduce.frm"
    click PSDT "https://github.com/alphal00p/vakint/blob/main/templates/run_pySecDec_template.txt"
    click PSDO "https://github.com/alphal00p/vakint/tree/main/tests_workspace/__pySecDecTestOutputsWillBePlacedHere__"
    click FSD "https://github.com/alphal00p/vakint/tree/main/form_src/alphaloop/"
    click TE "https://github.com/alphal00p/vakint/tree/main/templates/"
    click IMT "https://github.com/alphal00p/vakint/blob/main/tests/input_matching_tests.rs"
    click BIT "https://github.com/alphal00p/vakint/blob/main/tests/integral_alphaloop_vs_matad_tests.rs"
    click TRT "https://github.com/alphal00p/vakint/blob/main/tests/tensor_reduction_tests.rs"
    click EX "https://github.com/alphal00p/vakint/blob/main/examples/simple_evaluation.rs"

    %% Styling
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef analytical fill:#2ecc71,stroke:#27ae60,color:white
    classDef numerical fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white
    classDef testing fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1["Core Component"]:::core
        L2["Analytical Processing"]:::analytical
        L3["Numerical Processing"]:::numerical
        L4["External Tools"]:::external
        L5["Testing & Examples"]:::testing
    end
```
