DEV.co
AI Frameworks · microsoft

mattergen

MatterGen is a Python-based generative model developed by Microsoft for designing inorganic materials across the periodic table. It uses diffusion-based generation and can be fine-tuned to produce materials with specific physical properties like band gap, magnetic density, or bulk modulus.

Source: GitHub — github.com/microsoft/mattergen
1.8k
GitHub stars
333
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorymicrosoft/mattergen
Ownermicrosoft
Primary languagePython
LicenseMIT — OSI-approved
Stars1.8k
Forks333
Open issues13
Latest releasev1.0.3 (2025-07-23)
Last updated2026-07-07
Sourcehttps://github.com/microsoft/mattergen

What mattergen is

A diffusion-based generative model for crystal structure design, implemented in Python 3.10+, supporting both unconditional and property-conditioned generation via classifier-free guidance. Pre-trained checkpoints available; evaluation uses MatterSim (ML force field) for structure relaxation and stability assessment. Training and inference support GPU acceleration (CUDA) with experimental Apple Silicon support.

Quickstart

Get the mattergen source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/microsoft/mattergen.gitcd mattergen# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Materials discovery with property targets

Use fine-tuned models to generate inorganic materials constrained by specific properties (band gap, magnetic density, bulk modulus, energy above hull) for accelerated discovery workflows.

Chemical system exploration

Generate novel structures within defined chemical systems (e.g., Li-O) to explore unexplored or underexplored material spaces systematically.

Validation and benchmarking of generative approaches

Leverage pre-trained base models and evaluation pipeline to benchmark new materials-design algorithms against published baselines.

Implementation considerations

  • Install Git LFS before cloning; model checkpoints are stored via LFS and must be pulled separately.
  • Requires CUDA-capable GPU; batch size tuning is critical for memory efficiency (documentation recommends maximizing sustainable batch size).
  • Pre-trained checkpoints are re-trained versions; results will slightly deviate from published paper. Validate against your domain baseline.
  • Evaluation pipeline depends on MatterSim; structure relaxation accuracy is ML-based, not DFT. For critical applications, confirm with DFT.
  • Property conditioning requires fine-tuned models; diffusion guidance factor (gamma) trades off adherence to constraints vs. sample diversity and realism.

When to avoid it — and what to weigh

  • Production-grade DFT-level accuracy required — Evaluation uses MatterSim (ML force field), not DFT. Documentation explicitly notes MatterSim predictions may differ from DFT, especially for uncommon chemical systems. Confirm results with DFT before critical decisions.
  • Real-time or low-latency generation needed — Diffusion-based models require iterative denoising steps. Generation speed not documented; batch processing and GPU resources are required.
  • Minimal Python expertise or GPU infrastructure — Requires Python 3.10+, CUDA GPU, Git LFS, and dependency management via uv. Apple Silicon support is experimental. Setup complexity may exceed non-technical teams.
  • Proprietary or restricted-license materials data — Training uses Alex-MP-20 and MP-20 datasets; retraining on proprietary data requires data format alignment and computational resources. No clear licensing guidance for derivative models.

License & commercial use

MIT License. Permits commercial use, modification, and distribution with attribution. No derivative restrictions.

MIT License explicitly permits commercial use. However, no warranty or liability guarantees are provided. Generated materials must be validated independently (especially against DFT) before deployment in commercial materials-design workflows. Verify that training data (Alex-MP-20, MP-20) and MatterSim dependencies do not impose additional restrictions.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Model and data downloaded from Hugging Face and Git LFS; verify integrity if used in restricted environments. No signed checksums or reproducibility guarantees documented. ML model inference may exhibit unexpected behavior on out-of-distribution inputs; validate generated structures before use. No explicit security audit or vulnerability disclosure policy noted.

Alternatives to consider

CDVAE (Crystal Diffusion VAE)

Open-source VAE-based crystal generation; smaller scope (fewer property constraints) but simpler deployment and faster inference.

Matformer / other DFT-based screening tools

DFT-grounded; higher accuracy for critical properties but computationally expensive and no generative capability.

PhAST / proprietary ML platforms (Schrodinger, Materials Design)

Commercial alternatives with integrated workflows, SLAs, and DFT validation; higher cost and vendor lock-in.

Software development agency

Build on mattergen with DEV.co software developers

Our engineering team can help you set up MatterGen, integrate it with your workflows, validate outputs via DFT or experiment, and build custom fine-tuned models for your property targets. Contact us to discuss your use case.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

mattergen FAQ

Can I use MatterGen to generate materials and directly deploy them?
No. Generated structures must be validated via DFT or experimental methods. The provided evaluation uses MatterSim (ML force field), not DFT, and is orders of magnitude faster but less reliable, especially for uncommon chemical systems.
How do I fine-tune MatterGen on my own property data?
Documentation references 'Train MatterGen yourself' in the README but detailed training instructions are not excerpted. Refer to the full repository or arXiv paper for training procedures and hyperparameters.
What GPU memory is required?
Not specified in documentation. Guidance suggests maximizing batch size to sustainable limits; test on your hardware. Batch size 16 is used in examples but actual memory depends on model variant.
Are generated structures novel or duplicates of training data?
Evaluation metrics include novelty and uniqueness (computed via structure matching). Results depend on the model, property constraints, and guidance factor. Review generated_metrics.json output.

Custom software development services

Adopting mattergen is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate ai frameworks software in production.

Ready to integrate MatterGen into your materials-science pipeline?

Our engineering team can help you set up MatterGen, integrate it with your workflows, validate outputs via DFT or experiment, and build custom fine-tuned models for your property targets. Contact us to discuss your use case.