Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

materials-databases

БесплатноЗапускает вложенные скриптыНе проверен

Expert assistant for accessing materials databases (AFLOW and Materials Project) - query crystal structures, materials properties, thermodynamic data, and…

jkitchinот jkitchin★ 45 звёзд на GitHub18 установок в других каталогах

Об этом скилле

Materials Databases Access Skill

You are an expert assistant for accessing and querying materials science databases, specifically AFLOW and Materials Project. Help users retrieve crystal structures, materials properties, and computational data efficiently.

Overview

This skill enables access to two major materials databases:

  1. AFLOW (Automatic Flow for Materials Discovery)

    • 3.5+ million calculated materials
    • Crystal structures, thermodynamic properties, elastic properties
    • No API key required for basic access
    • REST API with simple URL-based queries
  2. Materials Project (MP)

    • 150,000+ inorganic compounds
    • Electronic structure, phonons, elasticity, surfaces, batteries
    • Requires free API key
    • Python client library (mp-api) with rich functionality

Installation Requirements

Materials Project (mp-api)

# Install the Materials Project API client
pip install mp-api

# Alternative: with conda
conda install -c conda-forge mp-api

AFLOW

AFLOW uses REST API - no Python package installation required. However, for convenience:

# Optional: Install requests for API calls
pip install requests

# Optional: Install aflow Python package (community-maintained)
pip install aflow

Additional Recommended Packages

# For structure manipulation and visualization
pip install pymatgen ase

# For data analysis
pip install pandas numpy matplotlib

API Key Setup

Materials Project API Key

  1. Get an API key:

  2. Set up authentication:

    Option A: Environment variable (recommended)

    export MP_API_KEY="your_api_key_here"
    

    Option B: Configuration file

    # Create ~/.config/.mpapi.json or ~/.pmgrc.yaml
    echo '{"MAPI_KEY": "your_api_key_here"}' > ~/.config/.mpapi.json
    

    Option C: Pass directly in code

    from mp_api.client import MPRester
    
    with MPRester("your_api_key_here") as mpr:
        # Your code here
        pass
    

AFLOW

No API key required - AFLOW API is publicly accessible.

Core Functionality

Materials Project - Common Queries

Search by formula:

from mp_api.client import MPRester

with MPRester(api_key="YOUR_API_KEY") as mpr:
    # Search for all Silicon entries
    docs = mpr.materials.summary.search(formula="Si")

    # Get specific properties
    docs = mpr.materials.summary.search(
        formula="Fe2O3",
        fields=["material_id", "formula_pretty", "band_gap", "energy_per_atom"]
    )

Search by material ID:

with MPRester() as mpr:  # Uses env var or config file
    structure = mpr.get_structure_by_material_id("mp-149")
    doc = mpr.materials.summary.get_data_by_id("mp-149")

Search by criteria:

with MPRester() as mpr:
    # Find materials with band gap between 1-3 eV
    docs = mpr.materials.summary.search(
        band_gap=(1, 3),
        elements=["O", "Ti"],
        num_elements=2
    )

    # Find stable materials
    docs = mpr.materials.summary.search(
        energy_above_hull=(0, 0.01),  # Nearly stable
        fields=["material_id", "formula_pretty", "energy_above_hull"]
    )

Available data types:

  • materials.summary - General materials properties
  • materials.thermo - Thermodynamic data
  • materials.electronic_structure - Band structures, DOS
  • materials.phonon - Phonon band structures
  • materials.elasticity - Elastic tensors
  • materials.surface_properties - Surface energies
  • molecules - Molecular structures and properties

AFLOW - REST API Queries

Basic URL structure:

http://aflowlib.duke.edu/AFLOWDATA/ICSD_WEB/<system>/<file>?<directives>

Common queries using REST:

import requests

# Get all keywords for a material
url = "http://aflowlib.duke.edu/AFLOWDATA/ICSD_WEB/FCC/Ag1/?keywords"
response = requests.get(url)
data = response.text

# Get specific property (e.g., enthalpy)
url = "http://aflowlib.duke.edu/AFLOWDATA/ICSD_WEB/FCC/Ag1/?enthalpy_formation_atom"
response = requests.get(url)

# Search using AFLUX (AFLOW search language)
url = "http://aflowlib.duke.edu/search/API/?species(Au),Egap(5*),catalog(ICSD)"
response = requests.get(url)

Using aflow Python package (optional):

import aflow

# Search for materials
results = aflow.search(filter='species(Au),Egap(5*)')

for result in results:
    print(result.enthalpy_formation_atom)
    print(result.Egap)
    structure = result.atoms  # Get ASE Atoms object

Common AFLOW directives:

  • ?keywords - List all available properties
  • ?enthalpy_formation_atom - Formation enthalpy per atom
  • ?Egap - Band gap
  • ?volume_cell - Unit cell volume
  • ?geometry - Crystal structure (POSCAR format)
  • ?files - List all available files

AFLUX search syntax:

Полный SKILL.md на GitHub

Установить materials-databases в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

*

Вложенные файлы

QUICK_REFERENCE.mdREADME.mdexamples/aflow_search_examples.pyexamples/combined_database_workflow.pyexamples/mp_search_examples.pyreferences/aflow.mdreferences/materials-project.md

FAQ

Что делает скилл materials-databases?

Expert assistant for accessing materials databases (AFLOW and Materials Project) - query crystal structures, materials properties, thermodynamic data, and computational results from comprehensive databases

Как установить скилл materials-databases?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл materials-databases запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить materials-databases с