# nagato-d/berry-curvature-for-photonic-crystals architecture

> Architecture diagram of the GitHub repository nagato-d/berry-curvature-for-photonic-crystals, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nagato-d/berry-curvature-for-photonic-crystals
- Repository: https://github.com/nagato-d/berry-curvature-for-photonic-crystals

## Overview

This repository provides MATLAB LiveLink workflows for computing Berry curvature and Chern numbers for square- and triangular-lattice photonic crystals. For each lattice, the documented workflow is to open the MATLAB Live Script, load its COMSOL model with `mphopen`, and run the code. The README does not map individual calculations to specific helper scripts, so the graph stays at the documented entry-point and result level; source excerpts were not available.

Main entry points: [`Square lattice/Main.mlx`](https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Square%20lattice/Main.mlx) (Square workflow), [`Triangular lattice/Main.mlx`](https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Triangular%20lattice/Main.mlx) (Triangular workflow), [`Square lattice/Gyromagnetic_photonic_crystal.mph`](https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Square%20lattice/Gyromagnetic_photonic_crystal.mph) (COMSOL model), [`Triangular lattice/Gyromagnetic_photonic_crystal.mph`](https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Triangular%20lattice/Gyromagnetic_photonic_crystal.mph) (COMSOL model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_square["Square lattice"]
  node_square_main["Square workflow<br/>[Main.mlx]"]
  node_square_model["COMSOL model"]
  node_square_results["Berry/Chern results"]
end

subgraph group_triangular["Triangular lattice"]
  node_tri_main["Triangular workflow<br/>[Main.mlx]"]
  node_tri_model["COMSOL model"]
  node_tri_results["Berry/Chern results"]
end

node_user(("Researcher"))
node_livelink["MATLAB LiveLink"]

node_user -->|"opens"| node_square_main
node_user -->|"opens"| node_tri_main
node_user -->|"loads with mphopen"| node_square_model
node_user -->|"loads with mphopen"| node_tri_model
node_user -->|"uses"| node_livelink
node_square_main -->|"computes"| node_square_results
node_tri_main -->|"computes"| node_tri_results

click node_square_main "https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Square%20lattice/Main.mlx"
click node_square_model "https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Square%20lattice/Gyromagnetic_photonic_crystal.mph"
click node_tri_main "https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Triangular%20lattice/Main.mlx"
click node_tri_model "https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Triangular%20lattice/Gyromagnetic_photonic_crystal.mph"

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_square_main,node_square_model,node_square_results toneBlue
class node_tri_main,node_tri_model,node_tri_results toneAmber
class node_user,node_livelink toneIndigo
```

## Components

### Square lattice

- [Square workflow](https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Square%20lattice/Main.mlx): `Square lattice/Main.mlx`
- [COMSOL model](https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Square%20lattice/Gyromagnetic_photonic_crystal.mph): `Square lattice/Gyromagnetic_photonic_crystal.mph`
- **Berry/Chern results**

### Triangular lattice

- [Triangular workflow](https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Triangular%20lattice/Main.mlx): `Triangular lattice/Main.mlx`
- [COMSOL model](https://github.com/nagato-d/berry-curvature-for-photonic-crystals/blob/main/Triangular%20lattice/Gyromagnetic_photonic_crystal.mph): `Triangular lattice/Gyromagnetic_photonic_crystal.mph`
- **Berry/Chern results**

### Other components

- **Researcher**
- **MATLAB LiveLink**

## Connections

- Researcher → Square workflow: opens (evidence: `README.md`)
- Researcher → Triangular workflow: opens (evidence: `README.md`)
- Researcher → COMSOL model: loads with mphopen (evidence: `README.md`)
- Researcher → COMSOL model: loads with mphopen (evidence: `README.md`)
- Researcher → MATLAB LiveLink: uses (evidence: `README.md`)
- Square workflow → Berry/Chern results: computes (evidence: `README.md`)
- Triangular workflow → Berry/Chern results: computes (evidence: `README.md`)
