# valenbloodhunter/sympy architecture

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

- Interactive diagram: https://gitdiagram.com/valenbloodhunter/sympy
- Repository: https://github.com/valenbloodhunter/sympy

## Overview

SymPy is a Python computer algebra system: users construct symbolic expressions, transform or analyze them, and obtain symbolic, numeric, or rendered results. The graph highlights the symbolic object model and major algebraic and application domains visible in the tree. The README demonstrates expression construction and series expansion; source-index references and excerpts support only a subset of internal relationships. Dashed, uncited edges mark architectural links that are plausible but not verified in the sampled source.

Main entry points: [`sympy/core/basic.py`](https://github.com/valenbloodhunter/sympy/blob/master/sympy/core/basic.py) (Expression core), [`sympy/__init__.py`](https://github.com/valenbloodhunter/sympy/blob/master/sympy/__init__.py) (Public API), [`sympy/parsing/sympy_parser.py`](https://github.com/valenbloodhunter/sympy/blob/master/sympy/parsing/sympy_parser.py) (Expression parsing), [`sympy/assumptions/reasoning_engine.py`](https://github.com/valenbloodhunter/sympy/blob/master/sympy/assumptions/reasoning_engine.py) (Assumption reasoning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_api["Public API<br/>[__init__.py]"]
  node_parser["Expression parsing<br/>[sympy_parser.py]"]
end

subgraph group_symbolic["Symbolic foundation"]
  node_core["Expression core<br/>[basic.py]"]
  node_symbols["Symbols and numbers<br/>[symbol.py]"]
  node_functions["Symbolic functions<br/>[function.py]"]
  node_assumptions["Assumption reasoning"]
  node_logic["Boolean logic<br/>[boolalg.py]"]
end

subgraph group_math["Mathematical domains"]
  node_simplify["Simplification<br/>[simplify.py]"]
  node_polys["Polynomial algebra<br/>[polytools.py]"]
  node_solve["Equation solving<br/>[solveset.py]"]
  node_integrate["Integration<br/>[integrals.py]"]
  node_series["Series expansion<br/>[series.py]"]
  node_sets["Sets operations<br/>[sets.py]"]
  node_numbertheory["Number theory<br/>[factor_.py]"]
  node_combinatorics["Combinatorics<br/>[perm_groups.py]"]
  node_matrices["Matrix algebra<br/>[matrixbase.py]"]
end

subgraph group_results["Results and applications"]
  node_printing["Expression printing<br/>[printer.py]"]
  node_codegen["Code generation<br/>[ast.py]"]
  node_plotting["Plotting<br/>[plot.py]"]
  node_physics["Physics modules"]
end

node_user(("Python user"))

node_user -->|"imports and uses"| node_api
node_api -.->|"exposes core"| node_core
node_user -.->|"parses expressions"| node_parser
node_parser -.->|"constructs expressions"| node_core
node_core -->|"uses symbol types"| node_symbols
node_core -->|"exposes functions"| node_functions
node_core -.->|"refines expressions"| node_assumptions
node_assumptions -->|"reasons with logic"| node_logic
node_core -->|"delegates simplify"| node_simplify
node_core -->|"uses polynomial tools"| node_polys
node_core -.->|"solves expressions"| node_solve
node_core -.->|"integrates expressions"| node_integrate
node_core -->|"expands in series"| node_series
node_core -.->|"uses set expressions"| node_sets
node_core -.->|"supports number theory"| node_numbertheory
node_core -.->|"supports combinatorics"| node_combinatorics
node_core -->|"supports matrices"| node_matrices
node_core -.->|"renders expressions"| node_printing
node_core -.->|"generates code"| node_codegen
node_core -.->|"plots expressions"| node_plotting
node_core -.->|"supports physics"| node_physics

click node_api "https://github.com/valenbloodhunter/sympy/blob/master/sympy/__init__.py"
click node_parser "https://github.com/valenbloodhunter/sympy/blob/master/sympy/parsing/sympy_parser.py"
click node_core "https://github.com/valenbloodhunter/sympy/blob/master/sympy/core/basic.py"
click node_symbols "https://github.com/valenbloodhunter/sympy/blob/master/sympy/core/symbol.py"
click node_functions "https://github.com/valenbloodhunter/sympy/blob/master/sympy/core/function.py"
click node_assumptions "https://github.com/valenbloodhunter/sympy/blob/master/sympy/assumptions/reasoning_engine.py"
click node_logic "https://github.com/valenbloodhunter/sympy/blob/master/sympy/logic/boolalg.py"
click node_simplify "https://github.com/valenbloodhunter/sympy/blob/master/sympy/simplify/simplify.py"
click node_polys "https://github.com/valenbloodhunter/sympy/blob/master/sympy/polys/polytools.py"
click node_solve "https://github.com/valenbloodhunter/sympy/blob/master/sympy/solvers/solveset.py"
click node_integrate "https://github.com/valenbloodhunter/sympy/blob/master/sympy/integrals/integrals.py"
click node_series "https://github.com/valenbloodhunter/sympy/blob/master/sympy/series/series.py"
click node_sets "https://github.com/valenbloodhunter/sympy/blob/master/sympy/sets/sets.py"
click node_numbertheory "https://github.com/valenbloodhunter/sympy/blob/master/sympy/ntheory/factor_.py"
click node_combinatorics "https://github.com/valenbloodhunter/sympy/blob/master/sympy/combinatorics/perm_groups.py"
click node_matrices "https://github.com/valenbloodhunter/sympy/blob/master/sympy/matrices/matrixbase.py"
click node_printing "https://github.com/valenbloodhunter/sympy/blob/master/sympy/printing/printer.py"
click node_codegen "https://github.com/valenbloodhunter/sympy/blob/master/sympy/codegen/ast.py"
click node_plotting "https://github.com/valenbloodhunter/sympy/blob/master/sympy/plotting/plot.py"
click node_physics "https://github.com/valenbloodhunter/sympy/tree/master/sympy/physics"

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_api,node_parser,node_user toneBlue
class node_core,node_symbols,node_functions,node_assumptions,node_logic toneAmber
class node_simplify,node_polys,node_solve,node_integrate,node_series,node_sets,node_numbertheory,node_combinatorics,node_matrices toneMint
class node_printing,node_codegen,node_plotting,node_physics toneRose
```

## Components

### User interfaces

- [Public API](https://github.com/valenbloodhunter/sympy/blob/master/sympy/__init__.py): `sympy/__init__.py`
- [Expression parsing](https://github.com/valenbloodhunter/sympy/blob/master/sympy/parsing/sympy_parser.py): `sympy/parsing/sympy_parser.py`

### Symbolic foundation

- [Expression core](https://github.com/valenbloodhunter/sympy/blob/master/sympy/core/basic.py): `sympy/core/basic.py`
- [Symbols and numbers](https://github.com/valenbloodhunter/sympy/blob/master/sympy/core/symbol.py): `sympy/core/symbol.py`
- [Symbolic functions](https://github.com/valenbloodhunter/sympy/blob/master/sympy/core/function.py): `sympy/core/function.py`
- [Assumption reasoning](https://github.com/valenbloodhunter/sympy/blob/master/sympy/assumptions/reasoning_engine.py): `sympy/assumptions/reasoning_engine.py`
- [Boolean logic](https://github.com/valenbloodhunter/sympy/blob/master/sympy/logic/boolalg.py): `sympy/logic/boolalg.py`

### Mathematical domains

- [Simplification](https://github.com/valenbloodhunter/sympy/blob/master/sympy/simplify/simplify.py): `sympy/simplify/simplify.py`
- [Polynomial algebra](https://github.com/valenbloodhunter/sympy/blob/master/sympy/polys/polytools.py): `sympy/polys/polytools.py`
- [Equation solving](https://github.com/valenbloodhunter/sympy/blob/master/sympy/solvers/solveset.py): `sympy/solvers/solveset.py`
- [Integration](https://github.com/valenbloodhunter/sympy/blob/master/sympy/integrals/integrals.py): `sympy/integrals/integrals.py`
- [Series expansion](https://github.com/valenbloodhunter/sympy/blob/master/sympy/series/series.py): `sympy/series/series.py`
- [Sets operations](https://github.com/valenbloodhunter/sympy/blob/master/sympy/sets/sets.py): `sympy/sets/sets.py`
- [Number theory](https://github.com/valenbloodhunter/sympy/blob/master/sympy/ntheory/factor_.py): `sympy/ntheory/factor_.py`
- [Combinatorics](https://github.com/valenbloodhunter/sympy/blob/master/sympy/combinatorics/perm_groups.py): `sympy/combinatorics/perm_groups.py`
- [Matrix algebra](https://github.com/valenbloodhunter/sympy/blob/master/sympy/matrices/matrixbase.py): `sympy/matrices/matrixbase.py`

### Results and applications

- [Expression printing](https://github.com/valenbloodhunter/sympy/blob/master/sympy/printing/printer.py): `sympy/printing/printer.py`
- [Code generation](https://github.com/valenbloodhunter/sympy/blob/master/sympy/codegen/ast.py): `sympy/codegen/ast.py`
- [Plotting](https://github.com/valenbloodhunter/sympy/blob/master/sympy/plotting/plot.py): `sympy/plotting/plot.py`
- [Physics modules](https://github.com/valenbloodhunter/sympy/tree/master/sympy/physics): `sympy/physics`

### Other components

- **Python user**

## Connections

- Python user → Public API: imports and uses
- Public API → Expression core: exposes core
- Python user → Expression parsing: parses expressions
- Expression parsing → Expression core: constructs expressions (evidence: `sympy/parsing/sympy_parser.py`)
- Expression core → Symbols and numbers: uses symbol types (evidence: `sympy/core/__init__.py`)
- Expression core → Symbolic functions: exposes functions (evidence: `sympy/core/__init__.py`)
- Expression core → Assumption reasoning: refines expressions
- Assumption reasoning → Boolean logic: reasons with logic (evidence: `sympy/assumptions/reasoning_engine.py`)
- Expression core → Simplification: delegates simplify (evidence: `sympy/core/basic.py`)
- Expression core → Polynomial algebra: uses polynomial tools (evidence: `sympy/polys/polytools.py`)
- Expression core → Equation solving: solves expressions
- Expression core → Integration: integrates expressions
- Expression core → Series expansion: expands in series
- Expression core → Sets operations: uses set expressions
- Expression core → Number theory: supports number theory
- Expression core → Combinatorics: supports combinatorics
- Expression core → Matrix algebra: supports matrices (evidence: `sympy/matrices/matrixbase.py`)
- Expression core → Expression printing: renders expressions
- Expression core → Code generation: generates code
- Expression core → Plotting: plots expressions
- Expression core → Physics modules: supports physics (evidence: `sympy/physics/quantum/identitysearch.py`)
