Skip to content

riorio3/NewHorizon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Materials Discovery Agent ๐Ÿ”ฌ

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.


๐ŸŽฏ What It Does

  1. Generates candidate structures by modifying known electrolytes (substitutions, doping)
  2. 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)
  3. Outputs ranked candidates with predicted properties and ready-to-run DFT files

๐Ÿš€ Quick Start

# 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/

๐Ÿ“ Project Structure

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

๐Ÿ”ง Usage Options

# 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-dft

๐Ÿ“Š Output Files

After 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
    โ””โ”€โ”€ ...

๐Ÿงช Upgrading to Real Simulations

The current implementation uses heuristic approximations. To use actual computational methods:

Level 1: ML Potentials (M3GNet)

pip install m3gnet matgl

# Then modify src/screening.py MLPotentialScreener to use:
from matgl.ext.ase import M3GNetCalculator
# ... actual structure relaxation and energy calculation

Level 2: Semi-empirical (xTB)

pip install xtb-python

# Then modify src/screening.py SemiempiricalScreener to use:
from xtb.interface import Calculator
# ... actual xTB calculations

Level 3: DFT

The 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.out

๐Ÿ”‹ Target: Solid-State Electrolytes

We 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.)

Reference Materials

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

๐Ÿงฌ How Candidates Are Generated

  1. Substitutions: Replace elements with similar ones

    • Ge โ†’ Si, Sn (cost reduction!)
    • S โ†’ Se, O (stability tuning)
    • Cl โ†’ Br, I (conductivity tuning)
  2. Doping: Partial substitution to create vacancies/disorder

    • Al doping in LLZO stabilizes cubic phase
    • Ta doping increases conductivity
  3. Compositional variations: Systematic exploration around known phases


๐Ÿ“ˆ Interpreting Results

Key Properties

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

Pareto Front

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.


๐Ÿ› ๏ธ Extending the Agent

Add New Reference Structures

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,
    ...
}

Add New Substitution Rules

Edit src/constants.py:

SUBSTITUTION_RULES["Zr"] = ["Ti", "Hf", "Sn", "Ce"]  # Add Ce as option

Custom Screening Criteria

Edit 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
    ...

๐Ÿค Integration with External Tools

Materials Project API

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"]
    )

ASE (Atomic Simulation Environment)

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)

๐Ÿ“œ License

MIT License - Use freely for research and commercial purposes.


๐Ÿ”ฎ Roadmap

  • 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

๐Ÿ“š References

  1. M3GNet: Chen et al., Nature Computational Science (2022)
  2. ALIGNN: Choudhary et al., npj Computational Materials (2021)
  3. Materials Project: Jain et al., APL Materials (2013)
  4. Solid-state electrolytes review: Janek & Zeier, Nature Energy (2016)

Built with ๐Ÿ”ฌ by the Materials Discovery Agent

About

uncovering the unknown

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •