Python

使用 Python/Matplotlib 绘制多元素吸附能曲线网格图

Published: 2026-05-01

在密度泛函理论(DFT)计算化学研究中,绘制 adatom(吸附原子)沿表面法线方向的吸附能曲线是分析表面催化性质的重要手段。本文介绍一个完整的 Python 脚本,利用 Matplotlib 将六种元素(N、H、C、Si、O、S)在四种吸附位点(Top、Bridge、fcc、hcp)上的 $\Delta E_{\mathrm{ads}}$ 曲线以 $3 \times 2$ 网格布局呈现,每个面板同时包含主图和局部放大图。

使用 Pix2Text 将复杂 PDF 文档进行 OCR 识别并转换为 LaTeX / Markdown

Published: 2026-04-04

在学术研究或日常工作中,我们经常会遇到需要将扫描版 PDF 文档或包含复杂数学公式的书籍提取为可编辑的 Markdown 或 LaTeX 源码的需求。传统的文字识别(OCR)工具往往对版面结构和复杂的数学公式无能为力,而 Pix2Text 则提供了一套强大且开源的解决方案。本文将详细记录在 macOS 环境下,从安装配置环境、下载核心深度学习模型,到最终成功把 PDF 转换为包含公式的 Markdown 文件的完整流程。

使用 AbiPy 提取 ABINIT 几何优化轨迹并在 OVITO 中可视化

Published: 2026-03-30

在第一性原理材料计算中,ABINIT 是一款极为强大的软件平台,而它的结构输出往往依赖专门的解析工具来进行提取与转化。借助 AbiPy 与 Python 库的强大特性,我们不仅可以克服环境模块兼容性的阻碍,还能无缝实现多步骤几何优化轨迹(HIST.nc)往 Extended XYZ 格式的批量转换。本指南将介绍如何自动化完成这一提取任务,为基于 OVITO 的晶格渲染与三维结构动态可视化铺平道路。

使用 Python 和 Matplotlib 绘制总能差柱状图

Published: 2026-03-30

在长期的材料计算与分子模拟中,对比不同结构间的能量变化往往是评估物理体系平衡与稳定性的关键环节。本文将展示如何通过一段精简的 Python 脚本自动读取 CSV 数据文件,并结合 Matplotlib 绘制包含类 LaTeX 字体排版的高质量总能差(Total Energy Difference)柱状图。

使用 abipy 批量提取 VASP 几何优化的最终结构

Published: 2026-03-19

在进行密度泛函理论(DFT)等高通量计算任务时,从大量的计算目录下提取出几何优化完成的最终晶体结构往往是一项繁琐的工作。本文将分享一个实用的 Python 脚本,它整合了 abipypymatgen,能够自动遍历计算目录、判断收敛状态,并高效地提取出用于后续计算的 VASP POSCAR 文件。

Abinit几何优化收敛监控与可视化工具

Published: 2026-03-19

在计算材料科学和第一性原理研究中,几何优化的收敛过程常常耗时较长且中途可能出现不稳定的振荡。本文为大家提供了一款自动化的 Python 监控脚本,用于批量读取和可视化 Abinit 软件在优化过程中记录的轨迹数据,帮助研究人员快速掌控计算进度与系统状态。

The Codes of Crystal Structure Optimisation with FAIRChem

Published: 2025-11-19

Machine learning interatomic potentials (MLIPs) are rapidly changing the landscape of materials simulation. This post provides a practical walkthrough of using FAIRChem, a powerful MLIP model, to perform geometry optimisation on crystal structures, building upon our previous introduction to the topic.

Building Aluminium Slabs with ASE

Published: 2025-11-16

This comprehensive guide demonstrates how to construct aluminium slab and bulk structures using the Atomic Simulation Environment (ASE) in Python. We explore automated surface generation methods, structural transformations, and best practices for creating simulation-ready geometries in VASP format.

Extracting Optimised Structures from ABINIT Output Files Using Abipy

Published: 2025-11-16

This guide demonstrates how to extract optimised crystal structures from ABINIT's NetCDF output files using the Abipy library. The workflow presented here simplifies the process of retrieving final geometries, tracking optimisation trajectories, and exporting structures in multiple formats for further analysis.

uv: Python Package Management

Published: 2025-10-20

uv is a lightning-fast Python package manager written in Rust by the Astral team, designed to be a unified replacement for pip, venv, pip-tools, poetry, pyenv, and more. This comprehensive guide explores how uv transforms Python development workflows with unprecedented speed and modern tooling.

Getting Started with FAIRChem

Published: 2025-10-14

FAIRChem is a powerful machine learning framework developed by Meta AI for accelerating materials discovery and catalysis research. This comprehensive guide walks you through using FAIRChem, from exploring the web-based demo to performing local energy calculations on macOS.

Setting Up a Conda Environment for Scientific Computations (DFT)

Published: 2025-10-02

Setting up a reproducible computational environment is crucial for density functional theory (DFT) calculations and materials science research. This guide walks you through creating a dedicated Conda environment equipped with essential tools for DFT analysis, visualization, and machine learning applications in computational chemistry.