# alphal00p/alphaloop architecture

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

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

## Overview

##### Main Components
The system architecture should be divided into these key components:

a. Core Processing Pipeline:
- MadGraph Interface -> FORM Processing -> Rust Backend -> Integration Engine

b. Supporting Libraries:
- AVHOneLOopHook (Fortran)
- QGRAF (Graph Generation)
- fjcore (FastJet Core)
- Cuba Integration Library

##### Component Details

a. Frontend Layer:
- MadGraph Plugin Interface (alpha_loop/interface.py)
- Process Definition Handler (examples/*.aL files)
- Model Management System (models/aL_sm/*)

b. Processing Layer:
- FORM Processing Engine (alpha_loop/FORM_processing.py)
- LTD Implementation (LTD/ltd_commons.py)
- Topology Management (LTD/topologies/*)

c. Backend Layer:
- Rust Backend (rust_backend/*)
- Integration Engine (alpha_loop/integrator/*)
- Numerical Computation Core

d. Validation System:
- Test Framework (validation/*)
- Benchmark System (validation/bench/*)

##### Data Flow Representation

- Process Definition -> Graph Generation -> FORM Processing ->
- Rust Backend Compilation -> Numerical Integration -> Results

##### Integration Points

Interfaces between:
- MadGraph and alphaLoop
- FORM and Rust Backend
- Rust Backend and Integration Engine
- Python API and Rust Backend

##### Specific Elements

a. Process Flow:
- Input Cards (.aL) -> MadGraph Processing -> FORM Analysis ->
- Rust Implementation -> Numerical Integration

b. Library Dependencies:
- Python Scientific Stack
- Rust Toolchain
- FORM Processing Engine
- External Numerical Libraries

##### Key Architectural Patterns

- Plugin Architecture (MadGraph Integration)
- Pipeline Processing (FORM -> Rust)
- Parallel Processing (Integration Engine)
- Multi-language Integration (Python/Rust/Fortran)

##### Validation and testing framework

Remember to maintain appropriate abstraction while showing the complex interactions between components, particularly focusing on the critical path from process definition to numerical results.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        MG[MadGraph Interface]
        PD[Process Definition]
        MM[Model Management]
    end

    subgraph Processing
        FP[FORM Processing Engine]
        LTD[LTD Implementation]
        TM[Topology Management]
    end

    subgraph Backend
        RB[Rust Backend]
        IE[Integration Engine]
        NC[Numerical Core]
    end

    subgraph Libraries
        AVH[AVHOneLOopHook]
        QG[QGRAF]
        FJ[fjcore]
        CI[Cuba Integration]
    end

    subgraph Validation
        TF[Test Framework]
        BS[Benchmark System]
        TC[Test Cases]
    end

    subgraph Core_Components
        TD[Topology Definitions]
        AP[Amplitude Processing]
        UV[UV Counterterms]
        CT[Configuration Templates]
    end

    %% Data Flow
    MG --> FP
    PD --> MG
    MM --> MG
    FP --> RB
    LTD --> FP
    TM --> FP
    RB --> IE
    IE --> NC

    %% Library Dependencies
    AVH --> RB
    QG --> FP
    FJ --> RB
    CI --> IE

    %% Validation Flow
    TF --> RB
    BS --> IE
    TC --> TF

    %% Core Component Integration
    TD --> TM
    AP --> FP
    UV --> RB
    CT --> MG

    %% Styling
    classDef frontend fill:#a8d1ff
    classDef processing fill:#ffb366
    classDef backend fill:#90EE90
    classDef libraries fill:#d1d1e0
    classDef validation fill:#ffff99
    classDef core fill:#ff9999

    class MG,PD,MM frontend
    class FP,LTD,TM processing
    class RB,IE,NC backend
    class AVH,QG,FJ,CI libraries
    class TF,BS,TC validation
    class TD,AP,UV,CT core

    %% Click Events
    click MG "https://github.com/alphal00p/alphaloop/blob/global_dampening/alpha_loop/interface.py"
    click PD "https://github.com/alphal00p/alphaloop/blob/global_dampening/examples/*.aL"
    click MM "https://github.com/alphal00p/alphaloop/tree/global_dampening/models/aL_sm/"
    click FP "https://github.com/alphal00p/alphaloop/blob/global_dampening/alpha_loop/FORM_processing.py"
    click LTD "https://github.com/alphal00p/alphaloop/blob/global_dampening/LTD/ltd_commons.py"
    click TM "https://github.com/alphal00p/alphaloop/tree/global_dampening/LTD/topologies/"
    click RB "https://github.com/alphal00p/alphaloop/tree/global_dampening/rust_backend/"
    click IE "https://github.com/alphal00p/alphaloop/tree/global_dampening/alpha_loop/integrator/"
    click NC "https://github.com/alphal00p/alphaloop/blob/global_dampening/rust_backend/src/integrand.rs"
    click AVH "https://github.com/alphal00p/alphaloop/tree/global_dampening/LTD/AVHOneLOopHook/"
    click QG "https://github.com/alphal00p/alphaloop/tree/global_dampening/libraries/QGRAF/"
    click FJ "https://github.com/alphal00p/alphaloop/tree/global_dampening/libraries/fjcore/"
    click CI "https://github.com/alphal00p/alphaloop/blob/global_dampening/alpha_loop/integrator/cuba_interface.py"
    click TF "https://github.com/alphal00p/alphaloop/tree/global_dampening/validation/"
    click BS "https://github.com/alphal00p/alphaloop/tree/global_dampening/validation/bench/"
    click TC "https://github.com/alphal00p/alphaloop/tree/global_dampening/validation/cards/"
    click TD "https://github.com/alphal00p/alphaloop/blob/global_dampening/LTD/topologies.py"
    click AP "https://github.com/alphal00p/alphaloop/tree/global_dampening/LTD/amplitudes/"
    click UV "https://github.com/alphal00p/alphaloop/tree/global_dampening/uv_cts/"
    click CT "https://github.com/alphal00p/alphaloop/tree/global_dampening/alpha_loop/Templates/"
```
