PhyMLP Kit

PhyMLP快速开始

  • phymlp简介
    • 快速开始指南
      • 快速开始指南
      • 概述
      • 安装与设置
        • 1. 环境要求
        • 2. 安装 PhyMLP Kit
        • 3. 配置软件路径
      • 基本使用
      • 核心功能模块
        • 1. 机器学习势训练
        • 2. 初始势函数生成
        • 3. 数据格式转换
        • 4. 数据集处理
        • 5. 自动训练集生成流程
        • 6. 数据分析与拟合
        • 7. 数据集生成
        • 8. 完整工作流
      • 典型工作流程示例
        • 1. 准备阶段
        • 2. 训练阶段
        • 3. 扩展训练集(可选)
        • 4. 验证阶段
      • 配置说明
        • 1. 主配置文件(input.yaml)
        • 2. 训练配置文件(Inputfile)
      • 常见问题
        • 1. 软件路径错误
        • 2. 训练失败
        • 3. VASP 计算设置错误
        • 4. 数据集生成问题
      • 高级功能
        • 1. 批量处理
        • 2. 自定义工作流
        • 3. 并行计算
      • 获取帮助
      • 下一步
    • 配置文件说明
      • 自动采样配置参数
        • 自动化获取训练集配置文件
        • 概述
        • 详细参数说明
        • 使用示例
        • 注意事项
        • 相关文档
      • 自动训练及检验配置
        • 训练和检验配置文件
        • 概述
        • 详细参数说明
        • 配置示例
        • 使用流程
        • 常见问题
        • 相关文档
        • 版本说明

命令行工具模块(开发者模块)

  • 命令管理模块说明
    • 概述
    • 模块架构
    • 模块详细说明
      • 1. 训练与验证模块
        • 1.1 train - 机器学习势训练
        • 1.2 init_phymlp - 初始势函数生成
      • 2. 数据转换模块
        • 2.1 outcar2extxyz - OUTCAR 转 Extxyz
        • 2.2 cfg2extxyz - CFG 转 Extxyz
        • 2.3 dump_to_poscar - LAMMPS Dump 转 POSCAR
      • 3. 数据集处理模块
        • 3.1 split_set - 数据集分割
        • 3.2 generate_kpath - KPATH 生成
      • 4. 自动训练集生成模块
        • 4.1 from_mp_structures - Materials Project 结构获取
        • 4.2 deform_structures - 形变结构生成
        • 4.3 perturb_structures - 微扰结构生成
      • 5. VASP 计算模块
        • 5.1 setup_vasp - VASP 计算设置
        • 5.2 submit_vasp - VASP 作业提交
        • 5.3 test_potcar - POTCAR 测试
      • 6. 数据分析模块
        • 6.1 process_deform - 形变结果处理
        • 6.2 birch_murnaghan - Birch-Murnaghan 拟合
        • 6.3 exp_pv_structures - 实验 P-V 数据拟合
        • 6.4 generate_extxyz - Extxyz 数据集生成
      • 7. 工作流模块
        • 7.1 full_workflow - 完整工作流
    • 配置系统
      • 1. 配置文件类型
      • 2. 配置解析机制
      • 3. 动态模块导入
    • 错误处理机制
      • 1. 导入错误处理
      • 2. 文件系统错误
      • 3. 计算错误处理
    • 扩展与定制
      • 1. 添加新命令
      • 2. 模块扩展
    • 性能优化
      • 1. 批量处理
      • 2. 缓存机制
    • 使用建议
      • 1. 新手建议
      • 2. 高级用户
      • 3. 开发人员
    • 相关链接
    • 更新日志

