Skip to main content
Y

hpc-quantchem-workflow

yangdw2024/hpc-quantchem-workflow

Zero-hardcoding skill bundle and Bash/Python stdlib toolkit for SSH HPC clusters (SGE, Slurm, PBS): SSH onboarding and login-node safety rules, .fchk/.fch property parser, Gaussian 16 workflow input generator (Opt+Freq, TD-DFT, S1 opt, reorganization energy, dimer coupling), Marcus charge-transfer kinetics calculator, and 11-mode queued Multiwfn_noGUI batch runner.

Install

dsh plugin --profile web add github:yangdw2024/hpc-quantchem-workflow

README

hpc-quantchem-workflow

零硬编码、跨平台(Windows / macOS / Linux)SSH 高性能计算(HPC)集群接入与量化 / 有机光电计算全流程 AI Agent 技能套件。
Zero-hardcoding AI Agent skill & CLI workflow toolkit for SSH HPC clusters (SGE / Slurm / PBS), Gaussian 16, Multiwfn, and Marcus charge-transfer kinetics.

一键快速安装 / Quick Install

使用场景一行命令(复制即用)
DeepSeek Harness (DSH) 原生插件(推荐)dsh plugin add @yangdw2024/hpc-quantchem-workflow(或在插件市场搜索 hpc-quantchem-workflow 一键安装)
全 AI Agent 一键安装(DSH / Claude Code / Codex / Cursor / Antigravity)npx -y @yangdw2024/hpc-quantchem-workflow(支持 --all / status / uninstall)
skills.sh 生态npx skills add yangdw2024/hpc-quantchem-workflow
Windows 无 Node.js 一键脚本irm https://raw.githubusercontent.com/yangdw2024/hpc-quantchem-workflow/main/scripts/install.ps1 | iex
macOS / Linux 无 Node.js 一键脚本curl -fsSL https://raw.githubusercontent.com/yangdw2024/hpc-quantchem-workflow/main/scripts/install.sh | bash
离线压缩包前往 GitHub Releases 下载 hpc-quantchem-workflow-v1.0.1.zip 解压到对应 Agent 的 skills/ 目录

核心特性 / Features

  • 零硬编码、即插即用:不包含任何私有 IP、主机名、账号或路径;纯 Bash + Python 3 标准库实现,零第三方依赖。
  • 跨调度器兼容:mwfn_suite.sh 自动识别 SGE (qsub) / Slurm (sbatch) / PBS (qsub) / local,并支持 --dry-run 预览作业脚本。
  • 登录节点保护与安全护栏:
    • 严禁在登录节点直接运行 g16、orca、vasp、gmx 或未限核的 Multiwfn_noGUI;
    • 强制传入 -nt 覆盖 Multiwfn 默认 settings.ini 中的 nthreads;
    • 删除、覆盖、取消/挂起作业及提交任务前均要求先列出完整命令向用户确认;
    • 大文件 .log/.out 仅做有界读取(head/tail/grep)。
  • 完整量化与有机光电工作流:
    1. SSH 免密与只读探测:references/ssh-onboarding.md + references/scheduler-cheatsheet.md
    2. .fchk/.fch 性质秒读汇总:scripts/parse_fch_props.py(分子式、SCF 能量、HOMO/LUMO/能隙、偶极矩、三维尺寸与包围盒体积,支持 --csv)
    3. Multiwfn 队列化批处理(11 项):scripts/mwfn_suite.sh
      • 基态分子性质:esp、rdg、orbital、adch、hirshfeld、mulliken、mayer、mpp
      • 激发态分析:hole_elec(电子-空穴)、nto(自然跃迁轨道)、tdm(跃迁偶极矩)
    4. Gaussian 16 输入生成:scripts/gen_g16_workflow.py(optfreq、tddft 自动加 IOp(9/40=4)、s1opt、4 点内重组能 reorg、二聚体电子耦合三单点 coupling)
    5. 激发态与 Marcus 速率后处理:scripts/calc_ct_marcus.py(TD-DFT 解析、4 点法内重组能 $\lambda_{\text{in}}$、半经典 Marcus 电荷转移/复合速率 $k_{\text{CT}}/k_{\text{CR}}$ 与寿命 $\tau$)
    6. 一键部署 17 个独立快捷脚本到远端:scripts/deploy_to_hpc.sh

