# sai-krishna-131006/aqft-hardware-aware-optimization architecture

> Architecture diagram of the GitHub repository sai-krishna-131006/aqft-hardware-aware-optimization, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sai-krishna-131006/aqft-hardware-aware-optimization
- Repository: https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization

## Overview

This repository is a quantum-circuit optimization research project. Its main workflow builds exact and approximate QFT circuits, evaluates approximation error, and compares logical and hardware-constrained costs to find configurations within error budgets. Experiments explore degree-based, threshold-based, and selective gate removal; separate analysis and QPU runs extend the evaluation. The graph focuses on evidenced runtime relationships. Some experiment modules and analysis paths are indexed but not excerpted, so their detailed internal wiring is not asserted.

Main entry points: [`src/aqft_builder.py`](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/src/aqft_builder.py) (AQFT variants), [`src/qft_builder.py`](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/src/qft_builder.py) (Exact QFT), [`hardware/run_final_qpu.py`](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/hardware/run_final_qpu.py) (QPU experiment), [`experiments/final_5q_comparison.py`](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/final_5q_comparison.py) (5-qubit comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_construction["Circuit construction"]
  node_qft["Exact QFT<br/>[qft_builder.py]"]
  node_aqft["AQFT variants<br/>[aqft_builder.py]"]
end

subgraph group_experiments["AQFT experiments"]
  node_final5["5-qubit comparison"]
  node_final6["6-qubit comparison"]
  node_final8["8-qubit comparison"]
  node_unified["Unified search"]
  node_degree["Degree sweep<br/>[aqft_degrees.py]"]
  node_threshold["Threshold sweep<br/>[aqft_thresholds.py]"]
  node_fine_threshold["Fine threshold sweep"]
end

subgraph group_hardware["Hardware evaluation"]
  node_transpilation["LNN transpilation"]
  node_hardware_selection["Hardware selection"]
  node_hardware_runner["Hardware experiments"]
end

subgraph group_analysis["Results analysis"]
  node_degree_analysis["Degree analysis<br/>[analyze_degrees.py]"]
  node_threshold_analysis["Threshold analysis"]
  node_tradeoff_analysis["Hardware trade-off analysis"]
  node_transpilation_analysis["Transpilation analysis"]
end

subgraph group_qpu["QPU execution"]
  node_qpu_runner["QPU experiment<br/>[run_final_qpu.py]"]
  node_selection_csv["Selected configurations"]
  node_qpu_results["QPU results"]
end

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

node_researcher -.->|"runs comparison"| node_final5
node_final5 -->|"builds exact QFT"| node_qft
node_final5 -->|"builds AQFT variants"| node_aqft
node_final6 -->|"builds exact QFT"| node_qft
node_final6 -->|"builds AQFT variants"| node_aqft
node_final8 -->|"builds exact QFT"| node_qft
node_final8 -->|"builds AQFT variants"| node_aqft
node_unified -->|"builds exact QFT"| node_qft
node_unified -->|"builds AQFT variants"| node_aqft
node_degree -->|"generates degree variants"| node_aqft
node_threshold -->|"generates threshold variants"| node_aqft
node_fine_threshold -->|"builds threshold circuits"| node_aqft
node_fine_threshold -->|"builds exact circuits"| node_qft
node_transpilation -->|"builds candidate circuits"| node_aqft
node_transpilation -->|"builds exact circuits"| node_qft
node_hardware_selection -.->|"selects configurations"| node_aqft
node_hardware_runner -.->|"evaluates AQFT"| node_aqft
node_researcher -.->|"analyzes results"| node_degree_analysis
node_researcher -.->|"analyzes results"| node_threshold_analysis
node_researcher -.->|"analyzes results"| node_tradeoff_analysis
node_researcher -.->|"analyzes results"| node_transpilation_analysis
node_qpu_runner -->|"reads selections"| node_selection_csv
node_qpu_runner -->|"rebuilds candidates"| node_aqft
node_qpu_runner -->|"submits circuits"| node_ibm_service
node_qpu_runner -->|"writes measurements"| node_qpu_results

click node_qft "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/src/qft_builder.py"
click node_aqft "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/src/aqft_builder.py"
click node_final5 "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/final_5q_comparison.py"
click node_final6 "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/final_6q_selective.py"
click node_final8 "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/final_8q_selective.py"
click node_unified "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/unified_selective_experiment.py"
click node_degree "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/aqft_degrees.py"
click node_threshold "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/aqft_thresholds.py"
click node_fine_threshold "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/fine_threshold_sweep.py"
click node_transpilation "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/transpilation_experiment.py"
click node_hardware_selection "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/hardware_aware_selection.py"
click node_hardware_runner "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/hardware/run_aqft_hardware.py"
click node_degree_analysis "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/analyze_degrees.py"
click node_threshold_analysis "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/analyze_thresholds.py"
click node_tradeoff_analysis "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/analyze_hardware_tradeoff.py"
click node_transpilation_analysis "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/analyze_transpilation.py"
click node_qpu_runner "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/hardware/run_final_qpu.py"
click node_selection_csv "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/results/hardware_aware_selection.csv"
click node_qpu_results "https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/results/aqft_qpu_results.csv"

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_qft,node_aqft toneBlue
class node_final5,node_final6,node_final8,node_unified,node_degree,node_threshold,node_fine_threshold toneAmber
class node_transpilation,node_hardware_selection,node_hardware_runner toneMint
class node_degree_analysis,node_threshold_analysis,node_tradeoff_analysis,node_transpilation_analysis toneRose
class node_qpu_runner,node_selection_csv,node_qpu_results,node_researcher,node_ibm_service toneIndigo
```

## Components

### Circuit construction

- [Exact QFT](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/src/qft_builder.py): `src/qft_builder.py`
- [AQFT variants](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/src/aqft_builder.py): `src/aqft_builder.py`

### AQFT experiments

- [5-qubit comparison](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/final_5q_comparison.py): `experiments/final_5q_comparison.py`
- [6-qubit comparison](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/final_6q_selective.py): `experiments/final_6q_selective.py`
- [8-qubit comparison](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/final_8q_selective.py): `experiments/final_8q_selective.py`
- [Unified search](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/unified_selective_experiment.py): `experiments/unified_selective_experiment.py`
- [Degree sweep](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/aqft_degrees.py): `experiments/aqft_degrees.py`
- [Threshold sweep](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/aqft_thresholds.py): `experiments/aqft_thresholds.py`
- [Fine threshold sweep](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/fine_threshold_sweep.py): `experiments/fine_threshold_sweep.py`

### Hardware evaluation

- [LNN transpilation](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/transpilation_experiment.py): `experiments/transpilation_experiment.py`
- [Hardware selection](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/hardware_aware_selection.py): `experiments/hardware_aware_selection.py`
- [Hardware experiments](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/hardware/run_aqft_hardware.py): `hardware/run_aqft_hardware.py`

### Results analysis

- [Degree analysis](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/analyze_degrees.py): `experiments/analyze_degrees.py`
- [Threshold analysis](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/analyze_thresholds.py): `experiments/analyze_thresholds.py`
- [Hardware trade-off analysis](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/analyze_hardware_tradeoff.py): `experiments/analyze_hardware_tradeoff.py`
- [Transpilation analysis](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/experiments/analyze_transpilation.py): `experiments/analyze_transpilation.py`

### QPU execution

- [QPU experiment](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/hardware/run_final_qpu.py): `hardware/run_final_qpu.py`
- [Selected configurations](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/results/hardware_aware_selection.csv): `results/hardware_aware_selection.csv`
- [QPU results](https://github.com/sai-krishna-131006/aqft-hardware-aware-optimization/blob/main/results/aqft_qpu_results.csv): `results/aqft_qpu_results.csv`

### Other components

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

## Connections

- Researcher → 5-qubit comparison: runs comparison
- 5-qubit comparison → Exact QFT: builds exact QFT (evidence: `experiments/final_5q_comparison.py`)
- 5-qubit comparison → AQFT variants: builds AQFT variants (evidence: `experiments/final_5q_comparison.py`)
- 6-qubit comparison → Exact QFT: builds exact QFT (evidence: `experiments/final_6q_selective.py`)
- 6-qubit comparison → AQFT variants: builds AQFT variants (evidence: `experiments/final_6q_selective.py`)
- 8-qubit comparison → Exact QFT: builds exact QFT (evidence: `experiments/final_8q_selective.py`)
- 8-qubit comparison → AQFT variants: builds AQFT variants (evidence: `experiments/final_8q_selective.py`)
- Unified search → Exact QFT: builds exact QFT (evidence: `experiments/unified_selective_experiment.py`)
- Unified search → AQFT variants: builds AQFT variants (evidence: `experiments/unified_selective_experiment.py`)
- Degree sweep → AQFT variants: generates degree variants (evidence: `experiments/aqft_degrees.py`)
- Threshold sweep → AQFT variants: generates threshold variants (evidence: `experiments/aqft_thresholds.py`)
- Fine threshold sweep → AQFT variants: builds threshold circuits (evidence: `experiments/fine_threshold_sweep.py`)
- Fine threshold sweep → Exact QFT: builds exact circuits (evidence: `experiments/fine_threshold_sweep.py`)
- LNN transpilation → AQFT variants: builds candidate circuits (evidence: `experiments/transpilation_experiment.py`)
- LNN transpilation → Exact QFT: builds exact circuits (evidence: `experiments/transpilation_experiment.py`)
- Hardware selection → AQFT variants: selects configurations
- Hardware experiments → AQFT variants: evaluates AQFT
- Researcher → Degree analysis: analyzes results
- Researcher → Threshold analysis: analyzes results
- Researcher → Hardware trade-off analysis: analyzes results
- Researcher → Transpilation analysis: analyzes results
- QPU experiment → Selected configurations: reads selections (evidence: `hardware/run_final_qpu.py`)
- QPU experiment → AQFT variants: rebuilds candidates (evidence: `hardware/run_final_qpu.py`)
- QPU experiment → IBM Quantum service: submits circuits (evidence: `hardware/run_final_qpu.py`)
- QPU experiment → QPU results: writes measurements (evidence: `hardware/run_final_qpu.py`)