LAMMPS计算工具模块

  • get_KPATH 模块说明
    • 概述
    • 功能特性
    • 快速开始
      • 基本使用方式
      • 前置要求
    • 核心函数详解
      • generate_kpath 函数
        • generate_kpath()
    • VASPKIT 交互选项详解
    • 输出文件说明
      • KPOINTS 文件
      • KPATH.in 文件
      • SYMMETRY 文件
    • 错误处理机制
      • 权限错误处理
      • 管道错误处理
      • 文件存在性检查
    • 使用示例
      • 基本示例
      • 集成到工作流
      • 批量处理示例
    • 常见问题解答
      • Q1: 运行时提示 “权限错误: 无法执行Vaspkit”
      • Q2: VASPKIT 启动后立即退出,没有生成文件
      • Q3: 生成的 KPOINTS 文件采样点数不合适
      • Q4: 需要为不同精度生成多个 KPATH
    • 性能优化建议
    • API 参考
      • 函数列表
        • generate_kpath()
      • 异常列表
        • PermissionError
        • FileNotFoundError
    • 相关链接
    • 更新日志
      • 版本历史
      • 计划功能

数据集处理模块

  • split_set 模块说明
    • 概述
    • 功能特性
    • 快速开始
      • 基本使用方式
      • 命令行参数详解
    • 核心函数详解
      • split_extxyz_structures 函数
        • split_extxyz_structures()
    • EXTXYZ 格式详解
      • 格式概述
      • 关键字段说明
      • 格式解析逻辑
    • 使用示例
      • 基础示例
      • 高级使用示例
      • 集成到训练工作流
      • 带随机种子的分割
    • 错误处理机制
      • 输入文件检查
      • 比例参数验证
      • 格式验证
    • 性能优化
      • 内存优化策略
      • 并行处理优化
    • 最佳实践建议
      • 数据集比例选择
      • 数据质量检查
      • 随机性保证
    • 常见问题解答
      • Q1: 分割时提示 “输入文件不存在”
      • Q2: 验证集比例设置错误
      • Q3: 分割后文件为空
      • Q4: 需要按能量分层抽样
    • API 参考
      • 函数列表
        • split_extxyz_structures()
      • 异常列表
        • FileNotFoundError
        • ValueError
        • TypeError
    • 相关链接
    • 更新日志
      • 版本历史
      • 计划功能

训练及检验模块

  • 训练与检验模块
    • 概述
    • 模块架构
      • 模块架构图
    • PUBLIC 类详解
      • 类概述
      • 初始化参数
      • 默认参数设置
      • 核心方法详解
        • Read 方法
        • Key_and_parament 方法
        • _parse_value 方法
        • Bool_commands 方法
    • RUN 类详解
      • 类概述
      • 作业调度系统
        • SLURM 作业提交
        • _wait_for_job_completion 方法
        • _post_process 方法
        • _process_phonon 方法
      • 训练管理方法
        • Train_commands 方法
        • Train 方法
      • 计算管理方法
        • Calculate_dir 方法
        • Rewrite_lammps_in 方法
        • 输入文件修改方法
        • Execute 方法
    • 使用示例
      • 基本使用流程
      • 自定义配置示例
      • 批量计算示例
    • 错误处理机制
      • 配置文件错误
      • 作业提交错误
      • 参数验证
    • 性能优化建议
      • 并发作业提交
      • 资源监控
    • 常见问题解答
      • Q1: 配置文件读取失败,提示编码错误
      • Q2: SLURM 作业提交后立即失败
      • Q3: 训练过程中出现 “参数不正确” 错误
      • Q4: 如何自定义后处理脚本
    • API 参考
      • 类列表
        • PUBLIC
        • RUN
      • 异常列表
        • SystemExit
    • 相关链接
    • 更新日志
      • 版本历史
      • 计划功能

