# openmopac/mopac architecture

> Architecture diagram of the GitHub repository openmopac/mopac, 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/openmopac/mopac
- Repository: https://github.com/openmopac/mopac

## Overview

MOPAC is a semiempirical quantum-chemistry program for molecular and materials calculations. The principal workflow reads a molecular system from input, performs an electronic-structure calculation, optionally relaxes geometry or computes vibrational properties, and emits results. It also exposes a diskless API for selected calculations and for running conventional input files; API state can be reused between calculations. The map reflects documented capabilities and the source tree’s module boundaries; implementation excerpts were limited to the public API header and partial build configuration, so detailed internal call wiring is not asserted.

Main entry points: [`src/properties`](https://github.com/openmopac/mopac/tree/main/src/properties) (Physical properties), [`include/mopac.h`](https://github.com/openmopac/mopac/blob/main/include/mopac.h) (C API), [`src/SCF`](https://github.com/openmopac/mopac/tree/main/src/SCF) (MOPAC SCF), [`src/integrals`](https://github.com/openmopac/mopac/tree/main/src/integrals) (Integrals and matrices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_execution["Execution interfaces"]
  node_cli["Command-line program"]
  node_api["C API<br/>[mopac.h]"]
  node_input["Input processing"]
end

subgraph group_modeling["Electronic structure"]
  node_chemistry["Chemical systems"]
  node_models["Semiempirical models"]
  node_parameters["Model parameters"]
  node_integrals["Integrals and matrices"]
  node_scf["MOPAC SCF"]
  node_mozyme["MOZYME SCF"]
  node_indo["INDO method"]
end

subgraph group_calculation["Calculation stages"]
  node_geometry["Geometry processing"]
  node_optimization["Geometry optimization"]
  node_forces["Forces and gradients"]
  node_reactions["Reaction calculations"]
  node_solvation["Solvation models"]
  node_corrections["Energy corrections"]
end

subgraph group_results["Results and properties"]
  node_properties["Physical properties"]
  node_output["Result output"]
end

subgraph group_resources["Scientific resources"]
  node_data["Parameter and benchmark data"]
end

node_user(("User or client"))

node_user -->|"runs calculation"| node_cli
node_user -->|"calls API"| node_api
node_cli -->|"processes input"| node_input
node_api -->|"runs input file"| node_input
node_api -->|"requests SCF"| node_scf
node_api -->|"requests MOZYME"| node_mozyme
node_api -->|"requests relaxation"| node_optimization
node_api -->|"requests vibrations"| node_properties
node_input -->|"supplies system"| node_geometry
node_geometry -->|"defines system"| node_chemistry
node_models -->|"uses parameters"| node_parameters
node_chemistry -->|"provides structure"| node_integrals
node_models -->|"selects model"| node_integrals
node_integrals -->|"provides integrals"| node_scf
node_integrals -->|"provides integrals"| node_mozyme
node_scf -.->|"supports method"| node_indo
node_scf -->|"calculates gradients"| node_forces
node_scf -->|"produces properties"| node_properties
node_mozyme -->|"produces properties"| node_properties
node_optimization -->|"uses gradients"| node_forces
node_reactions -->|"calculates properties"| node_properties
node_solvation -->|"contributes properties"| node_properties
node_corrections -->|"corrects results"| node_properties
node_properties -->|"formats results"| node_output
node_parameters -.->|"uses datasets"| node_data

click node_cli "https://github.com/openmopac/mopac/tree/main/src/interface"
click node_api "https://github.com/openmopac/mopac/blob/main/include/mopac.h"
click node_input "https://github.com/openmopac/mopac/tree/main/src/input"
click node_chemistry "https://github.com/openmopac/mopac/tree/main/src/chemistry"
click node_models "https://github.com/openmopac/mopac/tree/main/src/models"
click node_parameters "https://github.com/openmopac/mopac/tree/main/src/PARAM"
click node_integrals "https://github.com/openmopac/mopac/tree/main/src/integrals"
click node_scf "https://github.com/openmopac/mopac/tree/main/src/SCF"
click node_mozyme "https://github.com/openmopac/mopac/tree/main/src/MOZYME"
click node_indo "https://github.com/openmopac/mopac/tree/main/src/INDO"
click node_geometry "https://github.com/openmopac/mopac/tree/main/src/geometry"
click node_optimization "https://github.com/openmopac/mopac/tree/main/src/optimization"
click node_forces "https://github.com/openmopac/mopac/tree/main/src/forces"
click node_reactions "https://github.com/openmopac/mopac/tree/main/src/reactions"
click node_solvation "https://github.com/openmopac/mopac/tree/main/src/solvation"
click node_corrections "https://github.com/openmopac/mopac/tree/main/src/corrections"
click node_properties "https://github.com/openmopac/mopac/tree/main/src/properties"
click node_output "https://github.com/openmopac/mopac/tree/main/src/output"
click node_data "https://github.com/openmopac/mopac/tree/main/data"

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,node_api,node_input,node_user toneBlue
class node_chemistry,node_models,node_parameters,node_integrals,node_scf,node_mozyme,node_indo toneAmber
class node_geometry,node_optimization,node_forces,node_reactions,node_solvation,node_corrections toneMint
class node_properties,node_output toneRose
class node_data toneIndigo
```

## Components

### Execution interfaces

- [Command-line program](https://github.com/openmopac/mopac/tree/main/src/interface): `src/interface`
- [C API](https://github.com/openmopac/mopac/blob/main/include/mopac.h): `include/mopac.h`
- [Input processing](https://github.com/openmopac/mopac/tree/main/src/input): `src/input`

### Electronic structure

- [Chemical systems](https://github.com/openmopac/mopac/tree/main/src/chemistry): `src/chemistry`
- [Semiempirical models](https://github.com/openmopac/mopac/tree/main/src/models): `src/models`
- [Model parameters](https://github.com/openmopac/mopac/tree/main/src/PARAM): `src/PARAM`
- [Integrals and matrices](https://github.com/openmopac/mopac/tree/main/src/integrals): `src/integrals`
- [MOPAC SCF](https://github.com/openmopac/mopac/tree/main/src/SCF): `src/SCF`
- [MOZYME SCF](https://github.com/openmopac/mopac/tree/main/src/MOZYME): `src/MOZYME`
- [INDO method](https://github.com/openmopac/mopac/tree/main/src/INDO): `src/INDO`

### Calculation stages

- [Geometry processing](https://github.com/openmopac/mopac/tree/main/src/geometry): `src/geometry`
- [Geometry optimization](https://github.com/openmopac/mopac/tree/main/src/optimization): `src/optimization`
- [Forces and gradients](https://github.com/openmopac/mopac/tree/main/src/forces): `src/forces`
- [Reaction calculations](https://github.com/openmopac/mopac/tree/main/src/reactions): `src/reactions`
- [Solvation models](https://github.com/openmopac/mopac/tree/main/src/solvation): `src/solvation`
- [Energy corrections](https://github.com/openmopac/mopac/tree/main/src/corrections): `src/corrections`

### Results and properties

- [Physical properties](https://github.com/openmopac/mopac/tree/main/src/properties): `src/properties`
- [Result output](https://github.com/openmopac/mopac/tree/main/src/output): `src/output`

### Scientific resources

- [Parameter and benchmark data](https://github.com/openmopac/mopac/tree/main/data): `data`

### Other components

- **User or client**

## Connections

- User or client → Command-line program: runs calculation
- User or client → C API: calls API
- Command-line program → Input processing: processes input
- C API → Input processing: runs input file
- C API → MOPAC SCF: requests SCF
- C API → MOZYME SCF: requests MOZYME
- C API → Geometry optimization: requests relaxation
- C API → Physical properties: requests vibrations
- Input processing → Geometry processing: supplies system
- Geometry processing → Chemical systems: defines system
- Semiempirical models → Model parameters: uses parameters
- Chemical systems → Integrals and matrices: provides structure
- Semiempirical models → Integrals and matrices: selects model
- Integrals and matrices → MOPAC SCF: provides integrals
- Integrals and matrices → MOZYME SCF: provides integrals
- MOPAC SCF → INDO method: supports method
- MOPAC SCF → Forces and gradients: calculates gradients
- MOPAC SCF → Physical properties: produces properties
- MOZYME SCF → Physical properties: produces properties
- Geometry optimization → Forces and gradients: uses gradients
- Reaction calculations → Physical properties: calculates properties
- Solvation models → Physical properties: contributes properties
- Energy corrections → Physical properties: corrects results
- Physical properties → Result output: formats results
- Model parameters → Parameter and benchmark data: uses datasets