快速安装 / Installation

将该仓库克隆到你所用 AI Agent 的技能目录即可(支持 DeepSeek Harness / Codex / Claude Code 等遵循 Agent Skills 规范的客户端):

# 示例:安装到全局 ~/.agents/skills/
git clone https://github.com/yangdw2024/hpc-quantchem-workflow.git ~/.agents/skills/hpc-quantchem-workflow

Windows PowerShell 示例:

git clone https://github.com/yangdw2024/hpc-quantchem-workflow.git "$env:USERPROFILE\.agents\skills\hpc-quantchem-workflow"

目录结构 / Repository Layout

hpc-quantchem-workflow/
├── SKILL.md                          # AI Agent 技能指令入口
├── README.md                         # 项目说明文档
├── LICENSE                           # MIT 开源协议
├── .gitignore                        # 忽略计算大文件与 SSH 私钥
├── .gitattributes                    # 统一 LF 换行符(兼容 Linux HPC)
├── references/
│   ├── ssh-onboarding.md             # 跨平台 SSH 免密配置与只读环境探测
│   └── scheduler-cheatsheet.md       # SGE / Slurm / PBS 命令对照与避坑手册
└── scripts/
    ├── mwfn_suite.sh                 # Multiwfn 队列化批处理(11 项任务,自动探测调度器)
    ├── parse_fch_props.py            # 纯 Python 秒读 .fchk/.fch 并批量导出 CSV
    ├── gen_g16_workflow.py           # Gaussian 16 输入生成(Opt+Freq/TD-DFT/Reorg/Coupling)
    ├── calc_ct_marcus.py             # TD-DFT / 4 点内重组能 / Marcus 速率后处理
    └── deploy_to_hpc.sh              # 一键部署到远端 HPC 并生成 17 个独立快捷命令

常用示例 / Quick Usage

# 1. 秒读单个或整目录 .fchk 的 HOMO/LUMO/能隙/偶极矩/尺寸
python3 scripts/parse_fch_props.py ./fchk_dir --recurse --csv summary.csv

# 2. 生成 Multiwfn SGE/Slurm 作业脚本(建议先 --dry-run 检查)
bash scripts/mwfn_suite.sh --task esp --wfn mol.fchk --nproc 8 --dry-run
bash scripts/mwfn_suite.sh --task hole_elec --wfn td.fchk --tdlog td.log --state 1 --nproc 8

# 3. 生成 Gaussian 16 输入(4 点重组能 / TD-DFT / 二聚体电子耦合)
python3 scripts/gen_g16_workflow.py --type tddft --xyz mol.xyz --func cam-b3lyp --basis "def2SVP"
python3 scripts/gen_g16_workflow.py --type reorg --xyz mol.xyz --carrier hole --func b3lyp --basis "6-311G(d,p)"
python3 scripts/gen_g16_workflow.py --type coupling --xyz dimer.xyz --split 42 --func b3lyp --basis "6-31G(d)"

# 4. 后处理:TD-DFT 解析 / 重组能 / Marcus 速率
python3 scripts/calc_ct_marcus.py tddft mol_tddft.log
python3 scripts/calc_ct_marcus.py reorg --e0-q0 1.log --eion-q0 2.log --eion-qion 3.log --e0-qion 4.log
python3 scripts/calc_ct_marcus.py marcus --V 15.2 --lam-in 0.25 --lam-out 0.30 --dG -0.45 --T 298.15

# 5. 一键部署到任意已打通 SSH 的 HPC 集群(包含 17 个 standalone 快捷脚本)
bash scripts/deploy_to_hpc.sh <ssh-host-alias> ~/scripts/qc_kit

适用边界说明

  • SSH 集群:适用于允许本地通过 SSH 直连(含校内网/VPN/跳板机)的 SGE / Slurm / PBS 集群及本地 Linux 工作站。
  • 纯 Web 门户集群(禁止直连 22 端口 SSH 的超算网页终端):请配合 hpc-web-copilot 使用。

License

MIT

Related plugins