自动化训练集生成模块

  • 自动训练集生成模块
    • 概述
    • 主要特点
    • 核心功能
      • 从 Materials Project 获取结构
      • 结构形变生成
      • 原子位置微扰
      • VASP 计算设置
      • VASP 作业提交
      • POTCAR 生成测试
      • 形变结果处理
      • Birch-Murnaghan 拟合
      • 实验 P-V 数据拟合
      • 数据转 POSCAR
      • Extxyz 数据集生成
      • 完整工作流
    • 配置系统
    • 工作流程
    • 依赖关系
    • 使用示例
      • 基本使用
      • 分步执行
    • 常见问题
      • Q1: 如何获取 Materials Project API 密钥?
      • Q2: VASP 计算失败如何处理?
      • Q3: 如何自定义结构生成策略?
    • 进阶使用
      • 自定义插件
      • 批量处理
    • 相关文档
  • Birch-Murnaghan 拟合模块
    • 概述
    • 输入配置
      • 配置文件 (input.yaml)
      • 输入数据文件
    • 主要函数
      • 核心拟合函数
        • birch_murnaghan_eqn()
        • perform_fitting()
      • 数据处理函数
        • read_a_v_e_p_file()
        • filter_data()
      • 目录处理函数
        • find_a_v_e_p_files()
        • create_mirror_structure()
      • 结果输出函数
        • save_fitting_results()
      • 主工作流程
        • process_all_birch_murnaghan_fitting()
    • 输出文件
      • 拟合参数文件示例
    • 使用方式
      • 命令行使用
      • Python API使用
    • 目录结构
      • 输入目录结构
      • 输出目录结构
    • 注意事项
    • 常见问题
      • Q1: 拟合失败,提示”Not enough data points”
      • Q2: 找不到 a_V_E_P.txt 文件
      • Q3: 拟合结果不合理(B0为负数等)
    • 相关模块
  • 配置管理模块
    • 概述
    • 主要功能
    • 核心函数
      • load_config 函数
      • _set_default_values 函数
    • 配置结构
      • 路径配置 (paths)
      • 形变参数 (deformation)
      • 微扰参数 (perturbation)
      • VASP 计算参数 (vasp)
        • INCAR 参数 (incar_parameters)
        • POTCAR 配置 (potcar)
        • 作业提交配置 (submission)
      • Birch-Murnaghan 拟合配置 (birch_murnaghan_fitting)
      • Extxyz 数据集生成配置 (extxyz_generation)
    • 配置文件示例
    • 使用流程
    • 依赖关系
    • 最佳实践
    • 相关模块
  • 形变结构生成模块
    • 概述
    • 主要功能
    • 核心函数
      • find_optimal_supercell 函数
      • create_supercell 函数
      • scale_lattice 函数
      • process_structure_for_deformation 函数
      • main 函数
    • 配置参数
      • 路径配置
      • 形变参数
    • 文件命名规则
    • 目录组织结构
    • 使用示例
      • 命令行调用
      • Python 脚本调用
    • 依赖关系
    • 常见问题
      • Q1: 没有生成任何形变结构
      • Q2: 生成的原子数超过限制
      • Q3: 化学式识别错误
    • 相关模块
  • 实验P-V数据拟合模块
    • 概述
    • 主要功能
    • 核心函数
      • read_config 函数
      • read_exp_data 函数
      • save_dft_a_p_data 函数
      • fit_pressure_relation 函数
      • save_fitting_results 函数
      • plot_fitting_results 函数
      • main 函数
    • 配置文件结构
    • 实验数据格式
    • 输出文件说明
    • 使用方式
      • 命令行调用
      • Python脚本调用
    • 依赖关系
    • 常见问题
      • Q1: 实验数据文件读取失败
      • Q2: 拟合效果不理想(R²值过低)
      • Q3: 晶格常数计算错误
    • 应用场景
    • 相关模块
  • Materials Project结构获取模块
    • 概述
    • 主要功能
    • 核心函数
      • write_poscar_grouped_by_element 函数
      • copy_user_poscars 函数
      • search_with_retry 函数
      • get_available_surface_structures 函数
      • generate_basic_surfaces 函数
      • main 函数
    • 配置参数
    • 目录结构
    • 文件名格式
    • 使用方式
      • 命令行调用
      • Python脚本调用
    • API密钥获取
    • 输出文件说明
    • 依赖关系
    • 常见问题
      • Q1: API密钥无效或过期
      • Q2: 网络连接失败
      • Q3: 元素组合太多导致超时
      • Q4: 表面结构生成失败
    • 注意事项
    • 相关模块
  • extxyz数据集生成模块
    • 模块概述
    • 主要函数说明
      • find_outcar_files(search_dir, recursive=True)
      • extract_structures_from_outcar(outcar_file, output_file, step=10)
      • generate_vasp_extxyz(config)
      • load_birch_murnaghan_fitting_results(bm_dir, recursive=False)
      • extract_structures_from_outcar_scale(outcar_scale_dir, output_file, step=10)
      • find_reference_structure(outcar_scale_dir)
      • filter_data_by_pressure(data_file, pressure_range)
      • calculate_pressure_from_birch_murnaghan(params, volume)
      • generate_structures_from_fitting_curve(reference_atoms, fitted_data, output_file, structure_name, n_structures=50, pressure_range=None, original_data=None, scaling_factors_range=None, bm_params=None)
      • generate_birch_murnaghan_extxyz(config)
      • load_fit_a_P_data(fit_a_P_file)
      • gpa_to_ev_per_ang3(pressure_gpa)
      • generate_structures_from_fit_a_P(config)
      • merge_extxyz_files(config)
      • generate_extxyz_dataset(config_path)
      • generate_extxyz_from_config(config_path)
    • 使用示例
    • 配置文件说明
    • 输出文件
  • 结构微扰模块
    • 模块概述
    • 主要函数说明
      • find_optimal_supercell(structure, max_atoms=150, max_supercell=4)
      • create_supercell(structure, scaling_matrix)
      • process_structure_for_perturbation(poscar_path, output_base_dir, config)
      • generate_perturbation_fallback(structure, output_dir, base_filename, perturb_params)
      • main(config_file=”input.yaml”)
    • 配置参数说明
    • 使用示例
    • 输出文件结构
    • 注意事项
  • POTCAR生成器模块
    • 模块概述
    • 主要函数说明
      • read_poscar_elements(poscar_path)
      • find_potcar_files(potcar_base_dir, functional, elements, potcar_variants=None)
      • concatenate_potcar_files(potcar_paths, output_path)
      • generate_potcar_auto(poscar_path, config)
      • generate_potcar_pymatgen(structure, config)
      • generate_potcar(poscar_path, structure, config, output_dir)
    • 配置参数说明
    • 使用方法
    • 输出文件
    • 注意事项
  • 处理形变计算结果模块
    • 模块概述
    • 主要函数说明
      • classify_deform_directories(root_dir)
      • create_classified_structure(root_dir, classified_dict)
      • extract_vasp_data(directory)
      • process_all_deform_results(root_dir)
    • 输出文件结构
    • 数据文件格式
    • 使用示例
    • 注意事项
  • 工具函数模块
    • 模块概述
    • 主要函数说明
      • mkdir_output_load(path)
      • chemsys_comb(elements)
      • get_formula_from_filename(filename)
      • safe_copy(src, dst)
      • check_potcar_availability(config)
      • safe_path_join(*args)
      • check_file_exists(file_path)
    • 使用示例
    • 注意事项
  • VASP计算设置模块
    • 模块概述
    • 主要函数说明
      • create_incar(config)
      • setup_vasp_calculation(poscar_path, output_dir, config)
      • create_submission_script(output_dir, config)
      • discover_structure_dirs(input_paths)
      • process_directory_for_vasp(input_dir, output_base_dir, config, prefix=””)
    • 配置参数说明
    • 输入输出结构
    • 使用示例
    • 注意事项
  • VASP任务提交和管理模块
    • 模块概述
    • 主要函数说明
      • check_job_status(job_id)
      • check_calculation_success(calc_dir)
      • submit_job(calc_dir)
      • get_running_jobs()
      • discover_vasp_calc_dirs(vasp_dir)
      • submit_vasp_calculations(config_file=”input.yaml”)
    • 工作流程
    • 配置参数说明
    • 输出信息
    • 使用示例
    • 注意事项

