# amchecker/amcheck architecture

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

- Interactive diagram: https://gitdiagram.com/amchecker/amcheck
- Repository: https://github.com/amchecker/amcheck

## Overview

amcheck is a Python library and interactive command-line tool for classifying compensated magnetic crystal structures as altermagnetic or antiferromagnetic, with an additional Anomalous Hall coefficient analysis mode. The main workflow reads a structure, identifies symmetry-related atom orbits, gathers magnetic assignments, and checks the symmetry relation between opposite-spin sublattices. The library also exposes the classification and tensor helpers. The README documents the Hall-analysis stages; the single implementation file is only partially excerpted, so some internal call relationships are not shown.

Main entry points: [`amcheck/amcheck.py`](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py) (Altermagnet checker), [`amcheck/__init__.py`](https://github.com/amchecker/amcheck/blob/main/amcheck/__init__.py) (Public API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line workflow"]
  node_cli_entry["CLI entry<br/>[amcheck.py]"]
  node_structure_read["Structure reading<br/>[amcheck.py]"]
  node_symmetry["Space-group symmetry<br/>[amcheck.py]"]
  node_orbit_input["Orbit spin input<br/>[amcheck.py]"]
end

subgraph group_classification["Altermagnet classification"]
  node_classifier["Altermagnet checker<br/>[amcheck.py]"]
  node_classification_result["Classification result<br/>[amcheck.py]"]
end

subgraph group_hall["Hall analysis"]
  node_hall_input["Moment input<br/>[amcheck.py]"]
  node_magnetic_group["Magnetic space group<br/>[amcheck.py]"]
  node_conductivity["Conductivity tensor<br/>[amcheck.py]"]
  node_hall_result["Hall vector<br/>[amcheck.py]"]
end

subgraph group_library["Library API"]
  node_library_api["Public API<br/>[__init__.py]"]
  node_library_helpers["Tensor helpers<br/>[amcheck.py]"]
end

node_user(("User"))
node_structure["Crystal structure"]
node_library_user(("Library caller"))

node_user -->|"runs"| node_cli_entry
node_structure -->|"provides input"| node_structure_read
node_cli_entry -->|"reads files"| node_structure_read
node_structure_read -->|"analyzes symmetry"| node_symmetry
node_symmetry -->|"groups atoms"| node_orbit_input
node_user -->|"assigns spins"| node_orbit_input
node_orbit_input -->|"supplies pattern"| node_classifier
node_symmetry -.->|"supplies operations"| node_classifier
node_classifier -->|"returns classification"| node_classification_result
node_user -->|"provides moments"| node_hall_input
node_hall_input -->|"determines group"| node_magnetic_group
node_magnetic_group -->|"constrains tensor"| node_conductivity
node_conductivity -->|"yields Hall vector"| node_hall_result
node_library_user -->|"imports"| node_library_api
node_library_api -->|"exposes checker"| node_classifier
node_library_api -->|"exposes helpers"| node_library_helpers

click node_cli_entry "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_structure_read "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_symmetry "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_orbit_input "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_classifier "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_classification_result "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_hall_input "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_magnetic_group "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_conductivity "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_hall_result "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py"
click node_library_api "https://github.com/amchecker/amcheck/blob/main/amcheck/__init__.py"
click node_library_helpers "https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.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_cli_entry,node_structure_read,node_symmetry,node_orbit_input,node_user toneBlue
class node_classifier,node_classification_result toneAmber
class node_hall_input,node_magnetic_group,node_conductivity,node_hall_result toneMint
class node_library_api,node_library_helpers toneRose
class node_structure,node_library_user toneIndigo
```

## Components

### Command-line workflow

- [CLI entry](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`
- [Structure reading](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`
- [Space-group symmetry](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`
- [Orbit spin input](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`

### Altermagnet classification

- [Altermagnet checker](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`
- [Classification result](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`

### Hall analysis

- [Moment input](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`
- [Magnetic space group](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`
- [Conductivity tensor](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`
- [Hall vector](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`

### Library API

- [Public API](https://github.com/amchecker/amcheck/blob/main/amcheck/__init__.py): `amcheck/__init__.py`
- [Tensor helpers](https://github.com/amchecker/amcheck/blob/main/amcheck/amcheck.py): `amcheck/amcheck.py`

### Other components

- **User**
- **Crystal structure**
- **Library caller**

## Connections

- User → CLI entry: runs (evidence: `README.md`)
- Crystal structure → Structure reading: provides input (evidence: `README.md`)
- CLI entry → Structure reading: reads files (evidence: `amcheck/amcheck.py`)
- Structure reading → Space-group symmetry: analyzes symmetry (evidence: `amcheck/amcheck.py`)
- Space-group symmetry → Orbit spin input: groups atoms (evidence: `README.md`)
- User → Orbit spin input: assigns spins (evidence: `README.md`)
- Orbit spin input → Altermagnet checker: supplies pattern (evidence: `README.md`)
- Space-group symmetry → Altermagnet checker: supplies operations (evidence: `amcheck/amcheck.py`)
- Altermagnet checker → Classification result: returns classification (evidence: `README.md`)
- User → Moment input: provides moments (evidence: `README.md`)
- Moment input → Magnetic space group: determines group (evidence: `README.md`)
- Magnetic space group → Conductivity tensor: constrains tensor (evidence: `README.md`)
- Conductivity tensor → Hall vector: yields Hall vector (evidence: `README.md`)
- Library caller → Public API: imports (evidence: `README.md`)
- Public API → Altermagnet checker: exposes checker (evidence: `amcheck/__init__.py`)
- Public API → Tensor helpers: exposes helpers (evidence: `amcheck/__init__.py`)
