# one-eyed-warrior/qsvm architecture

> Architecture diagram of the GitHub repository one-eyed-warrior/qsvm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/one-eyed-warrior/qsvm
- Repository: https://github.com/one-eyed-warrior/qsvm

## Overview

##### Project type and purpose
- This is a small, notebook‐driven quantum computing mini project for coursework (21CSE306J).
- It loads tabular datasets (X_train_4000.txt, Y_train_4000.txt, X_test_4000.txt, Y_test_4000.txt, training_observables.csv), processes them, builds and trains a quantum (or hybrid quantum–classical) model in a Jupyter notebook, and then evaluates results.

##### File structure
- Top level:
- README.md – project description
- code.ipynb – the sole orchestration script, containing data ingestion, preprocessing, model definition, training, and evaluation cells
- *.txt and *.csv – raw input datasets
- No separate “src/” or “lib/” directories; the notebook itself implements every step.

##### README
- One‐line description: “Mini project for coursework in 21CSE306J Quantum Computing.”

a. Main components
- Data Layer: raw files (X_train, Y_train, X_test, Y_test, observables.csv)
- Preprocessing Module: notebook cells that load data (pandas/numpy), clean/transform as needed
- Quantum Model Module: cells that define quantum circuits (e.g., Qiskit or PennyLane), parameters, and trainer loop
- Execution Backend: quantum simulator or real quantum hardware API (e.g., IBM Q, local Aer simulator)
- Evaluation Module: notebook cells that compute metrics (accuracy, loss curves) and plot results (matplotlib/plotly)
- User Interface/Notebook: Jupyter environment hosting all of the above, interacting with the user

b. Relationships and interactions

c. Architectural patterns/design principles
- Pipeline pattern: clear sequential stages (ingest → process → compute → evaluate)
- Separation of concerns (data vs. model vs. evaluation), albeit all within one notebook
- External service integration (quantum hardware/simulator via API)

d. Key technologies/frameworks
- Python, Jupyter Notebook
- pandas, numpy for data handling
- Qiskit (or PennyLane) for quantum circuit definition and execution
- matplotlib or plotly for visualization
- IBM Q or other cloud‑based quantum backends (if used)

##### Elements
- Call out major libraries next to each component (e.g., “pandas/numpy” next to Preprocessing, “Qiskit” next to Quantum Model, “matplotlib” next to Evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Project Description"
        RD["README.md"]:::doc
    end

    subgraph "Data Layer"
        Xtr["X_train_4000.txt"]:::data
        Ytr["Y_train_4000.txt"]:::data
        Xte["X_test_4000.txt"]:::data
        Yte["Y_test_4000.txt"]:::data
        Obs["training_observables.csv"]:::data
    end

    Proc["Preprocessing\n(pandas/numpy)"]:::pre
    QModel["Quantum Model\n(Qiskit/PennyLane)"]:::model
    Backend["Execution Backend\n(IBM Q / Aer Simulator)"]:::backend
    Eval["Evaluation\n(matplotlib/plotly)"]:::eval
    Notebook["Jupyter Notebook\n(code.ipynb)"]:::ui

    RD -->|"describes"| Notebook
    Notebook -->|"loads data"| Xtr
    Notebook -->|"loads data"| Ytr
    Notebook -->|"loads data"| Xte
    Notebook -->|"loads data"| Yte
    Notebook -->|"loads data"| Obs

    Xtr -->|"data flow"| Proc
    Ytr -->|"data flow"| Proc
    Xte -->|"data flow"| Proc
    Yte -->|"data flow"| Proc
    Obs -->|"data flow"| Proc

    Proc -->|"processed data"| QModel
    QModel -->|"circuit execution"| Backend
    Backend -->|"results"| Eval
    Eval -->|"plots & metrics"| Notebook

    click RD "https://github.com/one-eyed-warrior/qsvm/blob/main/README.md"
    click Xtr "https://github.com/one-eyed-warrior/qsvm/blob/main/X_train_4000.txt"
    click Ytr "https://github.com/one-eyed-warrior/qsvm/blob/main/Y_train_4000.txt"
    click Xte "https://github.com/one-eyed-warrior/qsvm/blob/main/X_test_4000.txt"
    click Yte "https://github.com/one-eyed-warrior/qsvm/blob/main/Y_test_4000.txt"
    click Obs "https://github.com/one-eyed-warrior/qsvm/blob/main/training_observables.csv"
    click Proc "https://github.com/one-eyed-warrior/qsvm/blob/main/code.ipynb"
    click QModel "https://github.com/one-eyed-warrior/qsvm/blob/main/code.ipynb"
    click Backend "https://github.com/one-eyed-warrior/qsvm/blob/main/code.ipynb"
    click Eval "https://github.com/one-eyed-warrior/qsvm/blob/main/code.ipynb"
    click Notebook "https://github.com/one-eyed-warrior/qsvm/blob/main/code.ipynb"

    classDef data fill:#f9c,stroke:#333,stroke-width:1px;
    classDef pre fill:#ff9,stroke:#333,stroke-width:1px;
    classDef model fill:#9ff,stroke:#333,stroke-width:1px;
    classDef backend fill:#fc9,stroke:#333,stroke-width:1px;
    classDef eval fill:#c9f,stroke:#333,stroke-width:1px;
    classDef ui fill:#9f9,stroke:#333,stroke-width:1px;
    classDef doc fill:#ddd,stroke:#666,stroke-width:1px;
```
