# napieraj2/quantum architecture

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

- Interactive diagram: https://gitdiagram.com/napieraj2/quantum
- Repository: https://github.com/napieraj2/quantum

## Overview

This repository is a research-simulation project comparing quantum eavesdropping detectors, centered on BB84 and a repeated-secret QFT exchange. Researchers run notebooks or the QFT sweep: the QFT runner expands experimental settings, simulates paired exchange paths, evaluates alarm and recovery outcomes, and saves sweep tables for plotting. Separate capabilities cover alarm schedules and reset policies, channel-drift experiments, and BB84 validation. The gate-baseline notebook supplies readout calibration, optionally informed by IBM hardware. Edges are limited to README statements and shown imports or references; several notebook and decoder details were not sampled.

Main entry points: [`quantum_study/qft_sweep.py`](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_sweep.py) (Paired sweep runner), [`quantum_study/qft_study.py`](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_study.py) (Paired QFT study), [`quantum_study/qft_sweep_scoring.py`](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_sweep_scoring.py) (Alarm and recovery scoring), [`quantum_study/qft_exchange.py`](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_exchange.py) (QFT exchange simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bb84["BB84 detector study"]
  node_bb84_notebook["BB84 notebook<br/>[BB84.ipynb]"]
  node_bb84_model["BB84 detector model<br/>[bb84.py]"]
  node_bb84_validation["Independent BB84 validation"]
end

subgraph group_qft["QFT exchange study"]
  node_qft_notebook["Repeated-secret notebook"]
  node_qft_exchange["QFT exchange simulator<br/>[qft_exchange.py]"]
  node_qft_decoder["QFT decoder<br/>[qft_decoder.py]"]
  node_qft_study["Paired QFT study<br/>[qft_study.py]"]
  node_qft_alarm["Alarm schedules and response<br/>[qft_alarm.py]"]
end

subgraph group_sweep["Paired sweep analysis"]
  node_sweep_runner["Paired sweep runner<br/>[qft_sweep.py]"]
  node_sweep_grid["Sweep settings and schedules<br/>[qft_sweep_grid.py]"]
  node_sweep_scoring["Alarm and recovery scoring"]
  node_sweep_plot["Sweep results plotting<br/>[plot_qft_sweep.py]"]
  node_channel_drift["Channel drift experiment"]
end

subgraph group_calibration["Calibration and validation"]
  node_gate_notebook["Gate baseline notebook"]
  node_account_setup["IBM account setup<br/>[qkd_connect.py]"]
end

node_researcher(("Researcher"))
node_ibm_quantum{{"IBM Quantum service"}}

node_researcher -->|"runs"| node_bb84_notebook
node_bb84_notebook -->|"uses model"| node_bb84_model
node_researcher -->|"runs"| node_qft_notebook
node_qft_notebook -->|"runs study"| node_qft_study
node_qft_study -->|"simulates paths"| node_qft_exchange
node_qft_study -->|"uses schedules"| node_sweep_grid
node_qft_study -->|"uses scoring"| node_sweep_scoring
node_qft_alarm -->|"simulates paths"| node_qft_exchange
node_qft_alarm -->|"uses helpers"| node_qft_study
node_qft_alarm -->|"builds looks"| node_sweep_grid
node_qft_alarm -->|"replays alarms"| node_sweep_scoring
node_sweep_runner -->|"builds settings"| node_sweep_grid
node_sweep_runner -->|"simulates trials"| node_qft_exchange
node_sweep_runner -->|"uses study logic"| node_qft_study
node_sweep_runner -->|"scores outcomes"| node_sweep_scoring
node_sweep_scoring -->|"uses exchange constants"| node_qft_exchange
node_sweep_scoring -->|"uses schedules"| node_sweep_grid
node_sweep_runner -.->|"writes sweep tables"| node_sweep_plot
node_researcher -->|"plots results"| node_sweep_plot
node_channel_drift -->|"uses exchange helpers"| node_qft_exchange
node_channel_drift -->|"fits alarm rules"| node_sweep_scoring
node_researcher -->|"runs baseline"| node_gate_notebook
node_gate_notebook -.->|"submits circuits"| node_ibm_quantum
node_researcher -->|"configures access"| node_account_setup
node_account_setup -->|"verifies account"| node_ibm_quantum
node_gate_notebook -->|"provides readout baseline"| node_sweep_runner
node_bb84_validation -.->|"checks independently"| node_bb84_model

click node_bb84_notebook "https://github.com/napieraj2/quantum/blob/main/BB84.ipynb"
click node_bb84_model "https://github.com/napieraj2/quantum/blob/main/quantum_study/bb84.py"
click node_bb84_validation "https://github.com/napieraj2/quantum/blob/main/validation/independent_bb84_validation.py"
click node_qft_notebook "https://github.com/napieraj2/quantum/blob/main/QFT_Repeated_Secret.ipynb"
click node_qft_exchange "https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_exchange.py"
click node_qft_decoder "https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_decoder.py"
click node_qft_study "https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_study.py"
click node_qft_alarm "https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_alarm.py"
click node_sweep_runner "https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_sweep.py"
click node_sweep_grid "https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_sweep_grid.py"
click node_sweep_scoring "https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_sweep_scoring.py"
click node_sweep_plot "https://github.com/napieraj2/quantum/blob/main/validation/plot_qft_sweep.py"
click node_channel_drift "https://github.com/napieraj2/quantum/blob/main/future_work/qft_channel_drift.py"
click node_gate_notebook "https://github.com/napieraj2/quantum/blob/main/Gate_Baseline.ipynb"
click node_account_setup "https://github.com/napieraj2/quantum/blob/main/qkd_connect.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_bb84_notebook,node_bb84_model,node_bb84_validation toneBlue
class node_qft_notebook,node_qft_exchange,node_qft_decoder,node_qft_study,node_qft_alarm toneAmber
class node_sweep_runner,node_sweep_grid,node_sweep_scoring,node_sweep_plot,node_channel_drift toneMint
class node_gate_notebook,node_account_setup toneRose
class node_researcher,node_ibm_quantum toneIndigo
```

## Components

### BB84 detector study

- [BB84 notebook](https://github.com/napieraj2/quantum/blob/main/BB84.ipynb): `BB84.ipynb`
- [BB84 detector model](https://github.com/napieraj2/quantum/blob/main/quantum_study/bb84.py): `quantum_study/bb84.py`
- [Independent BB84 validation](https://github.com/napieraj2/quantum/blob/main/validation/independent_bb84_validation.py): `validation/independent_bb84_validation.py`

### QFT exchange study

- [Repeated-secret notebook](https://github.com/napieraj2/quantum/blob/main/QFT_Repeated_Secret.ipynb): `QFT_Repeated_Secret.ipynb`
- [QFT exchange simulator](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_exchange.py): `quantum_study/qft_exchange.py`
- [QFT decoder](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_decoder.py): `quantum_study/qft_decoder.py`
- [Paired QFT study](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_study.py): `quantum_study/qft_study.py`
- [Alarm schedules and response](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_alarm.py): `quantum_study/qft_alarm.py`

### Paired sweep analysis

- [Paired sweep runner](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_sweep.py): `quantum_study/qft_sweep.py`
- [Sweep settings and schedules](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_sweep_grid.py): `quantum_study/qft_sweep_grid.py`
- [Alarm and recovery scoring](https://github.com/napieraj2/quantum/blob/main/quantum_study/qft_sweep_scoring.py): `quantum_study/qft_sweep_scoring.py`
- [Sweep results plotting](https://github.com/napieraj2/quantum/blob/main/validation/plot_qft_sweep.py): `validation/plot_qft_sweep.py`
- [Channel drift experiment](https://github.com/napieraj2/quantum/blob/main/future_work/qft_channel_drift.py): `future_work/qft_channel_drift.py`

### Calibration and validation

- [Gate baseline notebook](https://github.com/napieraj2/quantum/blob/main/Gate_Baseline.ipynb): `Gate_Baseline.ipynb`
- [IBM account setup](https://github.com/napieraj2/quantum/blob/main/qkd_connect.py): `qkd_connect.py`

### Other components

- **Researcher**
- **IBM Quantum service**

## Connections

- Researcher → BB84 notebook: runs (evidence: `README.md`)
- BB84 notebook → BB84 detector model: uses model (evidence: `quantum_study/bb84.py`)
- Researcher → Repeated-secret notebook: runs (evidence: `README.md`)
- Repeated-secret notebook → Paired QFT study: runs study (evidence: `quantum_study/qft_study.py`)
- Paired QFT study → QFT exchange simulator: simulates paths (evidence: `quantum_study/qft_study.py`)
- Paired QFT study → Sweep settings and schedules: uses schedules (evidence: `quantum_study/qft_study.py`)
- Paired QFT study → Alarm and recovery scoring: uses scoring (evidence: `quantum_study/qft_study.py`)
- Alarm schedules and response → QFT exchange simulator: simulates paths (evidence: `quantum_study/qft_alarm.py`)
- Alarm schedules and response → Paired QFT study: uses helpers (evidence: `quantum_study/qft_alarm.py`)
- Alarm schedules and response → Sweep settings and schedules: builds looks (evidence: `quantum_study/qft_alarm.py`)
- Alarm schedules and response → Alarm and recovery scoring: replays alarms (evidence: `quantum_study/qft_alarm.py`)
- Paired sweep runner → Sweep settings and schedules: builds settings (evidence: `quantum_study/qft_sweep.py`)
- Paired sweep runner → QFT exchange simulator: simulates trials (evidence: `quantum_study/qft_sweep.py`)
- Paired sweep runner → Paired QFT study: uses study logic (evidence: `quantum_study/qft_sweep.py`)
- Paired sweep runner → Alarm and recovery scoring: scores outcomes (evidence: `quantum_study/qft_sweep.py`)
- Alarm and recovery scoring → QFT exchange simulator: uses exchange constants (evidence: `quantum_study/qft_sweep_scoring.py`)
- Alarm and recovery scoring → Sweep settings and schedules: uses schedules (evidence: `quantum_study/qft_sweep_scoring.py`)
- Paired sweep runner → Sweep results plotting: writes sweep tables
- Researcher → Sweep results plotting: plots results (evidence: `README.md`)
- Channel drift experiment → QFT exchange simulator: uses exchange helpers (evidence: `future_work/qft_channel_drift.py`)
- Channel drift experiment → Alarm and recovery scoring: fits alarm rules (evidence: `future_work/qft_channel_drift.py`)
- Researcher → Gate baseline notebook: runs baseline (evidence: `README.md`)
- Gate baseline notebook → IBM Quantum service: submits circuits (evidence: `README.md`)
- Researcher → IBM account setup: configures access (evidence: `qkd_connect.py`)
- IBM account setup → IBM Quantum service: verifies account (evidence: `qkd_connect.py`)
- Gate baseline notebook → Paired sweep runner: provides readout baseline (evidence: `README.md`)
- Independent BB84 validation → BB84 detector model: checks independently