训练集格式转换模块

  • LAMMPS转POSCAR模块
    • 概述
    • 主要功能
    • 核心类与方法
      • LammpsToPoscarConverter 类
      • set_atom_types_mapping 方法
      • read_dump_file 方法
      • calculate_lattice_vectors 方法
      • sort_atoms_by_type 方法
      • convert_to_poscar 方法
      • is_lammps_dump_file 方法
      • find_dump_files 方法
      • process_input 方法
      • process_single_file 方法
      • process_directory 方法
    • 工具函数
      • load_config 函数
      • convert_single_file 函数
      • process_directory 函数
      • parse_arguments 函数
      • create_default_config 函数
    • 配置文件结构
    • 输出文件命名
    • 使用方式
      • 命令行使用
      • Python脚本调用
    • 支持的文件格式
    • 注意事项
    • 常见问题
      • Q1: 转换后的POSCAR元素符号不正确
      • Q2: 没有找到任何dump文件
      • Q3: 盒子边界转换错误
    • 依赖关系
    • 相关模块
  • CFG到EXTXYZ格式转换器
    • 模块概述
    • 主要函数说明
      • parse_cfg_file(file_path)
      • write_extxyz(configs, output_file, type_map=None, float_fmt=”.9f”)
    • 原子类型映射(type_map)
    • 输入文件格式(CFG)
    • 输出文件格式(EXTXYZ)
    • 使用示例
    • 错误处理
    • 注意事项
  • OUTCAR到EXTXYZ格式转换器
    • 模块概述
    • 主要函数说明
      • extract_structures_from_outcar(outcar_file, output_file, step=1)
    • 输入文件(OUTCAR)
    • 输出文件(EXTXYZ)
    • 使用示例
    • 注意事项
    • 错误处理
