# lbfm-rwth/carat architecture

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

- Interactive diagram: https://gitdiagram.com/lbfm-rwth/carat
- Repository: https://github.com/lbfm-rwth/carat

## Overview

CARAT is a C toolkit for mathematical crystallography, with command-line programs and reusable algorithms for groups, lattices, and their symmetries. A typical user invokes a task-specific program with matrix or group data, computes a classification or transformation, and receives results through the program’s output. The tree identifies distinct workflows for isometry, subgroup and extension analysis, Bravais groups, and Voronoi geometry. The README gives only a high-level product description, and sampled excerpts are incomplete, so links between many command-line entry points and their library algorithms are intentionally not inferred.

Main entry points: [`functions/Matrix`](https://github.com/lbfm-rwth/carat/tree/master/functions/Matrix) (Matrix operations), [`functions/Idem/bravais_catalog.c`](https://github.com/lbfm-rwth/carat/blob/master/functions/Idem/bravais_catalog.c) (Bravais catalog), [`functions/Autgrp/isometry.c`](https://github.com/lbfm-rwth/carat/blob/master/functions/Autgrp/isometry.c) (Isometry program), [`functions/Autgrp`](https://github.com/lbfm-rwth/carat/tree/master/functions/Autgrp) (Automorphisms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Programs and data"]
  node_isometry["Isometry program<br/>[isometry.c]"]
  node_data_io["Group data I/O"]
  node_file_data["Group data files"]
  node_group_database[("Group data lookup")]
end

subgraph group_groups["Group analysis"]
  node_group_aut["Automorphisms"]
  node_bravais["Bravais groups"]
  node_group_names["Group naming"]
  node_presentations["Presentations<br/>[presentation.c]"]
  node_idem_catalog["Bravais catalog<br/>[bravais_catalog.c]"]
end

subgraph group_lattices["Lattice geometry"]
  node_polyhedra["Polyhedra"]
  node_voronoi["Voronoi reduction"]
  node_lattice_reduction["Lattice reduction"]
end

subgraph group_cohomology["Subgroups and extensions"]
  node_subgroup_graph["Subgroup graphs"]
  node_t_subgroups["T-subgroups"]
  node_extensions["Group extensions<br/>[normalop.c]"]
  node_centerings["Centerings<br/>[ZZ_cen_fun.c]"]
end

subgraph group_numerics["Numerical core"]
  node_matrix_ops["Matrix operations"]
  node_integer_ops["Integer matrices"]
end

node_user(("CARAT user"))

node_user -->|"runs"| node_isometry
node_user -->|"supplies data"| node_data_io
node_idem_catalog -->|"loads groups"| node_data_io
node_idem_catalog -->|"locates data"| node_file_data
node_idem_catalog -->|"reads catalog"| node_group_database
node_isometry -->|"computes with"| node_matrix_ops
node_group_aut -->|"uses"| node_matrix_ops
node_bravais -->|"uses"| node_matrix_ops
node_subgroup_graph -->|"uses"| node_matrix_ops
node_extensions -->|"multiplies matrices"| node_matrix_ops
node_centerings -->|"uses"| node_integer_ops
node_voronoi -->|"uses reduction"| node_lattice_reduction
node_polyhedra -->|"uses"| node_matrix_ops
node_presentations -->|"uses generators"| node_group_aut

click node_isometry "https://github.com/lbfm-rwth/carat/blob/master/functions/Autgrp/isometry.c"
click node_data_io "https://github.com/lbfm-rwth/carat/tree/master/functions/Getput"
click node_file_data "https://github.com/lbfm-rwth/carat/tree/master/functions/Datei"
click node_group_aut "https://github.com/lbfm-rwth/carat/tree/master/functions/Autgrp"
click node_bravais "https://github.com/lbfm-rwth/carat/tree/master/functions/Bravais"
click node_group_names "https://github.com/lbfm-rwth/carat/tree/master/functions/Name"
click node_presentations "https://github.com/lbfm-rwth/carat/blob/master/functions/Presentation/presentation.c"
click node_idem_catalog "https://github.com/lbfm-rwth/carat/blob/master/functions/Idem/bravais_catalog.c"
click node_subgroup_graph "https://github.com/lbfm-rwth/carat/tree/master/functions/Graph"
click node_t_subgroups "https://github.com/lbfm-rwth/carat/tree/master/functions/TSubgroups"
click node_extensions "https://github.com/lbfm-rwth/carat/blob/master/functions/Zassen/normalop.c"
click node_centerings "https://github.com/lbfm-rwth/carat/blob/master/functions/ZZ/ZZ_cen_fun.c"
click node_polyhedra "https://github.com/lbfm-rwth/carat/tree/master/functions/Polyeder"
click node_voronoi "https://github.com/lbfm-rwth/carat/tree/master/functions/Voronoi"
click node_lattice_reduction "https://github.com/lbfm-rwth/carat/tree/master/functions/Reduction"
click node_matrix_ops "https://github.com/lbfm-rwth/carat/tree/master/functions/Matrix"
click node_integer_ops "https://github.com/lbfm-rwth/carat/tree/master/functions/Longtools"

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_isometry,node_data_io,node_file_data,node_group_database,node_user toneBlue
class node_group_aut,node_bravais,node_group_names,node_presentations,node_idem_catalog toneAmber
class node_polyhedra,node_voronoi,node_lattice_reduction toneMint
class node_subgroup_graph,node_t_subgroups,node_extensions,node_centerings toneRose
class node_matrix_ops,node_integer_ops toneIndigo
```

## Components

### Programs and data

- [Isometry program](https://github.com/lbfm-rwth/carat/blob/master/functions/Autgrp/isometry.c): `functions/Autgrp/isometry.c`
- [Group data I/O](https://github.com/lbfm-rwth/carat/tree/master/functions/Getput): `functions/Getput`
- [Group data files](https://github.com/lbfm-rwth/carat/tree/master/functions/Datei): `functions/Datei`
- **Group data lookup**

### Group analysis

- [Automorphisms](https://github.com/lbfm-rwth/carat/tree/master/functions/Autgrp): `functions/Autgrp`
- [Bravais groups](https://github.com/lbfm-rwth/carat/tree/master/functions/Bravais): `functions/Bravais`
- [Group naming](https://github.com/lbfm-rwth/carat/tree/master/functions/Name): `functions/Name`
- [Presentations](https://github.com/lbfm-rwth/carat/blob/master/functions/Presentation/presentation.c): `functions/Presentation/presentation.c`
- [Bravais catalog](https://github.com/lbfm-rwth/carat/blob/master/functions/Idem/bravais_catalog.c): `functions/Idem/bravais_catalog.c`

### Lattice geometry

- [Polyhedra](https://github.com/lbfm-rwth/carat/tree/master/functions/Polyeder): `functions/Polyeder`
- [Voronoi reduction](https://github.com/lbfm-rwth/carat/tree/master/functions/Voronoi): `functions/Voronoi`
- [Lattice reduction](https://github.com/lbfm-rwth/carat/tree/master/functions/Reduction): `functions/Reduction`

### Subgroups and extensions

- [Subgroup graphs](https://github.com/lbfm-rwth/carat/tree/master/functions/Graph): `functions/Graph`
- [T-subgroups](https://github.com/lbfm-rwth/carat/tree/master/functions/TSubgroups): `functions/TSubgroups`
- [Group extensions](https://github.com/lbfm-rwth/carat/blob/master/functions/Zassen/normalop.c): `functions/Zassen/normalop.c`
- [Centerings](https://github.com/lbfm-rwth/carat/blob/master/functions/ZZ/ZZ_cen_fun.c): `functions/ZZ/ZZ_cen_fun.c`

### Numerical core

- [Matrix operations](https://github.com/lbfm-rwth/carat/tree/master/functions/Matrix): `functions/Matrix`
- [Integer matrices](https://github.com/lbfm-rwth/carat/tree/master/functions/Longtools): `functions/Longtools`

### Other components

- **CARAT user**

## Connections

- CARAT user → Isometry program: runs
- CARAT user → Group data I/O: supplies data
- Bravais catalog → Group data I/O: loads groups
- Bravais catalog → Group data files: locates data
- Bravais catalog → Group data lookup: reads catalog
- Isometry program → Matrix operations: computes with
- Automorphisms → Matrix operations: uses
- Bravais groups → Matrix operations: uses
- Subgroup graphs → Matrix operations: uses
- Group extensions → Matrix operations: multiplies matrices
- Centerings → Integer matrices: uses
- Voronoi reduction → Lattice reduction: uses reduction
- Polyhedra → Matrix operations: uses
- Presentations → Automorphisms: uses generators
