Skip to content

Conversation

@kirk0830
Copy link
Collaborator

@kirk0830 kirk0830 commented Feb 4, 2026

PR checklist

Code review will be requested after the following checklist is completed:

  • support LTS version I/O
  • support latest version (other than LTS) I/O
  • complete examples
  • adjust unit tests
  • add integrated tests
  • add a automatic workflow on PR to ensure this plugin can work normally after merge of any PR

What's changed: abacuslite

Background and Motivation

With the rapid development of computational materials science, an increasing number of DFT software packages and machine learning force fields are being developed. In the past, the approach of merging all calculator implementations into the main ASE (Atomic Simulation Environment) branch has placed significant maintenance burden on the ASE development team.

This has led us to rethink the best way to integrate ABACUS with ASE. After careful consideration, we decided to develop a lightweight, plugin-style calculator implementation that can be maintained independently.

Key Advantages of This Approach

  1. Reduced Maintenance Burden: By maintaining our own calculator implementation, we alleviate the workload on the ASE development team while ensuring we can quickly adapt to changes in ABACUS.

  2. Simplified Maintenance: Unlike forking and modifying ASE, this plugin-based approach significantly reduces the maintenance cost of periodically pulling changes from the main ASE branch.

  3. Improved Consistency: We plan to integrate this implementation into our PR testing workflow. When ABACUS output formats change, our CI/CD pipeline will force developers to adapt the code here, ensuring consistency between ABACUS core code and this calculator implementation.

  4. Version Compatibility: This implementation is designed to work with most ASE versions, eliminating the previous restrictions to specific ASE versions.

Introduction

abacuslite is a lightweight plugin for ABACUS (Atomic-orbital Based Ab-initio Computation at UStc), implementing the ASE (Atomic Simulation Environment) calculator interface.

Key Features

  • Lightweight Design: Implemented as a plugin, no need to modify ASE core code
  • Version Compatibility: No longer restricted to specific ASE versions, works with most ASE versions
  • ASE Integration: Uses ASE as the running platform, making ABACUS a callable calculator within it

Special notes

As designed, abacuslite only supports SCF (Self-Consistent Field) related functionality, returning energy, forces, stress, etc. All other functionalities including relaxation, transition state searching, molecular dynamics, etc. are designed to call the implementation in ASE.

Installation

Installation is very simple, just execute the following command in the project root directory:

pip install .

Usage Examples

Please refer to the example scripts in the examples folder. Recommended learning path:

  1. scf.py - Basic SCF calculation example
  2. relax.py - Atomic position relaxation calculation
  3. cellrelax.py - Cell parameter relaxation calculation
  4. bandstructure.py - Band structure calculation
  5. dos.py - Density of states calculation
  6. md.py - Molecular dynamics simulation
  7. constraintmd.py - Constrained molecular dynamics simulation
  8. metadynamics.py - Metadynamics simulation
  9. neb.py - Nudged elastic band calculation (by @QuantumMisaka)

More usage examples will be provided in future versions.

Authors

Contact

If you have any questions or suggestions, please contact us through:

Relationship with pyabacus

One may concern about the possible overlap and conflict with the pyabacus, the relationship with pyabacus is declared below:

Pyabacus is the package aimed for calling ABACUS in the Pythonic way, which benefits from the module design of ABACUS so that there are functionalities can be compiled individually as the callable libraries. Enabled by Pybind, those libraries can be imported directly in Python, the data is made possible to exchange between the C++ and Python in runtime. Therefore it is something like the implementation of a part of ABACUS.

abacuslite is the package for interfacing with the ASE ecosystem. By the uniformed interface and data structure, it is possible to utilize the various algorithms implemented in ASE, including structural relaxation, transition state searching, etc., therefore there is no overlap between the pyabacus and abacuslite, instead, it will be possible in the future that abacuslite call pyabacus to perform calculation, rather than executing the "mpirun -np X abacus" by the AbacusProfile instance (In ASE, the "Profile" is designed as the interface for the program to interact with the file i/o system and computing environment).

@kirk0830
Copy link
Collaborator Author

kirk0830 commented Feb 4, 2026

20260204: it works with ABACUS LTS version, the parser for latest version is to be implemented.
cc: @QuantumMisaka

fix(io): 移除legacyio.py中已弃用的read_istate函数

test: 添加xtest.sh测试脚本和测试文件

ci: 配置GitHub Actions工作流实现自动化测试

docs: 更新示例脚本包括DOS计算、约束MD、MTD和常规MD

refactor(core): 清理未完成的restart测试代码

style: 统一文件格式和代码风格
添加测试用例验证从running_log文件中正确读取电子求解器类型和能带信息。同时包含对轨迹、力和应力读取功能的测试。
修改测试文件路径和预期值以匹配新的测试数据文件nspin4-gamma-mddump,该文件包含2帧数据而非原来的11帧,且alat_in_angstrom值不同
修复测试方法命名错误,将read_*改为test_read_*以正确执行测试
添加对轨迹、力和应力读取功能的详细测试断言
更新应力测试以匹配实际单位转换逻辑
添加对读取结果中原子和k点类型的断言检查,确保返回的Atoms对象及其计算器属性类型正确
- 在xtest.sh中添加set -e以确保错误时退出
- 修复generalio.py中的类型提示和路径处理
- 更新legacyio.py以支持非共线磁矩读取
- 添加新的测试文件并更新测试用例
- 修正KPT文件读写逻辑
refactor(core): 重构核心测试用例,使用临时目录并简化测试逻辑

feat(ksampling): 添加k路径生成功能,集成seekpath库

docs(examples): 更新带结构示例,引用seekpath并简化代码
@kirk0830 kirk0830 marked this pull request as ready for review February 10, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant