科研 Skill
材料结构与成分核心分析
materials-structure-analysis
Covers core structure and composition analysis: reading/writing crystal structures, composition handling, symmetry analysis, phase diagrams. Use as a general-purpose structure-analysis toolkit.
SKILL.md
Materials Structure and Composition Analysis
Overview
This is the foundational data layer nearly every other skill in this repo builds on: representing compositions and crystal structures as objects, converting between file formats, determining symmetry, constructing phase diagrams from computed energies, reading/writing electronic-structure code files, and querying public materials databases. pymatgen is the standard tool for all of this — this skill covers its core workflows as complete, usable content, not a pointer elsewhere.
When to use this skill
Activate when the request involves:
- Crystal structures, compositions, space groups, phase diagrams, convex hull, electronic structure files, Materials Project
- Terms: pymatgen, Structure, Composition, SpacegroupAnalyzer, PhaseDiagram, POSCAR, band structure, DOS, mp-api
- File formats:
.cif,.poscar/CONTCAR,.xyz, VASP/Quantum Espresso structure/output files - "Parse this structure file," "determine the space group," "build a phase diagram," "query Materials Project"
Which reference to read
| You have... | Read |
|---|---|
| A question about symmetry, transformations, or structure manipulation beyond basic I/O | references/symmetry-and-transformations.md |
| A question about phase stability, convex hull, or phase diagrams | references/phase-diagrams.md |
| A question about reading/writing DFT code files (VASP, Quantum Espresso) or band structure/DOS | references/electronic-structure-io.md |
| A question about querying the Materials Project database specifically | references/materials-project-queries.md |
For the DFT calculation itself (running VASP/QE, convergence, pseudopotentials), see
computational-materials/references/dft.md — this skill covers the structure/data objects those
calculations consume and produce, not running the calculation.
Core usage — structure and composition basics
Composition handling
from pymatgen.core import Composition
comp = Composition("Fe2O3")
print(comp.weight) # molecular weight
print(comp.get_atomic_fraction("Fe"))
print(comp.reduced_formula) # normalized formula
Reading, writing, and inspecting structures
from pymatgen.core import Structure
structure = Structure.from_file("material.cif") # also reads POSCAR, .xyz, and other formats by extension
print(structure.composition)
print(structure.lattice)
print(structure.density)
structure.to(filename="material.poscar", fmt="poscar")
Building a structure from scratch
from pymatgen.core import Structure, Lattice
lattice = Lattice.cubic(4.2)
structure = Structure(lattice, ["Na", "Cl"], [[0, 0, 0], [0.5, 0.5, 0.5]])
Structure matching (comparing two structures, e.g. before/after relaxation)
from pymatgen.analysis.structure_matcher import StructureMatcher
matcher = StructureMatcher()
are_equivalent = matcher.fit(structure_1, structure_2) # accounts for symmetry-equivalent representations
Validation & Pitfalls
Canonical reference: Ong et al. (2013), "Python Materials Genomics (pymatgen): A robust, open-source python library for materials analysis," Computational Materials Science — the foundational pymatgen paper covering the scope this skill is built around.
- File format auto-detection by extension can fail silently on nonstandard filenames — a
correctly-formatted POSCAR file not named
POSCAR/CONTCARor lacking a recognized extension may parse incorrectly or raise an unclear error; when in doubt, specify the format explicitly rather than relying on auto-detection. reduced_formulanormalizes to integer ratios and can obscure the actual unit cell content — for a structure with an unusual number of formula units per cell (e.g. Z=4), the reduced formula doesn't tell you the actual cell composition; checkstructure.composition(unreduced) when cell content specifically matters, not just stoichiometric ratio.StructureMatcher's default tolerances are reasonable for many cases but not universal — very similar-but-genuinely-distinct structures (e.g. polymorphs with subtle distortions) can be reported as matching, or vice versa, depending on tolerance settings; check and report the tolerances used for any claim resting on structure equivalence.- A structure parsed from a computational output file (e.g. a relaxed VASP structure) carries no
information about calculation convergence or accuracy — treat a structure object as exactly what
it is (a set of coordinates), not implicitly validated data; convergence/accuracy questions belong
to
computational-materials, not this layer.
示例提示词
帮我用pymatgen读取这个结构文件并做对称性分析和相图构建。
所属插件
安装该插件会一并获得同领域的 42 个 Skill / MCP。
同插件的其他科研 Skill
- 贝叶斯优化材料发现Covers Bayesian optimization for materials and chemistry design: surrogate models, acquisition functions, batch/constrained BO. Use when planning sample-efficient experiments or simulations.
- CALPHAD热力学计算工作流Covers CALPHAD computational thermodynamics: database selection, equilibrium/metastable calculations, binary/ternary phase diagrams. Use when predicting phase stability or solidification paths.
- 材料第一性原理与分子动力学模拟Routes first-principles and classical materials simulation (DFT, MD, ML potentials) to the right specialized workflow. Use as an entry point for any simulation-based materials task.
- 蠕变力学建模与验证Selects, calibrates, and validates creep deformation and rupture models under sustained thermomechanical load, covering rate prediction. Use when assessing long-term high-temperature components.
- 晶体塑性有限元建模Covers crystal plasticity and CPFE modeling of metals: slip systems for FCC/BCC/HCP, Schmid factors. Use when simulating texture- and orientation-dependent plastic deformation.
- 衍射结构表征Covers diffraction-based structure characterization (XRD, neutron, SAED): space group determination, Rietveld refinement, phase identification. Use for any diffraction-pattern analysis technique.
- EBSD织构分析Analyzes EBSD orientation maps for grain size, misorientation, phase, and texture, with pole figures and twin-boundary identification. Use for electron backscatter diffraction workflows.
- 电化学性能测试分析Covers electrochemical characterization: cyclic voltammetry, battery cycling analysis, EIS. Use for electrochemistry-specific data analysis distinct from general materials characterization.
- 金属疲劳寿命评估Builds, calibrates, and validates fatigue assessments for metals and components: stress-life, strain-life, multiaxial critical-plane. Use when predicting fatigue life or crack growth.
- 多物理场有限元建模Covers finite element modeling for coupled materials, mechanics, and transport problems: weak-form construction, boundary conditions, mesh choice. Use for multiphysics FEM simulations.
- 连续尺度有限元力学建模Covers continuum-scale mechanical, thermal, and multiphysics simulation with Abaqus/COMSOL conventions, mesh generation. Use for macroscale FEM consuming measured or computed material properties.
- 断裂力学评估与建模Selects, constructs, and validates fracture-mechanics assessments: LEFM checks, elastic-plastic fracture mechanics. Use when assessing cracked materials or components.
- 高斯过程材料回归建模Covers Gaussian process regression for materials and chemistry datasets: descriptor selection, kernel design. Use when a probabilistic surrogate model with uncertainty is needed.
- 自驱动实验室闭环材料发现Covers combinatorial synthesis, robotic experimentation. Use for autonomous or robotics-driven experimental campaigns, a less standardized domain.
- 材料数据库可复现访问Covers reproducible API access to materials databases (Materials Project, AFLOW, OQMD, NOMAD, COD, ICSD-style sources): authentication. Use when programmatically querying these databases.
- 材料数据库跨库查询Covers querying public materials databases beyond Materials Project: AFLOW, OQMD, NOMAD, JARVIS. Use when pulling or comparing data from these live, API-integrated resources.
- 材料数据标准与互操作Covers data interoperability standards for materials science: CIF crystal files, the OPTIMADE query API. Use when structuring or exchanging materials data between tools.
- 材料结构特征化Covers converting structures, compositions, and trajectories into ML feature vectors: Magpie-style elemental statistics. Use when building inputs for materials ML models.
- 材料科学图表绘制规范Covers publication-quality figure conventions for materials science plots: phase diagrams, pole figures, stress-strain curves. Use when the deliverable is a figure, not just an analysis result.
- 材料信息学性质预测Covers ML for materials property prediction and generative design: descriptor-based models, crystal GNNs (CGCNN/MEGNet-class). Use for materials informatics distinct from interatomic potentials.
- 材料生命周期评估Covers life-cycle assessment for materials and manufacturing routes: goal/scope definition, functional units, inventory construction. Use for environmental-impact studies of materials.
- 材料科学文献检索Covers formulating literature search queries for materials science questions and synthesizing/citing results responsibly. Requires a web search tool; it cannot substitute for one.
- 工程材料选型设计Selects engineering materials via material indices and Ashby charts, ranking candidates by performance per cost or mass. Use when picking a material class for a design constraint.
- 材料统计方法与实验设计Covers statistics shared across materials characterization and simulation: design of experiments. Use for cross-cutting statistical treatment of materials data.
常见问题
材料结构与成分核心分析能做什么?
Covers core structure and composition analysis: reading/writing crystal structures, composition handling, symmetry analysis, phase diagrams. Use as a general-purpose structure-analysis toolkit。
如何安装材料结构与成分核心分析?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「材料结构与成分核心分析」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
材料结构与成分核心分析需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
材料结构与成分核心分析经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。