MatterGraph
MatterGraph is an open-source SDK and workbench for physics-aware materials workflows.
It helps researchers and developers turn standardized materials datasets into graph-ready, benchmark-ready, and candidate-screening artifacts. MatterGraph is dataset-agnostic and supports multi-source workflows across public materials resources.
LeMaterial is a flagship upstream companion: LeMaterial provides standardized materials datasets; MatterGraph provides the downstream workflow surface for inspection, filtering, graph export, slicing, and evaluation.
It is designed for teams building:
- materials screening and comparison tools
- graph-based materials ML models
- simulation-backed discovery workflows
- uncertainty-aware engineering decision support
MatterGraph is not a black-box “AI materials scientist.” It is infrastructure for transparent, physics-aware materials workflows.
Why MatterGraph?
Materials data is fragmented across repositories, schemas, units, structures, and property definitions. MatterGraph provides a common, provenance-aware layer for turning raw materials records into normalized, ML-ready, simulation-aware material objects.
What it does
- Ingest public materials datasets
- Normalize formulas, structures, units, and properties
- Convert crystal structures into crystal graph representations
- Track property provenance and basic confidence
- Support transparent baseline scorecards with auditable ranking behavior
- Provide adapters for benchmarking and simulation job specs (e.g. ASE)
- Expose a small demo API and minimal web UI for end-to-end exploration
- Inspect, validate, graph, rank, and export small local CSV/JSONL datasets without uploading them
- Compile natural-language requirements into confirmed constraints, exact exclusions, and index-relative recovery paths with the Constraint-to-Crystal Navigator
Scope
The public repository focuses on transparent, reusable infrastructure for open materials workflows. Production-specific orchestration, hosting, and organization-specific workflows are out of scope for this demo.
MatterGraph Core focuses on transparent workflow primitives and guardrails. Proprietary ranking, active learning, orchestration, model routing, and customer-specific decision workflows remain private.
Install
MatterGraph is published on PyPI for Python 3.10 and newer. Wheels, source distributions, and provenance are also attached to each GitHub release.
pip install mattergraph
That installs the public toolkit without provider-specific SDKs. Opt into only the connector SDKs you need:
pip install 'mattergraph[mp]' # Materials Project SDK
pip install 'mattergraph[jarvis]' # JARVIS SDK
pip install 'mattergraph[all]' # all optional public connector SDKs
Install an individual package for a smaller application surface:
pip install mattergraph-core # schema, normalization, graphs, scoring
pip install mattergraph-connectors # NOMAD, OPTIMADE, local data, LeMat-Bulk
pip install mattergraph-sim # ASE job specs and runners
pip install mattergraph-benchmarks # metrics and Matbench adapter
pip install mattergraph-api # FastAPI demo service
Ten-minute quickstart from PyPI
The attributed 24-record Ti–Al–N example is bundled with mattergraph-connectors. It needs no
credentials, network access, repository checkout, or external data path.
from mattergraph_connectors import LeMatBulk
dataset = LeMatBulk.example("spc-tialn-24")
manifest = dataset.metadata["snapshot_manifest"]
candidate_slice = (
dataset
.filter_elements(include=["Ti", "Al", "N"])
.filter_complexity(max_nsites=16, max_nelements=3)
.create_slice("spc_tialn_candidates_v1", target="energy_above_hull")
)
graphs = dataset.to_graphs()
print(manifest["dataset"], manifest["license"], manifest["snapshot_sha256"])
print(candidate_slice.report())
print(graphs.included_count, graphs.excluded_count)
Run the installed API from any working directory:
python -m uvicorn mattergraph_api.main:app --host 127.0.0.1 --port 8000
GET /demo/preflight reports the same packaged fixture, graph validation, ranking readiness,
and explicitly labelled cached CHGNet evidence.
Run the web workbench from source
git clone https://github.com/cyrusmo/MatterGraph.git
cd MatterGraph
python3 -m venv .venv
source .venv/bin/activate
pip install uv
uv sync --all-packages --group dev --extra all
# Optional: copy .env.example to .env and set MP_API_KEY for Materials Project
export MATTERGRAPH_DEMO_DATA=data/demo/materials_sample.jsonl
uv run uvicorn mattergraph_api.main:app --reload --host 0.0.0.0 --port 8000
For the deterministic public capability walkthrough, start the API and UI together:
./scripts/run_public_demo.sh
This runs a preflight-checked, checksummed snapshot of 24 real LeMaterial records at
http://127.0.0.1:5173 without network calls or API credentials. The snapshot preserves the
upstream revision, immutable IDs, license, citation, and field-level provenance.
The UI opens in Guided demo mode. Choose Local workbench to inspect a CSV or JSONL file up to 5 MiB / 5,000 rows. Imported datasets are ephemeral: normalized JSONL remains in memory, the registry is capped at eight entries and 32 MiB, and only the selected dataset is materialized. Imported content is never sent to an external service or written to disk.
Choose Constraint navigator, or open /?view=navigator, for the provenance-backed
constraint-to-crystal workflow. The bundled UI truthfully identifies its 24-record evidence
surface; see the navigator contract for the deterministic 25,000-record index
builder and Hugging Face release gate.
Example: rank candidates with a transparent baseline scorecard (pool-relative min–max objectives plus hard constraints).
from mattergraph import Scorecard
from mattergraph_connectors import LeMatBulk
store = LeMatBulk.example("spc-tialn-24").to_material_store()
scorecard = Scorecard(
objectives={
"density": {"direction": "minimize", "weight": 0.6},
"energy_above_hull": {"direction": "minimize", "weight": 0.4},
},
constraints={
"energy_above_hull": {"max": 0.05},
"max_force": {"max": 0.2},
},
)
df = scorecard.rank(store.materials)
print(df.head(10))
Example: turn LeMaterial-style records into a reproducible candidate slice.
from mattergraph_connectors import LeMatBulk
dataset = LeMatBulk.example("spc-tialn-24")
candidate_slice = (
dataset
.filter_elements(include=["Ti", "Al", "N"])
.filter_complexity(max_nsites=16, max_nelements=3)
.create_slice("spc_tialn_candidates_v1", target="energy_above_hull")
)
print(candidate_slice.report())
Architecture (conceptual)
Raw dataset → MatterGraphDataset / Material → candidate slice / crystal graph / benchmark frame → scorecard or simulation job
Roadmap
High-level ROADMAP.md covers connectors, the unified schema, workflow slicing, graph building, benchmark adapters, simulation interchange, and uncertainty. For the LeMaterial companion layer, see docs/integrations/lematerial.md, and for local data see docs/local-workbench.md.
Packages
| Package | Role |
|---|---|
mattergraph-core |
Schema, normalization, MatterGraphDataset, CandidateSlice, crystal graphs, transparent Scorecard, MaterialStore |
mattergraph-connectors |
MP, JARVIS, NOMAD public metadata, OPTIMADE, LeMat-Bulk companion adapter, bounded local CSV/JSONL import, OQMD stub |
mattergraph-benchmarks |
Metrics, Matbench-style adapter (optional matbench install) |
mattergraph-sim |
ASE / stub LAMMPS+QE around job specs |
mattergraph-api |
FastAPI demo plus ephemeral local-dataset registry, graph summaries, slicing, audited ranking, export, and labeled CHGNet reference evidence |
License
Apache 2.0 — see LICENSE.
Metadata
Release files for mattergraph 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mattergraph-0.1.1.tar.gz | 11.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mattergraph-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.0 kB
Release files / mattergraph-0.1.1.tar.gz
| Download URL | mattergraph-0.1.1.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbe4e25523d446057849847602252093910921fbc107123870590526ccbcf596
|
|
BLAKE2b-256 checksum How to use checksums |
28a9b9b2012c7886756d8b9f6ab083777687a768eb72d7a67da7d301ccad1b13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logRelease files / mattergraph-0.1.1-py3-none-any.whl
| Download URL | mattergraph-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4562fac3eb3ce147b5a176a3b5e51ea619696325531dbe6135de034ce7113c04
|
|
BLAKE2b-256 checksum How to use checksums |
dffe9176f6747b5d77ed44dd86d80c48ad730273c97a3456503ff96342732b60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logSecurity for mattergraph 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mattergraph-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.