PhyMLP Kit
  • Index

Index

_ | B | C | E | F | G | K | P | R | S | T | V

_

  • _parse_value() (PUBLIC method)
  • _post_process() (RUN method)
  • _process_phonon() (RUN method)
  • _wait_for_job_completion() (RUN method)

B

  • birch_murnaghan_eqn()
    • built-in function
  • Bool_commands() (PUBLIC method)
  • built-in function
    • birch_murnaghan_eqn()
    • create_mirror_structure()
    • filter_data()
    • find_a_v_e_p_files()
    • generate_kpath(), [1]
    • perform_fitting()
    • process_all_birch_murnaghan_fitting()
    • read_a_v_e_p_file()
    • save_fitting_results()
    • split_extxyz_structures(), [1]

C

  • Calculate_dir() (RUN method)
  • create_mirror_structure()
    • built-in function

E

  • Execute() (RUN method)

F

  • FileNotFoundError, [1]
  • filter_data()
    • built-in function
  • find_a_v_e_p_files()
    • built-in function

G

  • generate_kpath()
    • built-in function, [1]

K

  • Key_and_parament() (PUBLIC method)

P

  • perform_fitting()
    • built-in function
  • PermissionError
  • process_all_birch_murnaghan_fitting()
    • built-in function
  • PUBLIC (built-in class)

R

  • Read() (PUBLIC method)
  • read_a_v_e_p_file()
    • built-in function
  • Rewrite_lammps_in() (RUN method)
  • RUN (built-in class)

S

  • save_fitting_results()
    • built-in function
  • slurm_sub() (RUN method)
  • split_extxyz_structures()
    • built-in function, [1]
  • SystemExit

T

  • Train() (RUN method)
  • Train_commands() (RUN method)
  • TypeError

V

  • ValueError

© Copyright 2025, PhyMLP Development Team.

Built with Sphinx using a theme provided by Read the Docs.