# tsuyoshiokubo/introduction-to-tensor-network architecture

> Architecture diagram of the GitHub repository tsuyoshiokubo/introduction-to-tensor-network, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tsuyoshiokubo/introduction-to-tensor-network
- Repository: https://github.com/tsuyoshiokubo/introduction-to-tensor-network

## Overview

##### Project type and purpose
- This is an educational scientific‐computing repository (“Introduction to Tensor Networks”) designed to teach 2D Ising model simulations via:
- Monte Carlo (Exercise 0)
- Tensor Renormalization Group (Exercise 1)
- Infinite Time‐Evolving Block Decimation (Exercise 2)
- Structure: Jupyter notebooks orchestrate experiments, Python library modules implement algorithms, and data files capture reference (“exact_output”) and experiment results (“outputs”).

##### File structure
- Top‐level:
- .gitignore, README.md, PDFs of slides
- Exercise/
– Ex*.ipynb (notebooks for each exercise)
– Ising_lib.py, TRG_lib.py, classical_iTEBD_lib.py (core algorithm modules)
– exact_output/ (precomputed reference data)
– outputs/ (directories for each method’s generated data)
- Pattern: modular libraries provide core routines; notebooks import them, read inputs, run simulations, and write outputs.

##### Key insights from README
- Each notebook is self‐contained but depends on the corresponding library file.
- Notebooks are intended for Google Colab, so there is also an implied external environment (Jupyter/Colab + standard Python scientific stack).

## Diagram (Mermaid)

```mermaid
flowchart TB
    ENV["External Environment\nPython 3.x & Jupyter/Colab\n(Numpy, SciPy, Matplotlib)"]:::external

    subgraph "Orchestration Layer"
        direction TB
        NB0_1["Ex0-1.ipynb (MC)"]:::notebook
        NB0_2["Ex0-2.ipynb (MC)"]:::notebook
        NB0_3["Ex0-3.ipynb (MC)"]:::notebook
        NB1_1["Ex1-1.ipynb (TRG)"]:::notebook
        NB1_2["Ex1-2.ipynb (TRG)"]:::notebook
        NB1_3["Ex1-3.ipynb (TRG)"]:::notebook
        NB2_1["Ex2-1.ipynb (iTEBD)"]:::notebook
        NB2_2["Ex2-2.ipynb (iTEBD)"]:::notebook
    end

    subgraph "Algorithm Modules"
        direction TB
        M1["Ising_lib.py\n(MC routines)"]:::module
        M2["TRG_lib.py\n(Tensor RG routines)"]:::module
        M3["classical_iTEBD_lib.py\n(iTEBD routines)"]:::module
    end

    subgraph "Data Stores"
        direction TB
        R["exact_output/\n(Reference Data)"]:::data
        subgraph "Outputs"
            direction TB
            O1["mc_output/\n(Monte Carlo Results)"]:::data
            O2["trg_output/\n(TRG Results)"]:::data
            O3["iTEBD_output/\n(iTEBD Results)"]:::data
        end
    end

    Doc1["テンソルネットワーク法入門.pdf"]:::doc
    Doc2["テンソルネットワーク法入門（実習）.pdf"]:::doc

    ENV -->|"provides runtime & libraries"| NB0_1
    ENV -->|"provides runtime & libraries"| NB0_2
    ENV -->|"provides runtime & libraries"| NB0_3
    ENV -->|"provides runtime & libraries"| NB1_1
    ENV -->|"provides runtime & libraries"| NB1_2
    ENV -->|"provides runtime & libraries"| NB1_3
    ENV -->|"provides runtime & libraries"| NB2_1
    ENV -->|"provides runtime & libraries"| NB2_2
    ENV -->|"provides runtime & libraries"| M1
    ENV -->|"provides runtime & libraries"| M2
    ENV -->|"provides runtime & libraries"| M3

    NB0_1 -->|"imports"| M1
    NB0_2 -->|"imports"| M1
    NB0_3 -->|"imports"| M1
    NB1_1 -->|"imports"| M2
    NB1_2 -->|"imports"| M2
    NB1_3 -->|"imports"| M2
    NB2_1 -->|"imports"| M3
    NB2_2 -->|"imports"| M3

    NB0_1 -->|"reads"| R
    NB0_2 -->|"reads"| R
    NB0_3 -->|"reads"| R
    NB1_1 -->|"reads"| R
    NB1_2 -->|"reads"| R
    NB1_3 -->|"reads"| R
    NB2_1 -->|"reads"| R
    NB2_2 -->|"reads"| R

    NB0_1 -->|"writes"| O1
    NB0_2 -->|"writes"| O1
    NB0_3 -->|"writes"| O1
    NB1_1 -->|"writes"| O2
    NB1_2 -->|"writes"| O2
    NB1_3 -->|"writes"| O2
    NB2_1 -->|"writes"| O3
    NB2_2 -->|"writes"| O3

    Doc1 -.->|"reference"| ENV
    Doc2 -.->|"reference"| ENV

    click ENV "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/.gitignore"
    click NB0_1 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ex0-1.ipynb"
    click NB0_2 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ex0-2.ipynb"
    click NB0_3 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ex0-3.ipynb"
    click NB1_1 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ex1-1.ipynb"
    click NB1_2 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ex1-2.ipynb"
    click NB1_3 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ex1-3.ipynb"
    click NB2_1 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ex2-1.ipynb"
    click NB2_2 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ex2-2.ipynb"
    click M1 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/Ising_lib.py"
    click M2 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/TRG_lib.py"
    click M3 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/Exercise/classical_iTEBD_lib.py"
    click R "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/tree/main/Exercise/exact_output/"
    click O1 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/tree/main/Exercise/outputs/mc_output/"
    click O2 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/tree/main/Exercise/outputs/trg_output/"
    click O3 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/tree/main/Exercise/outputs/iTEBD_output/"
    click Doc1 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/計算物理春の学校2023：テンソルネットワーク法入門.pdf"
    click Doc2 "https://github.com/tsuyoshiokubo/introduction-to-tensor-network/blob/main/計算物理春の学校2023：テンソルネットワーク法入門（実習）.pdf"

    classDef external fill:#DDDDDD,stroke:#888,stroke-width:1px
    classDef doc fill:#FFEB99,stroke:#888,stroke-width:1px
    classDef notebook fill:#FFA500,stroke:#888,stroke-width:1px
    classDef module fill:#ADD8E6,stroke:#888,stroke-width:1px
    classDef data fill:#90EE90,stroke:#888,stroke-width:1px
```
