Skip to main content

MD 轨迹分析脚本

mdtool 提供了多种工具, 安装脚本:

pip install mdtool --upgrade

密度分布

氢键

单个水分子

氢键分布

角度

与表面法向量夹角分布

ion - O - ion 夹角分布

$\cos \phi \rho_{H_2 O}$ 分布

RDF

位置归一化

wrap用于将轨迹文件中的原子位置进行归一化处理, 如将[FILENAME]中的原子位置归一化到晶胞中, 并输出为wrapped.xyz, 默认从cp2k的输出文件input_inp中读取ABC和ALPHA_BETA_GAMMA信息作为晶胞参数:

mdtool wrap [FILENAME] 

或指定cp2k的输入文件:

mdtool wrap [FILENAME] --cp2k_input_file setting.inp

或指定晶胞参数:

mdtool wrap [FILENAME] --cell 10,10,10

默认的[FILENAME]为*-pos-1.xyz

DFT 性质分析脚本

PDOS

静电势

电荷差分

其他

轨迹提取

extract用于提取轨迹文件中的特定的帧, 如从frames.xyz中提取第 1000 帧到第 2000 帧的轨迹文件, 并输出为1000-2000.xyz, -r选项的参数与Python的切片语法一致:

mdtool extract frames.xyz -r 1000:2000 -o 1000-2000.xyz

或从cp2k的默认输出的轨迹文件*-pos-1.xyz文件中提取最后一帧输出为extracted.xyz(extract的默认行为):

mdtool extract

或每50帧输出一个结构到./coord目录中, 同时调整输出格式为cp2k的@INCLUDE coord.xyz的形式:

mdtool extract -cr ::50

结构文件转换

convert用于将结构文件从一种格式转换为另一种格式, 如将structure.xyz转换为out.cif(默认文件名为out), 对于不储存周期性边界条件的文件, 可以使用--cell选项指定PBC:

mdtool convert -c structure.xyz --cell 10,10,10

将structure.cif转换为POSCAR:

mdtool convert -v structure.cif

将structure.cif转换为structure_xyz.xyz:

mdtool convert -c structure.cif -o structure_xyz

数据处理

data用于对数据进行处理如:

  1. --nor: 对数据进行归一化处理
  2. --gaus: 对数据进行高斯过滤
  3. --fold: 堆数据进行折叠平均
  4. --err: 计算数据的误差棒 等

绘图工具

plot用于绘制数据图, plot需要读取yaml格式的配置文件进行绘图, yaml文件的形式如下:

# plot mode 1
figure1:
  data:
    legend1: ./data1.dat
    legend2: ./data2.dat
  x:
    0: x-axis
  y:
    1: y-axis
  x_range: 
    - 5
    - 15

# plot mode 2
figure2:
  data:
    y-xais: ./data.dat
  x:
    0: x-axis
  y:
    1: legend1
    2: legend2
    3: legend3
    4: legend4
    5: legend5
  y_range:
    - 0.5
    - 6
  legend_fontsize: 12

# plot mode error
12_dp_e_error:
  data:
    legend: ./error.dat
  x:
    0: x-axis
  y:
    1: y-axis
  fold: dp
  legend_fontsize: 12

如上plot支持三种绘图模式, mode 1, mode 2和mode error. mode 1用于绘制多组数据文件的同一列数据对比, mode 2用于绘制同一数据文件的不同列数据对比, mode error用于绘制均方根误差图.

plot可以同时处理多个yaml文件, 每个yaml文件可以包含多个绘图配置, mode 1和mode 2的绘图配置可以自动识别, 但是error模式需要而外指定, 如:

mdtool plot *.yaml

和:

mdtool plot *.yaml --error

Metadata

Release files for mdtool 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mdtool 0.1.10
File Size Uploaded Provenance Actions
mdtool-0.1.10.tar.gz 29.6 kB Without provenance Details for mdtool-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mdtool 0.1.10
File Interpreter ABI Platform Actions
mdtool-0.1.10-py3-none-any.whl Python 3 none any Details for mdtool-0.1.10-py3-none-any.whl

Total release size: 73.8 kB

Release files / mdtool-0.1.10.tar.gz

Download URL mdtool-0.1.10.tar.gz
Size 29.6 kB
Tags Source
SHA-256 checksum
How to use checksums
340c66bfc7c553caa0b9985b1dcecd698cce6e41dbba9f07f226824093efcaa4
BLAKE2b-256 checksum
How to use checksums
d6d47acbae4f3fb8f748b2c533a1935ddd9fffd1948d68e968701332c8b0576a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.11.9 Windows/10

Release files / mdtool-0.1.10-py3-none-any.whl

Download URL mdtool-0.1.10-py3-none-any.whl
Size 44.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f9693203c995c25e6d621071d9f425aaafccca35ff74b0a8304f69ba88198b2
BLAKE2b-256 checksum
How to use checksums
8f8d01425b39b74f6655e4f6701ffd1e6f23e5cd289873b69e307327bbe5cbfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.11.9 Windows/10

Security for mdtool 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page