A tiered computational pipeline for discovering novel solid-state electrolytes.
This agent generates, screens, and validates candidate materials for next-generation battery electrolytes using a multi-fidelity simulation approach.
- Generates candidate structures by modifying known electrolytes (substitutions, doping)
- Screens candidates through increasingly accurate (and expensive) simulations:
- Level 0: Heuristic rules
- Level 1: ML potentials (M3GNet-style)
- Level 2: Semi-empirical QM (xTB-style)
- Level 3: DFT (exports VASP/QE inputs)
- Outputs ranked candidates with predicted properties and ready-to-run DFT files
# 1. Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run the discovery pipeline
python main.py
# 4. Check results
ls discovery_results/materials_agent/
โโโ main.py # Entry point - run this!
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
โ
โโโ src/
โ โโโ __init__.py # Package exports
โ โโโ types.py # Data structures (CrystalStructure, MaterialCandidate, etc.)
โ โโโ constants.py # Physical constants, reference electrolytes, substitution rules
โ โโโ generator.py # Structure generation (substitutions, doping)
โ โโโ screening.py # Tiered screening pipeline (Levels 0-3)
โ โโโ visualization.py # Plotting and reports
โ
โโโ data/ # Input data (if any)
โโโ outputs/ # Generated results
# Basic run
python main.py
# Custom output directory
python main.py --output my_results
# Set conductivity target (S/cm)
python main.py --min-conductivity 1e-3
# Exclude expensive elements
python main.py --exclude-elements Ge La In
# Export DFT input files for top candidates
python main.py --export-dft
# Skip plot generation (faster)
python main.py --no-plots
# Full example
python main.py \
--output discovery_2024 \
--min-conductivity 1e-3 \
--max-hull-energy 0.05 \
--exclude-elements Ge In Ga \
--export-dftAfter running, you'll find:
discovery_results/
โโโ screening_report.txt # Human-readable summary
โโโ final_candidates.json # Structured data for all candidates
โ
โโโ structures/ # Crystal structures
โ โโโ CAND-00001.cif
โ โโโ CAND-00002.cif
โ โโโ ...
โ
โโโ plots/ # Visualizations
โ โโโ screening_funnel.png
โ โโโ pareto_front.png
โ โโโ composition_analysis.png
โ
โโโ dft_inputs/ # (if --export-dft)
โโโ CAND-00001/
โ โโโ vasp/
โ โ โโโ POSCAR
โ โ โโโ INCAR
โ โ โโโ KPOINTS
โ โ โโโ POTCAR_README
โ โโโ qe/
โ โโโ pw.in
โโโ ...
The current implementation uses heuristic approximations. To use actual computational methods:
pip install m3gnet matgl
# Then modify src/screening.py MLPotentialScreener to use:
from matgl.ext.ase import M3GNetCalculator
# ... actual structure relaxation and energy calculationpip install xtb-python
# Then modify src/screening.py SemiempiricalScreener to use:
from xtb.interface import Calculator
# ... actual xTB calculationsThe DFT exporter already generates valid VASP and Quantum ESPRESSO input files. Submit these to your HPC cluster or cloud service:
# VASP
cd dft_inputs/CAND-00001/vasp
# Add POTCAR files
mpirun -np 16 vasp_std
# Quantum ESPRESSO
cd dft_inputs/CAND-00001/qe
mpirun -np 16 pw.x < pw.in > pw.outWe focus on solid-state electrolytes because they're:
- Critical for next-gen batteries (EVs, grid storage)
- Computationally tractable (ionic conductivity is simulatable)
- High impact (major R&D investment from Toyota, QuantumScape, etc.)
| Material | Formula | ฯ (S/cm) | Notes |
|---|---|---|---|
| LGPS | LiโโGePโSโโ | 12 mS/cm | Best conductivity, expensive Ge |
| LLZO | LiโLaโZrโOโโ | 0.5 mS/cm | Stable vs Li metal |
| Argyrodite | LiโPSโ Cl | 3 mS/cm | Good balance |
| NASICON | LiZrโPโOโโ | 0.1 mS/cm | Air stable |
-
Substitutions: Replace elements with similar ones
- Ge โ Si, Sn (cost reduction!)
- S โ Se, O (stability tuning)
- Cl โ Br, I (conductivity tuning)
-
Doping: Partial substitution to create vacancies/disorder
- Al doping in LLZO stabilizes cubic phase
- Ta doping increases conductivity
-
Compositional variations: Systematic exploration around known phases
| Property | Good Value | Why It Matters |
|---|---|---|
| Ionic conductivity | >1 mS/cm | Fast Li transport |
| Activation energy | <0.3 eV | Low T dependence |
| Energy above hull | <0.05 eV/atom | Thermodynamic stability |
| Band gap | >3 eV | Electronic insulator |
The Pareto plot shows the tradeoff between conductivity and stability. Points on the front are "optimal" โ you can't improve one without sacrificing the other.
Edit src/constants.py:
REFERENCE_ELECTROLYTES["my_new_material"] = {
"formula": "Li3PS4",
"structure_type": "orthorhombic",
"lattice": {"a": 13.07, "b": 8.01, "c": 6.13, ...},
"ionic_conductivity": 0.16e-3,
...
}Edit src/constants.py:
SUBSTITUTION_RULES["Zr"] = ["Ti", "Hf", "Sn", "Ce"] # Add Ce as optionEdit src/types.py DiscoveryConfig:
@dataclass
class DiscoveryConfig:
min_ionic_conductivity: float = 1e-3 # More aggressive target
max_cost_index: float = 5.0 # Add cost constraint
...from mp_api.client import MPRester
with MPRester("your_api_key") as mpr:
# Fetch real structures
docs = mpr.summary.search(
elements=["Li", "P", "S"],
fields=["structure", "formation_energy_per_atom"]
)from ase.io import read, write
from ase.optimize import BFGS
# Convert CIF to ASE Atoms
atoms = read("CAND-00001.cif")
# Attach calculator and optimize
atoms.calc = your_calculator
opt = BFGS(atoms)
opt.run(fmax=0.01)MIT License - Use freely for research and commercial purposes.
- Integration with Materials Project API for real structure data
- M3GNet/CHGNet integration for Level 1
- xTB integration for Level 2
- Autonomous hypothesis-test loop (LLM-guided)
- Active learning for efficient exploration
- Web interface for interactive discovery
- M3GNet: Chen et al., Nature Computational Science (2022)
- ALIGNN: Choudhary et al., npj Computational Materials (2021)
- Materials Project: Jain et al., APL Materials (2013)
- Solid-state electrolytes review: Janek & Zeier, Nature Energy (2016)
Built with ๐ฌ by the Materials Discovery Agent