# alejandrosantorum/scikit-rmt architecture

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

- Interactive diagram: https://gitdiagram.com/alejandrosantorum/scikit-rmt
- Repository: https://github.com/alejandrosantorum/scikit-rmt
- Video tour (about a minute): https://gitdiagram.com/alejandrosantorum/scikit-rmt/video

## Overview

scikit-rmt is a Python library for random-matrix sampling and spectral analysis, with a separate RMT-based image-denoising API. Users sample an ensemble, inspect eigenvalues or histograms, and compare results with spectral laws; image-stack users can denoise with MP-PCA and evaluate image quality. The graph includes the documented ensemble families and laws, plus the sampled Wishart-to-denoiser dependency. Most ensemble implementations were not sampled, so uncertain internal call relationships are omitted.

Main entry points: [`skrmt/ensemble/wishart_ensemble.py`](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/wishart_ensemble.py) (Wishart ensemble), [`skrmt/ensemble/base_ensemble.py`](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/base_ensemble.py) (Ensemble base), [`skrmt/denoise/mp_pca.py`](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/denoise/mp_pca.py) (MP-PCA denoiser), [`skrmt/ensemble/spectral_law.py`](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/spectral_law.py) (Spectral distributions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ensembles["Random ensembles"]
  node_gaussian["Gaussian ensemble"]
  node_wishart["Wishart ensemble"]
  node_manova["Manova ensemble<br/>[manova_ensemble.py]"]
  node_circular["Circular ensemble"]
end

subgraph group_spectra["Spectral laws"]
  node_spectral_laws["Spectral distributions<br/>[spectral_law.py]"]
  node_tw_approx["Tracy-Widom approximation"]
end

subgraph group_denoising["Image denoising"]
  node_denoiser["MP-PCA denoiser<br/>[mp_pca.py]"]
  node_metrics["Image quality metrics<br/>[metrics.py]"]
end

subgraph group_shared["Shared internals"]
  node_base["Ensemble base<br/>[base_ensemble.py]"]
  node_ensemble_utils["Ensemble utilities<br/>[utils.py]"]
  node_tridiagonal["Tridiagonal tools"]
end

node_user(("Python user"))
node_image_stack["Noisy image stack"]
node_denoised_stack["Denoised stack"]
node_quality["Quality scores"]

node_user -->|"sample and analyze"| node_gaussian
node_user -->|"sample and analyze"| node_wishart
node_user -->|"sample and analyze"| node_manova
node_user -->|"sample and analyze"| node_circular
node_gaussian -->|"uses base methods"| node_base
node_wishart -->|"uses base methods"| node_base
node_manova -->|"uses base methods"| node_base
node_circular -->|"uses base methods"| node_base
node_wishart -->|"configures MP law"| node_spectral_laws
node_user -->|"evaluate law"| node_spectral_laws
node_spectral_laws -->|"uses approximation"| node_tw_approx
node_user -->|"provides input"| node_image_stack
node_image_stack -->|"transforms"| node_denoiser
node_denoiser -->|"gets MP edge"| node_wishart
node_denoiser -->|"returns"| node_denoised_stack
node_user -->|"evaluate output"| node_metrics
node_denoised_stack -->|"compared with reference"| node_metrics
node_metrics -->|"returns scores"| node_quality

click node_gaussian "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/gaussian_ensemble.py"
click node_wishart "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/wishart_ensemble.py"
click node_manova "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/manova_ensemble.py"
click node_circular "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/circular_ensemble.py"
click node_base "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/base_ensemble.py"
click node_ensemble_utils "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/utils.py"
click node_tridiagonal "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/tridiagonal_utils.py"
click node_spectral_laws "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/spectral_law.py"
click node_tw_approx "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/tracy_widom_approximator.py"
click node_denoiser "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/denoise/mp_pca.py"
click node_metrics "https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/denoise/metrics.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_gaussian,node_wishart,node_manova,node_circular,node_user toneBlue
class node_spectral_laws,node_tw_approx toneAmber
class node_denoiser,node_metrics toneMint
class node_base,node_ensemble_utils,node_tridiagonal toneRose
class node_image_stack,node_denoised_stack,node_quality toneIndigo
```

## Components

### Random ensembles

- [Gaussian ensemble](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/gaussian_ensemble.py): `skrmt/ensemble/gaussian_ensemble.py`
- [Wishart ensemble](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/wishart_ensemble.py): `skrmt/ensemble/wishart_ensemble.py`
- [Manova ensemble](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/manova_ensemble.py): `skrmt/ensemble/manova_ensemble.py`
- [Circular ensemble](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/circular_ensemble.py): `skrmt/ensemble/circular_ensemble.py`

### Spectral laws

- [Spectral distributions](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/spectral_law.py): `skrmt/ensemble/spectral_law.py`
- [Tracy-Widom approximation](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/tracy_widom_approximator.py): `skrmt/ensemble/tracy_widom_approximator.py`

### Image denoising

- [MP-PCA denoiser](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/denoise/mp_pca.py): `skrmt/denoise/mp_pca.py`
- [Image quality metrics](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/denoise/metrics.py): `skrmt/denoise/metrics.py`

### Shared internals

- [Ensemble base](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/base_ensemble.py): `skrmt/ensemble/base_ensemble.py`
- [Ensemble utilities](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/utils.py): `skrmt/ensemble/utils.py`
- [Tridiagonal tools](https://github.com/alejandrosantorum/scikit-rmt/blob/main/skrmt/ensemble/tridiagonal_utils.py): `skrmt/ensemble/tridiagonal_utils.py`

### Other components

- **Python user**
- **Noisy image stack**
- **Denoised stack**
- **Quality scores**

## Connections

- Python user → Gaussian ensemble: sample and analyze
- Python user → Wishart ensemble: sample and analyze
- Python user → Manova ensemble: sample and analyze
- Python user → Circular ensemble: sample and analyze
- Gaussian ensemble → Ensemble base: uses base methods
- Wishart ensemble → Ensemble base: uses base methods
- Manova ensemble → Ensemble base: uses base methods
- Circular ensemble → Ensemble base: uses base methods
- Wishart ensemble → Spectral distributions: configures MP law
- Python user → Spectral distributions: evaluate law
- Spectral distributions → Tracy-Widom approximation: uses approximation
- Python user → Noisy image stack: provides input
- Noisy image stack → MP-PCA denoiser: transforms
- MP-PCA denoiser → Wishart ensemble: gets MP edge
- MP-PCA denoiser → Denoised stack: returns
- Python user → Image quality metrics: evaluate output
- Denoised stack → Image quality metrics: compared with reference
- Image quality metrics → Quality scores: returns scores
