Chuyển đến nội dung
Skillpedia
Học máy51k · #3542

pymatgen

Skill này làm gì

Công cụ này giúp phân tích và sắp xếp dữ liệu về vật liệu. Nó có thể kiểm tra thông tin, chuyển đổi định dạng và hiểu đặc tính của cấu trúc và hợp chất hóa học.

Khi nào nên dùng

  • ✓Khi bạn có dữ liệu vật liệu và muốn đảm bảo nó chính xác.
  • ✓Khi cần chuyển dữ liệu từ định dạng này sang định dạng khác.
  • ✓Để hiểu cấu trúc và đặc tính của một vật liệu.

Liên kết skill

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pymatgen/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pymatgen/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Phân tích tệp cấu trúc vật liệu này và cho tôi biết các đặc tính của nó.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng một bộ quy tắc và hàm để đọc, kiểm tra và xử lý thông tin vật liệu. Nó đảm bảo mỗi bước được ghi lại để giữ độ chính xác.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

pymatgen

Use pymatgen for explicit, provenance-preserving work with compositions, molecules, periodic structures, computed entries, symmetry, phase diagrams, electronic structures, and electronic-structure-code files. Treat every parse, conversion, symmetry assignment, transformation, and database result as method- and parameter-dependent.

The MIT frontmatter license covers this skill. pymatgen and pymatgen-core are MIT; mp-api declares BSD-3-Clause-LBNL. Materials Project data is generally CC BY 4.0, while contributed data remains owned by its contributors. Check the exact artifact and data terms before redistribution.

Verified snapshot (2026-09-30)

  • pymatgen==2026.9.24 is the latest stable wrapper release (uploaded 2026-09-23). Package metadata requires Python 3.11+ and directly requires pymatgen-core>=2026.9.23.
  • pymatgen-core==2026.9.23 is the latest stable core release (2026-09-23). It now contains core objects, symmetry/lattice operations, and the I/O layer, all under the existing pymatgen.* namespace.
  • mp-api==0.46.5 is the latest stable Materials Project client (2026-08-18), requires Python 3.11+, and depends on pymatgen>2024.2.20.
  • The current API site is built from 2026.9.23 core documentation. Pinning both distributions prevents pymatgen==2026.9.24 from silently resolving to a different future core.
  • Pymatgen uses date-based versions. PyPI renders the date with dots; do not infer semantic-version compatibility from the numbers.

The local CLI suite and synthetic examples were executed on this snapshot. File-dependent VASP/Q-Chem parses and authenticated API examples below are illustrative: their signatures and current SDK source were checked, but no licensed calculation or authenticated service retrieval was performed.

Create a project lock for reproducibility:

uv init --python 3.11
uv add "pymatgen==2026.9.24" "pymatgen-core==2026.9.23" "mp-api==0.46.5"
uv lock
uv sync --frozen

For a disposable reviewed environment:

uv venv --python 3.11 .venv-pymatgen
uv pip install --python .venv-pymatgen/bin/python \
  "pymatgen==2026.9.24" "pymatgen-core==2026.9.23" "mp-api==0.46.5"

Direct pins do not freeze all transitive wheels. Preserve uv.lock, platform, Python version, package versions, and artifact hashes.

Required workflow

  1. State whether the object is a non-periodic Molecule or periodic Structure; record lattice and periodic boundary conditions.
  2. State units. Pymatgen commonly uses Å, degrees, eV, eV/atom, amu, and g/cm³, but each API's documented contract is authoritative.
  3. State coordinate mode. Structure coordinates are fractional unless coords_are_cartesian=True; Molecule coordinates are Cartesian.
  4. Inspect every parser warning. For CIF, preserve occupancy, site-merging, stoichiometry, and correction warnings; do not silently accept fixes.
  5. Report disorder/partial occupancies and oxidation-state decoration. Never guess oxidation states implicitly.
  6. Run validation before symmetry, neighbor, transformation, conversion, or thermodynamic analysis.
  7. Sweep symmetry tolerances and report symprec in Å and angle_tolerance in degrees with every assignment.
  8. Treat transformations as new artifacts. Preserve the input, parameters, software versions, warnings, and parent/child checksums.
  9. Before conversion, identify representation loss. Write only to a new path and round-trip-check scientifically relevant properties.
  10. Build phase diagrams only from compatible total energies and correction schemes. A computed hull is conditional on the supplied entry set.
  11. Keep all database access off by default. Disclose endpoint, filters, fields, result limit, cache behavior, output, license, and citation before an explicit execution step.
  12. Preserve an artifact manifest. Never use pickle or load an untrusted general object graph; use schema-validated JSON and explicit constructors.

Core objects

Use the public convenience imports:

from pymatgen.core import Composition, Element, Lattice, Molecule, Structure

composition = Composition("LiFePO4", strict=True)
iron = Element("Fe")

lattice = Lattice.cubic(5.64)  # Å
structure = Structure(
    lattice,
    ["Na", "Cl"],
    [[0, 0, 0], [0.5, 0.5, 0.5]],
    coords_are_cartesian=False,
    validate_proximity=True,
)

molecule = Molecule(
    ["O", "H", "H"],

…
Câu hỏi thường gặp

“Cấu trúc” và “hợp chất” trong ngữ cảnh này là gì?

Cấu trúc là sự sắp xếp nguyên tử của vật liệu trong không gian. Hợp chất là sự kết hợp của các nguyên tố hóa học tạo thành vật liệu.

Tại sao cần ghi lại mọi bước?

Ghi lại mọi bước (nguồn gốc) đảm bảo bạn biết chính xác kết quả được tạo ra như thế nào, để người khác có thể kiểm chứng hoặc tái tạo công việc của bạn một cách tin cậy.

Tôi có thể dùng cho vật liệu không kết tinh không?

Có. Công cụ có thể xử lý cả cấu trúc tuần hoàn (như tinh thể) và phân tử không tuần hoàn.

Chi tiết

Mô tả gốc của tác giả

Analyzes, validates, converts, and transforms materials structures and computed materials data with pymatgen. Use for local phase diagrams, symmetry sensitivity, electronic-structure I/O, and bounded Materials Project queries.

repo: K-Dense-AI/scientific-agent-skills

Độ phổ biến

Sao GitHub
51k
Vị trí xếp hạng
#3542
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự