pymdkit
A Python command-line toolkit for high-throughput atomistic workflows in AI-driven
materials design. Install pymdkit once and call its tools from anywhere as
pmk <command> [options].
Commands expose explicit, documented CLI interfaces designed for reproducible shell, HPC, and AI-agent workflows, and each underlying script is still runnable on its own.
1.7.10 release notes
The public command pmk ionhop becomes pmk jump-rate. It reports RESOLVED
jump rates, RMS jump distances, jump diffusivity, and a correlation factor for
matching tracer data. It verifies historical ionhop outputs before migration,
reuses verified results, and recovers interrupted batch publications.
Standalone pmk fit uses full-precision temperatures and frequencies for
verified jump-rate batches and reports apparent migration parameters.
Independent diffusion and Nernst–Einstein conductivity fits use integer Kelvin.
pmk msd -element Li -ne incrementally backfills number-density.txt from
verified MSD/NE provenance and leaves earlier Arrhenius files in place.
See the changelog, the Arrhenius development report, and the final audit report.
1.7.9 release notes
Element-resolved MSD, species-specific NE conductivity, headless plots and independent binary WLS/GLS plateau fitting are available. GPUMD jobs add PGV filtering and transactional pre-production handoff. See the development report.
MSD provenance now identifies the whole-system mass-weighted COM correction.
pmk zip-traj provides verified lossless trajectory compression and
decompression. The project audit also fixed negative XYZ atom counts and
nonfinite trjconv time inputs. See the
1.7.9 audit and compression report.
Batch processing and result preservation
Batch writers preserve existing independent structures, trajectories, plots and
calculation results by default. A job with existing files is reported explicitly.
pmk msd reuses results when their provenance verifies the inputs, outputs and
analysis settings. Handle incompatible or incomplete results manually before
retrying the affected job. Command logs append to their previous contents and
use a separate name when an operand occupies the default log path.
MSD merges previously published rows with newly calculated or verified rows.
Relative directory paths and, where applicable, element names identify records.
The tables sort by numeric production temperature, path and element. Failed or
incompatible jobs leave the previous summaries in place. MSD stores
full-precision, provenance-backed observations in .pmk_msd_index.json alongside
the public tables. Keep this file with the summaries to use accumulated
observations whose calculation directories are outside future scans.
See the 1.7.9 incremental batch report
for command coverage and validation.
Previous 1.7.8 improvements
Wrapped-only GPUMD trajectories now receive strict schema validation, a sampling
warning, and versioned coordinate provenance. Explicit unwrapped trajectories
retain the existing numerical analysis. Exact doping certification now filters
distance levels with applicable packing bounds and strengthens the graph model
with safe reductions, verified cliques, and corrected LP dual bounds.
See reports/1.7.8/development-report.md for measured results and limitations.
Previous 1.7.7 improvements
- Automatic
pmk dopeuses exact incremental exchange scores and bounded 2D work arrays, preserving the three ranking metrics and search budgets. --n-jobs Nruns independent restarts in N processes (default: 1). Choose N for your CPU allocation; large problems benefit most and speedup need not be proportional. This does not set MILP solver threads.- Restart seeds now use
SeedSequence.spawn: results are reproducible across worker counts, but a seed need not reproduce the 1.7.6 configurations. - Exact enumeration stays serial. Summary metadata reports actual workers, timings (worker times are summed), sweeps, and attempted/accepted exchanges.
pmk dope -i LiI-777.vasp -se Li -sn 392 -we vac -on 10 -o vacancies -ref vac vac -seed 42 --n-jobs 1
pmk dope -i LiI-777.vasp -se Li -sn 392 -we vac -on 10 -o vacancies-n4 -ref vac vac -seed 42 --n-jobs 4
pmk dope -i LiI-777.vasp -se Li -sn 392 -we vac -on 10 -o vacancies-n8 -ref vac vac -seed 42 --n-jobs 8
Values above 1 require automatic optimization; ordinary generation and legacy
removal reject them. One process creates no workers. The float64 distance matrix
is shared read-only; workers return candidates and the parent writes and validates
outputs. Optional threadpoolctl limits numerical threads within each worker.
--certify-optimum and --certify-time-limit retain their existing meaning.
1.7.6 release notes
pmk dope -ref ELEMENT ELEMENTnow optimizes minimum periodic separation when used with-snand-on;-we vac -ref vac vacoptimizes vacancy sites.-dis removed. Legacy reference removal uses--reference-cutoffs.- Optimized structures are validated after writing and accompanied by a ranked
optimization-summary.txt. Scientific data reuse replaces the radius table, symmetry-expression evaluation and duplicated exact SI constants.
1.7.5 release notes
pmk msdreuses compatible full-trajectory or segment results, including validated 1.7.4 WARNING results. Reused and newly calculated results contribute to the same batch summaries after every directory succeeds.pmk jump-rateanalyzes completed Li octahedral-to-octahedral hops in iodine-aligned GPUMD trajectories. It supports single and multi-temperature runs with SciPy cKDTree and batched NumPy CPU assignment.
1.7.4 release notes
pmk msd -neretains valid Einstein diffusion coefficients and conductivity as WARNING when fit quality would otherwise be REJECT. This applies to automatic and manual windows and preserves the individual diagnostic results.- Missing valid regression, failed requested estimators, and invalid NE inputs
still cause calculation errors. Without
-ne, fit-quality rejection still withholds diffusion coefficients.
1.7.3 release notes
pmk msdanalyzes GPUMD trajectories from fixed-cell NVT production. OLS is the default with a free intercept; WLS/GLS now fit a binary diffusivity plateau. Forced-origin fitting has been removed from production. Changing-cell MSD is outside scope.pmk pred-msd-timeuses validated free-intercept OLS references for higher-temperature Li transport and production-time planning. The duration heuristic carries no guarantee of MSD convergence.pmk gpumd-job -msd-timeturns predictions into GPUMD 4.2-compatible NVT job inputs. Earlier NPT equilibration can precede the analyzed production.
Install
Online installation
When Internet access is available, install from PyPI. This is the recommended method:
pip install pymdkit
This installs the pmk command into the active Python or conda environment,
together with its direct dependencies, including ASE, pymatgen, py4vasp-core,
h5py,
dpdata, matplotlib, UMAP, tqdm, and zstandard. Some packages also install transitive
dependencies.
Optional CUDA 12 GPU support
The default installation is CPU-only. Optional support for the CUDA fingerprint
prefilter used by pmk rmsd -gpu is installed separately:
python -m pip install "pymdkit[gpu-cuda12]"
This extra installs cupy-cuda12x; CuPy is not a required dependency for normal
PMK use. The GPU path currently applies only to the batched fingerprint candidate
prefilter used during one-folder duplicate screening. Structure loading, fingerprint
construction, and exact pymatgen StructureMatcher RMSDs remain CPU operations.
-ncore can still parallelize those exact CPU RMSD tasks. GPU mode is not
guaranteed to outperform CPU mode for every workload.
CuPy must be able to see a working NVIDIA GPU/driver/CUDA environment. On an HPC
system, CUDA may be provided through environment modules, for example
module load cuda/12.6, but the exact module name and scheduler GPU-allocation
commands are site-specific. Follow the cluster documentation rather than assuming
that CUDA 12.6 is required everywhere.
Complete offline installation
For an HPC system or another network-isolated machine, prepare a complete local
package bundle. Transferring only the pymdkit wheel is not sufficient for a
fresh offline environment when its required dependencies are not already
installed.
Once 1.7.10 is available on PyPI, run the following on a machine with Internet access:
python -m pip download pymdkit==1.7.10 -d pymdkit-offline
This downloads pymdkit and the dependencies resolved by pip into the
pymdkit-offline directory. Transfer that entire directory to the offline HPC
system. Then, inside the target pymdkit Python or conda environment, run:
python -m pip install --no-index --find-links=pymdkit-offline pymdkit==1.7.10
For optional GPU use, prepare the bundle on a networked machine compatible with the target HPC platform and Python environment:
python -m pip download "pymdkit[gpu-cuda12]==1.7.10" -d pymdkit-offline
Transfer the whole pymdkit-offline directory, then install from it on the
target system:
python -m pip install --no-index --find-links=pymdkit-offline \
"pymdkit[gpu-cuda12]==1.7.10"
This GPU bundle includes the optional cupy-cuda12x package. Its wheels must also
be compatible with the target platform, Python version, and CUDA environment.
--no-indexprevents pip from accessing PyPI.--find-links=pymdkit-offlinetells pip to install packages from the transferred local directory.
Compiled dependencies can have platform- and Python-version-specific wheels.
Although the pymdkit wheel may be platform-independent (py3-none-any),
packages such as NumPy and SciPy may not be. Prepare the offline bundle for a
Python version and platform compatible with the target HPC environment; wheels
downloaded for Windows will not necessarily work on Linux.
Ideally, prepare the offline bundle on a Linux system with a Python version
compatible with the target HPC environment.
Verify:
pmk -version
pmk -help # lists every command
pmk <command> -help # shows that command's flags
Global configuration and logs
On first use, PMK creates .pmkrc.yaml in the active Python environment root.
For example, an executable at ~/anaconda3/envs/pymdkit/bin/pmk uses
~/anaconda3/envs/pymdkit/.pmkrc.yaml. View or update configuration with:
pmk config
pmk config silence -on
pmk config silence -off
pmk config pmg-mp-api <MP_API_KEY>
pmk config pmg-vasp-potcar -type <TYPE> -path <PATH>
The two pmg-* forms write their pymatgen keys to both the active PMK
.pmkrc.yaml and ~/.config/.pmgrc.yaml, creating the latter and its parent
directory when needed. Existing unrelated keys are preserved and matching keys
are replaced. pmg-mp-api stores PMG_MAPI_KEY; its value is redacted from
terminal configuration listings and command logs.
pmg-vasp-potcar expands and resolves PATH to an absolute
PMG_VASP_PSP_DIR and stores TYPE verbatim as
PMG_DEFAULT_FUNCTIONAL. The resolved directory must contain
<PATH>/POT_GGA_PAW_PBE/. Validation happens before either configuration
file is updated.
With silence enabled, successful commands do not print to the terminal. Errors
that prevent an operation are still shown. Command details are never discarded:
every normal, non-help pmk <command> ... invocation appends its command,
timestamp, exit status, and screen output to <command>.log in the directory
where PMK was invoked. Repeated runs remain in chronological order in the same
file. Values registered by a command as sensitive are shown as <redacted> in
the logged command line. The log stays in the invocation directory even when a
command changes the working directory or -of selects an output folder.
Command help (pmk <command> -h or -help) and argument parsing errors exit
before loading configuration or writing an execution log. Argument parsing
errors are printed to stderr. Scientific result files such as rmsd.txt,
ehull.txt, d2o.txt, and quantity reports remain separate command-owned
artifacts; their contents are never merged into the execution log.
Commands
Commands that transform structures accept a single file (-i/-o), a folder
(-if/-of), or a trajectory where applicable. PMK delegates ordinary format
recognition to ASE, while CIF uses the specialized pymatgen path needed to
preserve occupancy, oxidation, symmetry, and Wyckoff metadata.
| Command | What it does |
|---|---|
config |
View or edit global PMK settings in .pmkrc.yaml |
convert |
Convert ASE/pymatgen structures, folders, and trajectories; set Config_type; refine CIF symmetry; order disorder |
dope |
Dope structures by substituting or removing selected atoms/sites |
ewald |
Compute CIF electrostatic energy |
fit |
Fit Arrhenius models to diffusion, conductivity, and hop frequency summaries |
gpumd-job |
Create supercell, temperature, potential, input, and grouped GPUMD jobs |
pred-msd-time |
Predict Li conductivity, diffusion and NVT production durations from GPUMD MSD |
gpumd-out |
Export GPUMD thermo/MSD results or gather final structures |
jump-rate |
Count completed Li site hops and report nearest-neighbor hop frequencies from GPUMD trajectories |
msd |
Calculate atom-resolved mean squared displacement, self-diffusion, and optional Nernst–Einstein conductivity |
mp-chemsys |
Download stable Materials Project structures for a chemical system |
nep-rmse |
Compute NEP energy/force/stress RMSE and select candidates |
perturb |
Generate perturbed structures with dpdata |
rd |
Reduce descriptors to 2D with PCA or UMAP; optional FPS sampling |
realloc-occ |
Generate charge-balanced CIF occupancy allocations |
rmsd |
Compare structures and optionally remove higher-energy duplicates |
submit |
Submit VASP or GPUMD jobs through Slurm or PBS with queue throttling |
supercell |
Build a structural supercell by matrix, maximum length, or nearest target length |
trjconv |
Extract or stride trajectory frames by frame number or physical time |
vasp-job |
Create or inspect VASP jobs |
vasp-out |
Extract VASP quantities, compute E_hull, build NEP data, or gather final structures |
zip-traj |
Compress or restore trajectory bytes with a verified Zstandard frame |
Examples
pmk convert -i NaCl.vasp -o NaCl.xyz # always extended XYZ
pmk convert -i NaCl.vasp -o NaCl.xyz -config-type Fm-3m
pmk convert -if structures -of structures-pdb -oe pdb
pmk convert -it trajectory.traj -ot trajectory.xyz # ASE trajectory conversion
pmk convert -i NaCl.vasp -o NaCl-symm.cif -symm
pmk convert -if cifs -of ordered -d2o -supercell-matrix 1x1x1 -ncore 64
pmk supercell -i model.vasp -o model-sc.vasp -matrix 1x1x2
pmk supercell -if structures -of capped -max-abc 40
pmk supercell -if structures -of close -close-abc 50
pmk gpumd-job -if Li3YCl6-all -supercell-close-abc 50 -nep nep.txt -in run.in -temp 300 320 340 360 -group Li Y Cl -pgv-only no
pmk gpumd-job -it train.xyz -supercell-matrix 2x2x2 -nep nep.txt -group Li Y Cl -pgv-only no
pmk submit -gpumd
pmk submit -gpumd -subscript custom_gpumd.pbs -queue pbs -max-job-num 30
pmk vasp-job -if Li3YCl6-all -incar INCAR
pmk vasp-job -it train.xyz -incar INCAR -supercell-max-abc 40
pmk submit -vasp -subscript sub_vasp -queue slurm -max-job-num 30
pmk vasp-job -status -queue slurm
nohup pmk submit -vasp -queue slurm -max-job-num 30 > submit-terminal.out 2>&1 &
pmk trjconv -i example.xyz -b 10 -e 20 -o frames-10-20.xyz
pmk trjconv -i example.xyz -dt 10 -o every-10-frames.xyz
pmk trjconv -i example.xyz -b 10 -e 20 -timestep 1 -o time-10-20ps.xyz
pmk trjconv -i example.xyz -dt 10 -timestep 1 -o every-10ps.xyz
pmk rd -pca -i descriptor.out -o pca-descriptor.txt -it train.xyz
pmk rd -pca -i descriptor.out -fps 0.01 -it train.xyz
pmk rd -umap -i descriptor.out -o umap-descriptor.txt -fps 0.01 -it train.xyz
pmk mp-chemsys -s Li La Ta Cl
pmk gpumd-out -msd
pmk gpumd-out -thermo
pmk gpumd-out -save-fs -of gpumd-opted
pmk vasp-out -energy -force -stress
pmk vasp-out -born-effective-charge -dielectric-tensor
pmk vasp-out -all
pmk vasp-out -ehull -local Li-La-Ta-Cl-stable-entries-opted
pmk vasp-out -ehull -ref-form-e -1.1
pmk vasp-out -nep-train
pmk vasp-out -nep-train -position-only
pmk vasp-out -save-fs -fs-name CONTCAR -of vasp-opted
pmk dope -i Li3YCl6.cif -se Li -sn 1 -we Na -on 20 -seed 7
pmk ewald -if cifs -ncore 64
pmk realloc-occ -if cifs -of disorder -formula Li3YCl6 -occ 0.25 0.5 0.75 1 -ncore 64
pmk rmsd -if Li3YCl6-gpumd Li3YCl6-vasp -max-rmsd 0.5 -of Li3YCl6-gpumd-stable -ncore 32
pmk rmsd -if vasp-opted -rm-duplicate -of unique -gpu -ncore 64
RMSD folder comparisons
Use one folder to calculate every unordered compatible structure pair found recursively:
pmk rmsd -if FOLDER
One-folder duplicate removal uses a default maximum RMSD of 0.1:
pmk rmsd -if FOLDER -rm-duplicate -of UNIQUE_FOLDER
Set a custom inclusive threshold with -max-rmsd:
pmk rmsd -if FOLDER \
-rm-duplicate \
-max-rmsd 0.5 \
-of UNIQUE_FOLDER
Optional GPU fingerprint prefilter. The valid GPU mode is one-folder duplicate screening:
pmk rmsd -if FOLDER \
-rm-duplicate \
-of UNIQUE_FOLDER \
-gpu \
-ncore 64
-gpu does not move the exact RMSD calculation to CUDA. Its execution model is:
- CPU: structure loading and fingerprint construction.
- GPU: batched fingerprint candidate prefilter, which rejects clearly dissimilar pairs.
- CPU: exact pymatgen
StructureMatcherRMSDs for remaining candidates, optionally multiprocessing via-ncore.
GPU duplicate screening supports the default maximum RMSD 0.1; explicitly using
-max-rmsd 0.1 -gpu is equivalent and valid. For a non-default custom threshold,
omit -gpu and use the exact CPU path. This restriction avoids scientifically
unsafe filtering because the fingerprint cutoff has not been validated as a
general mapping to arbitrary exact RMSD thresholds.
Use two folders to calculate only cross-folder pairs with the same exact filename, including the extension and case:
pmk rmsd -if FOLDER_A FOLDER_B
Add -max-rmsd and -of together for directional filtering:
pmk rmsd \
-if Li3YCl6-gpumd Li3YCl6-vasp \
-max-rmsd 0.5 \
-of Li3YCl6-gpumd-stable
Here Li3YCl6-gpumd (Folder A) is the source/candidate folder and
Li3YCl6-vasp (Folder B) is the reference folder. PMK compares exact
same-filename pairs and copies only Folder-A structures with RMSD less than or
equal to the threshold into Li3YCl6-gpumd-stable. It never copies reference
structures from Folder B.
Two-folder modes perform no within-folder comparisons. Unmatched files are skipped and reported. If recursive discovery finds a basename more than once under either root, that ambiguous basename and its conflicting relative paths are reported and skipped rather than copied.
File I/O and XYZ
convert uses ASE read, iread/multi-frame indexing, format detection, and
write for ordinary formats supported by the installed ASE version. This
covers single structures, files in a folder, and trajectory conversion whenever
the selected format supports multiple configurations. Run ase info --formats
to inspect the exact formats available in that environment. Specialized CIF
reading/writing remains pymatgen-based to preserve PMK's disorder and symmetry
metadata.
For CIFs with explicit symmetry multiplicities, PMK validates every labeled Wyckoff orbit and the occupied composition after pymatgen expands the asymmetric unit. If finite coordinate noise splits a special position, PMK retries with the smallest bounded site tolerance that restores the declared multiplicities. It never accepts an expansion with different stoichiometry; an irreconcilable CIF stops with an explicit error instead of continuing with the wrong atoms.
Every newly exported .xyz file is written as extended XYZ (extxyz), including
single structures and trajectories. Commands that select existing trajectory
frames preserve already-extended source blocks byte-for-byte; if the source is
plain XYZ, selected frames are upgraded to extxyz. convert -config-type NAME
adds or replaces Config_type in every output XYZ frame and supports -i,
-if, and -it conversion modes.
Trajectory conversion
Without -timestep, trjconv -b/-e uses one-based, inclusive structure
numbers. -dt N retains the first frame and then every Nth frame. With
-timestep, every frame must contain a numeric Time= value and physical time
is Time * timestep in ps; -b, -e, and -dt are then interpreted in ps.
The output format is inferred from -o, and .xyz output is always extxyz.
Dimension reduction
rd requires exactly one of -pca or -umap. Descriptor rows remain aligned
with -it trajectory frames. Config_type-specific descriptor files and FPS
trajectory/descriptor outputs retain the earlier PCA/UMAP behavior; FPS is run
once globally and the selection is then partitioned by Config_type.
GPUMD jobs
gpumd-job accepts exactly one of -i, -if, or -it and optionally one of
-supercell-matrix, -supercell-max-abc, or -supercell-close-abc. -nep
and -in default to nep.txt and run.in in the invocation directory. Each
job receives model.xyz as extxyz, the potential as nep.txt, and the input as
run.in; the potential line is synchronized to nep.txt. With -temp, PMK
creates <structure>/<T>/ and replaces every target_t token with T.
-pgv-only yes is the default: retain species, positions, group (if present)
and velocity. ASE momenta become GPUMD vel in Angstrom/fs. Custom vel,
velocity, velocities arrays are interpreted as Angstrom/fs in that priority
order. Cell, PBC and atom order survive; unrelated properties and header metadata
are omitted. -pgv-only no uses the full-property writer. Deprecated
-pos-only yes still means positions only and emits a warning.
pmk gpumd-job -pre-prod ../1-pre-prod -in run.in
This mode discovers immediate numeric temperature directories (optional K suffix),
validates every source and destination, and copies each single-frame dump.xyz
byte-for-byte to model.xyz alongside nep.txt. Explicitly export a single desired
structure first if a dump has multiple frames. Active target_t tokens become
the directory temperature; comments remain intact and potential paths become
nep.txt. Missing files, duplicate temperatures, existing destinations or no
active placeholder fail before writing. Write failures roll back created jobs.
No additional structure or potential input is required. This mode conflicts with
structure inputs, supercell options, -group, -temp, -msd-time, -status;
PGV filtering does not apply to direct copies.
pmk gpumd-job -if opted-vasp -nep nep.txt -in run.in -temp 300 400 500 600
pmk gpumd-job -if opted-vasp -nep nep.txt -in run.in -temp 300 400 500 600 -pgv-only no
Explicit npt_scr pressure tokens, including zero and scientific notation, are
preserved. Cubic cells retain scalar pressure syntax and its elastic modulus and
coupling parameters. Non-cubic orthorhombic cells expand scalar pressure and modulus
into three matching components. Non-orthogonal cells use six components: scalar
pressure expands to three normal pressures and zero shear pressures, with the
specified modulus repeated. Existing complete directional controls are preserved;
when expanding three components to six, missing shear pressures are zero and
missing shear moduli use the established value 100. Cubic geometry requires angles
within 1e-4 degrees of 90 and a maximum length difference no greater than
1e-6 A + 1e-5 * max(a,b,c). This is a cell-metric check, not a space-group analysis.
Only wholly absent pressure controls use the established defaults (1e-04, modulus
100, coupling 1000); incomplete control lists report an error. Template files,
comments, and unrelated commands remain intact apart from the existing temperature
and potential-filename substitutions. In -if mode, an existing final job
folder (including an empty one) is left untouched while missing siblings are
still generated. With -temp, every structure/temperature folder is checked
independently.
gpumd-job -status recursively treats every folder containing gpumd.out as a
job and prints its path relative to the invocation directory. A minimization is
converged only when its completion phrase is present and its final f_max is at
or below the parsed force tolerance; a completed minimization above tolerance
is not converged, and missing required values or completion is incomplete. A
non-minimization is finished only when it has a valid Time used = ... s line.
The final valid runtime line is reported. Summary counts are total, finished,
converged, not converged, and incomplete; converged and not-converged
minimizations both count as finished.
Job submission
pmk submit (-vasp | -gpumd) [-subscript FILE] [-queue slurm|pbs] [-max-job-num INTEGER] [-sleep SECONDS]
Exactly one of -vasp or -gpumd is required. The queue defaults to Slurm,
the active-job limit to 30, and the wait between full-queue checks to 60
seconds. VASP uses sub_vasp by default; GPUMD uses sub_gpumd. A custom
script is copied into every submitted job folder, and successful scheduler IDs
are saved in .pmk-job-id. User-facing job names are relative to the invocation
directory, and execution details are recorded in submit.log.
submit -gpumd recursively submits only folders containing model.xyz,
run.in, and nep.txt. It skips directories with a valid saved scheduler ID
or existing GPUMD outputs. Existing submission scripts are reused when their
bytes match. A script conflict is reported for its directory and other jobs can
continue. VASP checks saved IDs against the scheduler and retains its
convergence-aware restart rules. A restart archives the previous job ID,
recognized outputs and, for relaxation, the input POSCAR and restart files
before updating the in-place restart inputs. vasp-job -status still reads
the current .pmk-job-id. An interrupted submission with uncertain scheduler
acceptance leaves .pmk-submit-lock for manual reconciliation.
GPUMD outputs
gpumd-out requires exactly one operation:
pmk gpumd-out -thermo [-entry-path DIR] [-thermo-file FILE] [-run-input FILE]
pmk gpumd-out -msd [-entry-path DIR] [-diffuse-ion ELEMENT] [-ion-charge INTEGER]
pmk gpumd-out -save-fs [-entry-path DIR] [-fs-name FILENAME] (-of DIR | -output-folder DIR)
-entry-path defaults to .. Thermo mode defaults to thermo.out and
run.in, writing per-job temperature.txt, potential-energy.txt,
pressure.txt, lattice-parameters.txt, volume.txt, lattice-angles.txt,
and the six-panel thermo.png. Abnormal-fluctuation diagnostics remain in
console warnings and gpumd-out.log; the plot has no abnormal-region shading
or legend. Thermo mode preserves earlier abnormal-time.txt files and skips
jobs whose thermo export paths already exist. MSD mode defaults
to mobile ion Li with charge 1, writes
sigma-sdc-summary.txt at the entry root, and preserves each job's
msd/group_*_msd.txt, group_*_sdc.txt, and group_*_results.txt.
The migration aliases -diffuse_ion and -ion_charge remain accepted.
Save-fs mode defaults to relaxed.xyz and gathers converged structures into
the explicitly requested output folder. Every executed mode uses
gpumd-out.log; scientific artifacts remain separate from that log. The
standalone gather-fs command is removed now that GPUMD and VASP gathering are
available as gpumd-out -save-fs and vasp-out -save-fs.
The standalone supercell command is now structure-only. Its removed
-individual, -temp, -md-if, and -gpumd-group workflows belong to
gpumd-job. In v1.7.0, the standalone gpumd-group and gpumd-trjcat
commands are removed; grouping needed during job creation remains available as
gpumd-job -group.
E_hull reference
vasp-out -ehull -ref-form-e EV_PER_ATOM keeps the normal Materials Project
or -local
formation-energy calculation, but replaces the phase-diagram hull distance with
E_hull = E_form - EV_PER_ATOM. All scanned structures must have the same
reduced formula because one scalar reference applies to one composition. The
exact difference is retained, including a negative value when a structure lies
below the supplied reference.
VASP jobs
pmk vasp-job (-i FILE | -if DIR | -it FILE) [-o DIR] [-incar FILE]
[-supercell-matrix N... | -supercell-max-abc L | -supercell-close-abc L]
pmk vasp-job -status [-queue slurm|pbs]
The three generation modes create one job folder per structure. PMK
uses pymatgen to generate POSCAR, POTCAR, and KPOINTS, then preserves the supplied
INCAR file exactly in each job. All three supercell modes are available during
generation. In -if mode, an existing final folder (including an empty one) is
skipped as a whole, so neither input generation nor the later INCAR copy changes
it; other missing targets in the batch are still generated. During vasp-job
input generation only, PMK hides pymatgen's BadInputSetWarning that says a
POTCAR symbol is not recognized for the selected user_potcar_functional.
Other BadInputSetWarning messages and unrelated warnings remain visible.
Submission has moved to submit -vasp, which retains the previous
convergence-aware Slurm/PBS queue limiter: jobs are discovered recursively,
converged jobs are skipped, unconverged relaxations restart from CONTCAR, and
the process sleeps while the active queue is full. Use nohup ... & when the
submit/check loop must survive logout. The old vasp-job -submit form and its
submission-only options are no longer accepted.
vasp-job -status recursively reports each prepared job and summary counts for
total, finished, converged, failed, and running. Job identifiers preserve nested
paths relative to the invocation directory. Submitted scheduler IDs are stored
in each job folder so running jobs can be identified with squeue or qstat.
For vaspout.h5, status uses h5py to read only the final energy,
final positions, required INCAR scalars, and the final force slice when checking
a relaxation. It does not construct a py4vasp Calculation or load complete
ionic trajectories. VASP output parsing still follows
vaspout.h5 > vasprun.xml > OUTCAR.
VASP outputs
vasp-out has four mutually exclusive operation families:
pmk vasp-out [-entry-path DIR] [-o DIR | -output DIR] (-all | QUANTITY_FLAG...)
pmk vasp-out -ehull [-entry-path DIR] [-mp-api-key KEY] [-local DIR] [-ref-form-e EV_PER_ATOM]
pmk vasp-out -nep-train [-entry-path DIR] [-nep-train-output FILE] [-position-only]
pmk vasp-out -save-fs [-entry-path DIR] [-fs-name FILENAME] (-of DIR | -output-folder DIR) [-max-ehull EV_PER_ATOM] [-ehull-file FILE]
Quantity extraction retains its existing grammar and scans VASP output files in
the current path and every descendant folder. Select any combination of
quantity flags, or use -all to attempt all 39 quantities listed by py4vasp
Calculation, including namespaced quantities such as
-electron-phonon-transport and -phonon-mode. Underscore/dotted spellings
from the API are also accepted; see pmk vasp-out -h for the exact list.
Reader priority is applied independently for every requested quantity:
vaspout.h5, then vasprun.xml with pymatgen, then OUTCAR with pymatgen.
For vaspout.h5, final energy is read directly with h5py as one scalar
hyperslab; other quantities use py4vasp. The fast path follows VASP's existing
dataset and chunk layout and never rewrites or rechunks the file. If a preferred
file exists but does not contain that quantity, PMK continues to the next
reader. Energy always means the final energy(sigma->0) value
(e_0_energy in pymatgen Vasprun data). Older or nonstandard HDF5 layouts
fall back to py4vasp.
Quantity results remain one text report per quantity under vasp-out/, such as
energy.txt, force.txt, and stress.txt. Numeric values use eight decimal
places. Forces include element-number labels; stresses are reported in both
GPa and eV/ų using 1 eV/ų = 160.2176621 GPa. Multiple calculations are
identified by relative folder path. -all skips unavailable datasets per
calculation instead of aborting the scan.
E-hull mode preserves Materials Project/local-reference handling, cache files,
deterministic ordering, and writes ehull.txt. A supplied -mp-api-key is
redacted in vasp-out.log. NEP-training mode preserves converged VASP
structures and extxyz energy/force/stress metadata; its default output is
train.xyz. When available, Born effective charge (BEC) tensors are automatically
included as the per-atom extxyz property bec:R:9, after forces. BEC extraction
independently follows vaspout.h5 > vasprun.xml > OUTCAR, so its source may differ
from the structure/energy source. PMK uses py4vasp's charge_tensors and the
existing quantity-reader fallback; pymatgen versions without Vasprun BEC support
continue to OUTCAR. OUTCAR extraction checks complete blocks and uses the final
complete block if several occur.
Each (n_atoms, 3, 3) tensor collection is validated for atom count, shape and
finite values, then flattened in printed OUTCAR row order (xx xy xz yx yy yz zx zy zz), without transposition, atom reordering or unit conversion (units of
elementary charge, |e|). Available py4vasp structure metadata is checked against
the final structure. Output files in one calculation directory must describe the
same atomic ordering. Missing or invalid BEC leaves the configuration intact,
with a diagnostic and no placeholder values. Mixed datasets retain independent
per-frame property declarations, and the summary counts frames with/without BEC.
-position-only skips BEC extraction and omits BEC together with other calculation
results. No additional CLI option is needed.
Final-structure
mode defaults to CONTCAR, requires an output folder, and optionally applies
the strict -max-ehull filter using ehull.txt by default. All modes use
vasp-out.log, separate from scientific artifacts. The standalone ehull and
vasp2xyz commands are removed.
Doping structures
pmk dope -i FILE -se SELECTOR... [-sn NUMBER...] -we ELEMENT|vac... [-wn NUMBER...] [-on NUMBER] [-ref SELECTOR...] [--reference-cutoffs DISTANCE...] [-o DIR | -output-folder DIR] [-output-format FORMAT] [-seed INTEGER]
dope replaces substitute and preserves its validation,
scientific substitution/removal behavior, and deterministic -seed behavior.
Random mode defaults to <input-stem>_dope/; reference-distance mode defaults
to <input-stem>_dope.cif. Execution details are written to dope.log. The
standalone substitute command is removed.
Automatic separation in 1.7.6
pmk dope -i LiI-333.vasp -se Li -sn 18 -we Cu -on 100 -o Li90Cu18I108 -ref Cu Cu -seed 42
pmk dope -i LiI-333.vasp -se Li -sn 18 -we vac -on 100 -o Li90I108 -ref vac vac -seed 42
With -sn and -on, an identical reference pair enables automatic max–min
optimization. One selector and one replacement species are supported, including
-we Na -ref Na Na; mixed references are rejected. Without -ref, ordinary
random substitution/removal is unchanged. vac is canonical; none is deprecated.
The primary score is the minimum periodic pair distance, including fixed preexisting
replacement atoms. Vacancy geometry uses original removed-site coordinates.
Small spaces (at most 2,000 combinations) are enumerated exactly. Larger spaces use
seeded randomized farthest insertion and one-site exchanges. Default restart budget:
max(4 * outputs, 8 * ceil(eligible / selected)); at most 2 * selected sweeps per
restart, stopping earlier when no improvement is found. Internal optimize_sites
keyword budgets support controlled validation. Initial and optimized candidates are
pooled, deduplicated by original indices, then ranked by minimum distance, mean
nearest-neighbor distance and mean pair distance. Scores rounded to 10 decimal places
resolve numerical ties; overlap diversity and index order break ties. No secondary
score can override a primary difference larger than that numerical tolerance.
-on 100 returns the best 100 distinct configurations found, not necessarily global
optima or symmetry-inequivalent structures. Insufficient combinations or exhausted
budgets report actual counts and termination. Distance-matrix memory is quadratic in
eligible plus fixed sites. Identical input, seed, arguments and dependency versions
reproduce selections. Both doping and vacancy operations share this engine.
Default filenames remain <input-stem>_r1.cif, etc., in <input-stem>_dope/ or -o.
Optimized CIFs use P1 to preserve the original cell and fractional coordinates;
VASP output keeps existing species grouping. Every optimized structure is reloaded
and checked for composition, lattice metric, retained positions and separation.
optimization-summary.txt is tab-separated with JSON metadata in a comment. It
contains filename, minimum and mean NN distances (Angstrom), packing diagnostic,
ratio, zero-based original indices and fractional coordinates. Metadata includes seed,
counts, fixed sites, budgets, method, termination and best/worst/median separation.
Optional exact certification runs after the same heuristic search:
pmk dope -i LiI-333.vasp -se Li -sn 18 -we Cu -on 100 -o Li90Cu18I108 -ref Cu Cu --certify-optimum
pmk dope -i LiI-333.vasp -se Li -sn 18 -we vac -on 100 -o Li90I108 -ref vac vac --certify-optimum --certify-time-limit 120
--certify-time-limit must be finite and positive and requires --certify-optimum.
Its default is 120 seconds for the entire certification stage; it does not change
the heuristic budget. Certification requires the automatic -sn/-on/-ref mode.
Small enumerated spaces reuse their proof without invoking a solver. Otherwise
SciPy's optimize.milp (SciPy >= 1.9, bundled HiGHS) tests sparse conflict graphs:
binary x_i selects a site, maximize sum(x_i), and x_i+x_j<=1 when d_ij<t. Candidate sites
too close to fixed dopants are disabled; conflicting fixed pairs make t infeasible.
Binary search over discrete periodic distance levels finds the largest feasible
threshold. A validated configuration plus proof that the next level is infeasible
(or exhaustion of all levels) certifies the global max-min distance.
All distinct float64 distance levels are retained without rounding or grouping.
Conflicts use strict d<t; returned configurations must satisfy d>=t with no distance
relaxation. Binary variables are checked within 1e-6 of 0 or 1. This conservative
policy may require extra solves for nearly identical distances. Proofs refer to
the computed geometry subject to HiGHS numerical tolerances, not exact arithmetic.
The validated heuristic score excludes already feasible levels. The packing upper
bound prunes larger levels only when the shortest self-image distance exceeds the
bound (with conservative numerical slack); thin cells retain the unpruned search.
Isolated vertices are forced into a maximum independent set. Closed-neighborhood
domination removes a vertex only when it can be replaced without reducing the
maximum cardinality. Deterministic clique inequalities strengthen sparse models;
a verified partition into fewer than K cliques, accounting for reductions, proves
infeasibility. LP dual multipliers are corrected for constraint residuals before
using their upper bound. Otherwise SciPy MILP maximizes independent-set cardinality.
Validated incumbents of at least K yield exactly K witness sites; a conservative
dual bound below K proves infeasibility even at a time limit. An insufficient bound
at timeout is never a proof. Preprocessing, LP and MILP share one monotonic budget.
Connected component counts are reported; no crystallographic symmetry is assumed.
Large graphs can still exhaust the budget. No optional solver is auto-installed,
and --n-jobs controls heuristic restarts, not MILP threads or MIP starts.
optimality-certificate.json records input, species, site indices, seed, solver
and SciPy version, distance policy, per-threshold outcomes, runtime, bounds and
saved-structure classifications. CERTIFIED_OPTIMAL means the proof completed;
IMPROVED_NOT_CERTIFIED means a validated improvement was retained without proof;
NOT_CERTIFIED means no proof or improvement was obtained. Timeouts and solver
failures retain valid candidates and never imply infeasibility. Invalid returned
incumbents are errors. Missing MILP support is reported without losing heuristic
outputs. Valid solver discoveries enter the existing pool before ranking.
The certificate distinguishes the optimum from the number of generated structures
attaining it; -on 100 does not imply 100 optimal or symmetry-inequivalent structures.
Default runs do not import or execute certification code or create this report.
Geometric separation optimality does not establish energetic or thermodynamic stability.
The equal-sphere packing diagnostic is
D_upper = (6 * (pi / sqrt(18)) * V / (N * pi)) ** (1/3), with total objective-site
count N including fixed dopants. It is a geometric restriction, not an attainable-site
promise or proof of heuristic optimality. Physical radii are irrelevant. If the
shortest self-image lattice translation is smaller than this value, the formula need
not bound the distinct-site objective: metadata marks it inapplicable and the ratio
is nan. No arbitrary physical cutoff is imposed.
-d/-distance is removed and reports migration guidance. Legacy reference removal
is selected only when both -sn and -on are absent:
pmk dope -i input.cif -se Li -we vac -ref La Ta --reference-cutoffs 1.01 1.02
Cutoffs remain Angstrom, one per reference. Omitting them preserves
0.7 * (Cordero covalent radius sum), sourced from ASE for H through Cm; missing
radii require an explicit cutoff. Output remains <input-stem>_dope.cif in the
invocation directory. --reference-cutoffs is rejected in automatic mode.
Execution logging remains in dope.log.
Breaking changes in v1.7.0
gpumd-thermoandgpumd-msdare replaced bygpumd-out -thermoandgpumd-out -msd.gather-fsis replaced bygpumd-out -save-fsorvasp-out -save-fs.ehullandvasp2xyzare replaced byvasp-out -ehullandvasp-out -nep-train.substituteis replaced bydope.vasp-job -submitis replaced bysubmit -vasp; GPUMD submission usessubmit -gpumd.- Standalone
gpumd-grouptagging andgpumd-trjcatare removed without replacement.gpumd-job -groupremains available during job creation.
Generated VASP structures
New .vasp files written by convert, standalone supercell, and
dope -output-format vasp automatically group atoms by species using
pymatgen's POSCAR ordering. For example, a 64-atom LiI supercell has a single
Li I species line and a 32 32 count line. Site order changes to group
species; the lattice, species-resolved positions, and selective-dynamics
flags remain associated with their sites.
Direct (fractional) coordinates are the default. Both convert and
supercell accept mutually exclusive -direct and -cartesian flags for
.vasp output. These flags also apply in folder mode and when convert
creates a supercell. They have no effect on CIF, XYZ, extxyz, or other output
formats. VASP job input sets and collected CONTCAR files retain their existing
behavior.
pmk convert -i LiI.cif -o LiI.vasp -direct
pmk convert -i LiI.cif -o LiI-cart.vasp -cartesian
pmk convert -if structures -of vasp-direct -oe vasp
pmk convert -i LiI.cif -o LiI-222.vasp -supercell-matrix 2x2x2 -cartesian
pmk supercell -i LiI.vasp -o LiI-222.vasp -matrix 2x2x2 -direct
pmk supercell -i LiI.vasp -o LiI-222-cart.vasp -matrix 2x2x2 -cartesian
pmk supercell -if vasp-direct -of vasp-cart -matrix 2x2x2 -cartesian
Other behavior
convert -d2o first symmetrizes the disordered structure so each distinct
Wyckoff orbit keeps its own occupancy constraint. It then uses pymatgen's
branch-and-bound Ewald ordering to find the lowest-energy ordered structure for
the fixed supercell matrix. This avoids the previous greedy solution and
prevents atoms from being redistributed between unrelated but chemically
identical orbits.
There is deliberately no convert -d2o -gpu flag: symmetry grouping and the
irregular branch-and-bound search are CPU/control-flow work, so transferring
small candidate sets to CUDA would add overhead without accelerating the search.
Multicore CPU
Independent CPU-heavy inputs are processed concurrently by convert -d2o,
ewald -if, realloc-occ -if, and exact folder-pair comparisons in rmsd.
Use -ncore N to choose the number of worker processes, or -ncore 1 to
disable multiprocessing. Without -ncore, PMK uses the single-node CPU
allocation reported by Slurm, PBS, or SGE and never creates more workers than
there are independent tasks. Outside a scheduler, automatic mode is capped at
four workers to avoid unexpectedly occupying an entire workstation. Numerical
libraries are limited to one native thread in each worker to prevent nested
thread oversubscription.
convert -d2o is more memory-intensive than the other parallel commands
because every worker runs a pymatgen branch-and-bound/Ewald search. Its
automatic scheduler mode is therefore capped at eight workers. Use
-ncore N to override that cap when the node has enough memory. The command
prints its selected worker count before starting and reports progress whenever
a CIF finishes; final files and reports remain deterministically ordered.
rmsd -if folder comparisons show one tqdm bar for the exact pairs scheduled, and
convert -d2o shows one bar for all scheduled CIFs. These bars appear only on
an interactive terminal: silence mode and redirected/non-TTY execution suppress
them, and progress rendering is not stored in command execution logs.
If one CIF remains active for more than 60 seconds, PMK terminates only that
CIF's worker, skips its conversion, copies the original input into
large-d2o-combination in the invocation directory, and starts the next queued
CIF. This applies to both convert -d2o -i and convert -d2o -if; d2o.txt
records the timeout, elapsed time, and copied path. The folder is created only
when at least one calculation times out.
For one PMK disorder-to-order process using eight CPU cores on one Slurm node:
#!/bin/bash
#SBATCH -J Nwyd-pmk
#SBATCH -p normal
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
source ~/softwares-env/anaconda.sh
conda activate pymdkit
pmk convert -if Li4YCl6-disorder/ -of Li4YCl6-disorder-order -d2o -ncore 8
Prefer one Slurm task with --cpus-per-task for this local multiprocessing
model. The older single-node form -N 1 with -n N is detected through
SLURM_NTASKS, but it describes multiple Slurm tasks rather than one
multicore PMK process. Keep the job on one node. The project audit intentionally
leaves
HDF5/VASP scans, GPUMD plotting, trajectory copying, scheduler submission,
network/API commands, and NumPy/UMAP reductions outside this process pool:
those paths are I/O-bound, own their native parallelism, or write shared state.
realloc-occ.txt and every generic <command>.log execution log stay in the
invocation directory. Silence mode suppresses successful command output, but
pmk <command> -h always displays help and operation-blocking errors are
always visible.
Each command's full flag list is available with pmk <command> -h.
Automatic scan modes include matching files directly in the current path as
well as files in folders, subfolders, and deeper descendants. This rule applies
to shared structure-folder processing, VASP calculations, GPUMD outputs, and
trajectory gathering; explicit -i and -if modes remain available.
Layout
pymdkit/
|-- pyproject.toml # package metadata and `pmk` entry point
|-- README.md
`-- src/pymdkit/
|-- pymdkit_main.py # command discovery and dispatch
|-- _config.py # environment-wide .pmkrc.yaml settings
|-- _logging.py # execution-log argument redaction helpers
`-- commands/
|-- convert.py # ASE/pymatgen conversion and CIF workflows
|-- trjconv.py # trajectory extraction and stride
|-- rd.py # PCA/UMAP dimensional reduction
|-- gpumd_job.py # GPUMD job generation
|-- vasp_job.py # VASP generation and status
|-- chemsys_entry.py # `mp-chemsys` implementation
|-- ... # remaining public commands
`-- _*.py # private shared helpers
Modules whose name starts with _ are shared helpers and are skipped by the
dispatcher, so they never appear as commands.
Adding a new tool later
Drop a module in src/pymdkit/commands/ that defines four things:
COMMAND = "my-tool" # the subcommand name you'll type
HELP = "One-line description."
def add_arguments(parser): # register flags
parser.add_argument("-input", required=True)
def run(args): # do the work; return an exit code (0 = ok)
...
return 0
if __name__ == "__main__": # keeps the script runnable on its own
import argparse
_p = argparse.ArgumentParser(description=__doc__)
add_arguments(_p)
raise SystemExit(run(_p.parse_args()))
It will appear in pmk -help automatically - no central registration needed.
Put heavy imports (pymatgen, ase, ...) inside run() where practical; the dispatcher
reads each command's name and help without importing it, so pmk -help stays
fast and a missing optional dependency only affects the one command that needs it.
Running a script standalone
Every command module still works directly, which is handy for debugging:
python src/pymdkit/commands/supercell.py -i in.cif -close-abc 20 -o sc.vasp
Trajectory compression and decompression
pmk zip-traj archives GPUMD extended XYZ and other files as a standard
Zstandard frame. It preserves every byte, including decimal precision,
Lattice, Properties, unwrapped_position, groups, IDs, timestamps,
custom fields, and line endings. It uses the Python zstandard package.
pmk zip-traj -it dump.xyz
pmk zip-traj -it ./dump.xyz
pmk zip-traj -it "350/dump.xyz" -level 3 -threads 4
pmk zip-traj -it "350/dump.xyz.zst" -d
pmk zip-traj -it "350/dump.xyz.zst" -d -o restored.xyz
| Option | Meaning |
|---|---|
-it, -input-trajectory |
Bare filename for a recursive search, or an explicit path for one file. Defaults to dump.xyz. |
-d, -decompress |
Restore a checksummed Zstandard frame. The default output removes the .zst suffix. |
-o, -output |
Output path with an explicit input path. |
-level |
Compression level from 1 through 22, default 3. |
-threads |
Number of compression workers. The default 0 compresses synchronously. |
A bare filename such as dump.xyz searches the current directory and its
subdirectories, even when the current directory contains a match. The search
matches the exact, case-sensitive filename and processes matches in path
order. It skips directory links and Windows junctions, linked file aliases
and duplicate file identities, and directories such as .git, virtual
environments, caches, build and dist. An explicit path such as ./dump.xyz,
.\dump.xyz or an absolute path selects one file.
Compression creates <input>.zst beside each input by default. An existing
output is preserved and reported as SKIPPED_EXISTING with the message
not verified by this run. The summary counts Verified, Skipped existing
and Failed separately. File failures, including publication races, produce
a nonzero exit status while independent inputs continue. A run with only
verified and skipped-existing files exits with status 0 if the scan completed
without errors. Ctrl+C stops the batch and removes the current staged output.
The command records details in zip-traj.log or uses a numbered log when
that path is shared by an input or output.
Compression streams raw bytes and computes the byte count and SHA-256. Before
publishing the output, it streams the staged archive through decompression,
checks the frame checksum, and compares both the count and SHA-256. Successful
compression reports VERIFIED. Decompression checks the frame checksum and
reports the restored SHA-256 for comparison with the compression log. It
accepts one complete standard frame with a content checksum and rejects
truncation, corruption and trailing data. Both operations stage output beside
its destination, publish atomically when checks pass, and preserve the input.
Linux filesystems must support hard links in the output directory. Use a
completed trajectory and allow disk space for the staged output.
On Windows, the 300 K, 40 ns Li₄YI₇ trajectory compressed from 18.71 GB to 8.50 GB at level 3 (54.59% saved). Compression and output synchronization took 111.08 s. Streamed decompression and verification took 34.12 s. Peak process working set was 43.02 MiB. An independent stream confirmed the same byte count and SHA-256. These measurements apply to this file and machine. See the benchmark and reproducibility details.
Atomic trajectory MSD
pmk msd -group 0
pmk msd -group 0 -ne
pmk msd -group 0 -ne -charge 2
pmk msd -group 0 -fit-method gls
pmk msd -group 0 -fit-range 10 100
pmk msd -group 0 -ne -trajectory-range 0 10
pmk msd -group 0 -ne -trajectory-range 10 20
-md-program gpumd is the default. The current directory and calculation
subdirectories are searched deterministically, excluding generated msd, hidden,
environment and build directories. Each calculation needs model.xyz, run.in
and the native full-system trajectory named by dump_xyz, or dump.xyz from
legacy dump_exyz interval velocity_flag force_flag. Group selection uses the
first grouping method in model.xyz. -group is optional; omission selects all atoms.
Missing group labels are an error only when a group is requested.
Both dump_xyz interval filename properties... and GPUMD 4.2's
dump_xyz grouping_method group_id interval filename properties... are supported.
For example, dump_xyz -1 0 200 dump.xyz group unwrapped_position saves the whole
system every 200 steps. Legacy grouping methods must be negative (full system);
the group ID must be an integer and is ignored in this mode. Subset trajectories
are rejected because whole-system COM correction requires every atom. Legacy
group and modern group_labels properties are supported. Earlier NPT
equilibration without trajectory output is allowed before fixed-cell NVT production.
Directories with active unresolved target_t, ${...} or {{...}} placeholders
in run.in are skipped with a reason; commented placeholders are ignored.
This is the mean of individual atomic squared displacements, not group-COM MSD. Every frame is streamed through a native GPUMD numeric parser (other extxyz schemas retain the ASE fallback), then selected coordinates are stored in a temporary float64 memmap. All system atoms contribute to mass-weighted COM displacement removal using ASE tabulated atomic masses. For every frame, the correction is the sum of each atom's mass times its unwrapped displacement from the first analyzed frame, divided by the total system mass. The correction is applied once, before selecting the group or element. A trajectory segment uses its own first frame, and multi-element analysis shares the corrected coordinates. Species order, atom count, PBC flags, and group/ID columns (when present) are checked against the model. Native GPUMD full-system row ordering is required: externally sorted same-element atoms without stable IDs cannot be identified and must not be supplied.
For fixed triclinic cells, consistent unwrapped_position is preferred; otherwise
ASE's general lattice minimum-image algorithm accumulates successive displacements.
For example, dump_xyz 1000 dump.xyz followed by pmk msd -group 0 -ne
needs no additional coordinate option. Properties are identified by declaration,
including files with extra group or other fields. All atoms are reconstructed
before whole-system COM correction and group selection. Reconstruction state
persists across the 256-frame storage chunks; partial PBC is respected. Cells
must remain constant within rtol=1e-10 and atol=1e-8 Angstrom.
The maximum reconstructed step is recorded; a step exceeding 40% of the smallest
periodic face spacing emits a heuristic sampling warning. It cannot detect all
missed crossings, including motion by an entire cell between samples.
Provenance records unwrapped_position or reconstructed_from_wrapped_pos, the
ase-mic-v1 reconstruction version, cell, and PBC. Fingerprint checks remain.
Legacy explicit-unwrapped results remain reusable; legacy wrapped results lacking
coordinate provenance must be moved aside and recomputed with schema validation.
Wrapped output must be frequent enough to resolve each displacement uniquely;
multiple unseen boundary crossings cannot be recovered from saved frames.
MSD analysis supports fixed-cell NVT production. NPT and changing-cell
production are rejected, including pure affine deformation.
The default --fit-window auto searches atom-based total MSD lag windows using
log-log OLS beta, then calculates D independently with free-intercept Einstein
OLS (directional slopes/2; total is their arithmetic mean). Following
MDTransport (2026), the search grid
is 100 ps. The default minimum duration is min(T/2, 8000 ps), a continuous
pymdkit engineering adaptation of the published piecewise rule that avoids
infeasible windows immediately above 10 ns. Following
He et al. (2018), every automatic
upper lag is strictly below 0.7T. T is saved frame count times frame interval,
not the absolute simulation timestamp. Grid boundaries map to nearest MSD
samples; first positive lag and last allowed lag are included as endpoints.
The minimum duration is never silently relaxed.
Controls are --min-fit-window PS, --fit-window-step PS, and
--beta-tolerance VALUE (default 0.075, maximum 0.20). Among beta-qualified
windows, choose D closest to the pool median, then smaller beta deviation, then
longer duration. Without qualified windows choose minimum beta deviation.
Separate beta_status, intercept_status, einstein_slope_status and
overall_status distinguish raw beta from affine Einstein model consistency
and slope stability. Beta thresholds remain 0.075 and 0.20. PASS additionally
requires available, positive early/middle/late Einstein slopes with relative
spread (max-min)/median <= 0.20. Insufficient segment data or a larger spread
produces WARNING for beta within 0.20. Above 0.20 the result is REJECT unless
the positive-intercept model agrees with observed beta within 0.05 and
segment stability passes; this exception permits WARNING only, never PASS.
The default reported D uses free-intercept OLS, MSD(t) = A + 6 D t.
For each valid candidate, diagnostics retain free-intercept D,
intercept fractions at both endpoints, and beta predicted
by log-log OLS of b+s*t on the actual fitting samples. No intercept is
subtracted from the measured MSD. A detected intercept effect explains model
consistency, not the physical cause of the intercept. Full-window D remains the
published estimate; segment D values never replace it. Segment diagnostics are
computed only for the selected candidate, with explicit unavailable reasons.
Relative D sensitivity (P90-P10)/median > 0.5 also produces WARNING. These
are diagnostics, not evidence of statistical convergence. Internal thresholds
are named constants in _msd_auto.py; no smoothing or independent-window
sample-count assumption is used. --mobile-site-distance A optionally checks
the approximate MSD >= 0.5a^2 criterion using a known neighboring mobile-site
distance; this is not a universal cutoff or an inferred instantaneous ion distance.
Without it the structural ballistic cutoff is not independently determined.
-fit-range START_PS END_PS retains manual lag-window fitting, including its
previous upper-lag freedom; it conflicts with explicit --fit-window auto.
--fit-window manual requires a range. For example:
pmk msd -group 0 -ne --fit-window auto
pmk msd -group 0 -ne -fit-range 500 1200
Optional -fit-method wls and -fit-method gls use consecutive non-overlapping
blocks at dyadic lags tau_i=2**i*dt. Errors use ddof=1 across particle-averaged
block diffusivities MSD/(2dtau). Both fit
D_inf*(1-b*(tau/tau_ref)**(-c)). Automatic selection uses the existing Moustafa
criterion with at least four tail points, independently of the OLS window.
Manual -fit-range maps to valid binary levels and needs at least four points.
No overlapping blocks are invented. --binary-discard-longest 3 is a configurable
application default; neighboring settings are recorded as sensitivity, not a CI.
Constant/no-tail data or an unidentifiable power law can legitimately fail.
WLS ignores off-diagonal covariance; GLS uses R_ij=2**(-abs(i-j)/2) with original
binary indices. Cholesky whitening and condition checks use standardized
correlation, without jitter, regularization or estimator fallback. Diagnostics
include levels, blocks, errors, interval, residuals, reduced chi-square and
tail/plateau counts. Weighted total D fits the pooled 3D curve; separately fitted
axes on the same domain may be unavailable (NaN) and need not average to total D.
The 2024 binary covariance assumes Wiener-like
dynamics and the stated sampling scheme, and is not validated here for interacting
ionic solids. It is separate from Bullerjahn's 2020 all-origin/static-noise
model. No unconditional chi-square or KS hard
threshold is introduced. MDTransport
provides additional species/beta context, without copying empirical thresholds.
OLS retains its free intercept, positive-intercept model-consistency diagnostic,
three-segment slopes and window sensitivity. Raw beta alone is not physical proof
of anomalous diffusion. --uncertainty covariance remains OLS-only; binary errors
are conditional local-Jacobian approximations, not validation of the regime.
pmk msd -element Li -ne Li
pmk msd -element all -ne Li
pmk msd -group 0 -element all -ne Li
pmk msd -element Li -ne Li -fit-method gls --binary-discard-longest 3
-element all (default) analyzes each chemical element independently; symbols
are case-normalized. Invalid/absent elements and -element Li -ne Na fail.
Whole-system ASE-mass COM correction happens once before species selection.
Single-element results keep the flat msd/ layout. Multiple elements use
msd/elements/<Element>/, each with raw MSD, diagnostics and its own fit interval.
Rejected non-NE species retain raw data with unavailable D without blocking valid
NE output. Only the requested species contributes its D and count to conductivity.
Root sigma.txt and sigma-total.txt describe that species. Element summaries
are self-diff-by-element.txt, self-diff-by-element-total.txt, and
msd-quality-by-element-total.txt. Single-species numeric columns are unchanged.
Aggregate tables and the MSD recovery index are published together.
Completed compatible runs can be reused, including rejected non-NE diagnostics.
Changed inputs/settings require moving existing results aside before recalculation.
Every saved msd.txt is read back for a 300 dpi msd.tif using Matplotlib Agg. Positive
time/MSD values appear on log-log axes with x/y/z/total curves and the actual
method's fitting interval, element, method, D, beta and quality. Rejected candidates
are labeled. Plot failures emit a separate warning and retain raw MSD. Figures
are closed after saving.
-trajectory-range START END selects a separate saved-trajectory subset in ns,
using the half-open interval [START, END) relative to the first original
Time= header, not the simulation start. GPUMD header times are in fs.
Every scanned timestamp must be finite, increasing, uniformly spaced and
consistent with run.in; missing timestamps/frames or unreliable thermo
alignment fail clearly. Boundary comparisons use the existing schedule-scale
tolerance max(1e-5 fs, abs(Time)*1e-9) for floating accumulation. Available
coverage ends one sampling interval after the last frame (thus 100000 frames
at 0.2 ps cover 20 ns). Actual selected timestamps/count are recorded.
Headers and rows before START are streamed without coordinate parsing; reading
stops at the END header when present. The suffix beyond END is not validated.
Only selected coordinates enter the existing whole-system mass-weighted COM
correction, selected individual-atom memmap and independent all-origin FFT.
Lag time restarts at zero; -fit-range remains an independent lag interval in ps.
Range outputs go to msd/segments/START-ENDns/, with shortest decimal float
values expanded without exponent or redundant trailing zeros (0-10ns,
10-20ns, 0.5-2.5ns). Existing segment directories are refused. Full-run
outputs, other segments and root summaries are preserved; successful segment
aggregate summaries live in the segment directory. Each segment also records
diagnostics.json, fit-windows.txt and fit-diagnostic.txt, including REJECT.
No credible fit means no new formal D or conductivity. A 10 ns segment cannot
fit the full trajectory's 5.9–14 ns window: unchanged automatic thresholds
search only its available lags. NE uses measured thermo samples in the same
half-open global interval, after header/schedule alignment and cell checks;
segment mode never substitutes a full-run temperature or nominal fallback.
No validated uncertainty estimate or formal confidence interval is implied.
Omitting -trajectory-range retains the full-trajectory path.
Each successful calculation creates msd/msd.txt (five numeric columns: lag
time in ps, x/y/z MSD and their sum in Ų), msd/self-diff.txt (x/y/z/total
diffusion in cm²/s, %.2e) and, only with -ne, msd/sigma.txt (x/y/z/total
Nernst–Einstein conductivity in mS/cm, %.2f). Headers are comments. Total
diffusion and conductivity are directional arithmetic means before rounding;
display rounding may cause last-digit differences. PASS and WARNING write these
coefficients with the quality status in their comment headers. provenance.json
records the final quality and full-precision total coefficients.
With -ne, an automatic or manual window with finite, positive x/y/z/total
Einstein diffusion coefficients retains D and NE conductivity even when the fit
quality would otherwise be REJECT. The overall status becomes WARNING. The
original reason and the beta, intercept-consistency, and three-segment slope
diagnostics remain in the fit output. A WARNING can indicate that the physical
diffusion regime failed quality criteria. Without -ne, REJECT returns nonzero
and retains only raw MSD and fit diagnostics. PASS and WARNING retain D.
fit-windows.txt records evaluated candidates, rejection reasons, beta,
directional D, R², intercept, RSS, points, upper-lag origin count, intercept
diagnostics, and selected-window segment D values. fit-diagnostic.txt records
settings, selection, and sensitivity. Beta-qualified window sensitivity,
all-valid-candidate sensitivity, and three-segment slope spread are reported
separately. Segments and MSD time origins are correlated. Window-to-window spread
measures sensitivity. Formal statistical uncertainty requires an explicit
request. Temporary coordinate storage is removed when the calculation ends.
When the result directory is absent, pmk msd calculates it. When a compatible
result already exists, the command reuses its full-precision coefficients and
quality without reading trajectory coordinates. It checks version-1 provenance,
input and output sizes and modification times, grouping method 0, atom counts,
run cadence, fit settings, selected window, and diagnostic and coefficient
totals. New single and multi-element results record whole-system mass-weighted COM
with algorithm version 1. Explicitly different methods or versions invalidate
reuse. Earlier results using the same COM retain the existing legacy checks.
A missing msd.tif is regenerated from validated msd.txt and its
plot fingerprint is recorded in provenance. With -ne it also checks the
charge and thermodynamic inputs and recomputes the stored conductivity from
full-precision D, temperature, volume, and ion count. Primary 1.7.4 results
can be reused when diagnostics establish compatibility, including the effective
lag bounds for a manual window. Missing provenance, stale files, incomplete
outputs, incompatible settings, and REJECT results cause an error and leave the
result directory intact. Move that directory aside before recalculating.
With --uncertainty covariance, reuse also requires the original uncertainty
settings, output fingerprints, and matching input hashes and paths. Older
results without those settings or fingerprints require recalculation for an
uncertainty request. The existing full-run NE covariance fallback can reuse
nominal temperature when thermo.out was unavailable. Ordinary NE and range
NE still require thermo.out.
The five-column raw MSD is published immediately after FFT succeeds, before
window search, optional uncertainty, or thermodynamic/NE processing. Later errors
retain this curve and any completed fit diagnostics. A missing valid regression,
a failed requested WLS/GLS estimator, or invalid required thermodynamic inputs
returns nonzero and prevents publication of new coefficients and aggregates.
Parsing and FFT failures occur before the raw curve is published.
FFT uses float64 atom chunks sized from an internal 128 MiB workspace budget,
with bounded remapping of time slabs to avoid retaining the entire coordinate
memmap in RAM. For 100000 frames and 784 selected atoms the temporary coordinate
file needs 1,881,600,000 bytes, plus filesystem overhead and output files.
Installation diagnostics are available with python devtools/diagnose_msd_install.py;
run it using the interpreter in the pmk shebang, since source and installed
distribution versions can differ. Both pmk -version and pmk --version work.
Optional covariance uncertainty (experimental Phase 4B.1.1):
pmk msd -group 0 --uncertainty covariance
pmk msd -group 0 -ne --uncertainty covariance --uncertainty-lag-points 100 --uncertainty-confidence 0.95
Adds self-diff-uncertainty.txt, uncertainty-diagnostic.txt and, with -ne,
sigma-uncertainty.txt, using labeled JSON records. Existing point estimates and
formats remain unchanged. Available results include 68% and 95% Bayesian credible
intervals plus the requested confidence-level interval. SciPy is lazily imported.
All overlapping origins contribute to moments: M=N_mobile*(N_frames-lag_index).
The continuous effective scaling parameter is N'=N_mobile*N_frames/lag_index,
not a literal count of disjoint intervals. The default selects 100 original lag
indices including window endpoints. The smoothing law a*t^2/N_effective uses
closed-form unweighted nonnegative least squares, verified against the objective
in kinisi 1.1.0 (without copying its implementation).
Continuous counts remove the artificial integer discontinuities. Diagnostics
compare raw and smoothed covariance, and Tabeart minimum-eigenvalue reconditioning
at condition limits 1e8/1e12/1e16, including eigenvalue adjustments, relative matrix
change and conditional posteriors. The threshold is lambda_max/condition_limit;
no diagonal jitter is added. Failed numerical verification remains unavailable.
Real 500 K covariance is now positive definite, but reported intervals remain
UNAVAILABLE: interacting-ion coverage has not been established. WARNING windows
retain conditional candidates in diagnostics only; rejected windows have none.
CLI success does not imply an available interval: inspect the uncertainty status.
Intervals are conditional on the chosen window and estimated covariance.
Interacting ions and whole-system COM correction limit the independent-particle
approximation. Covariance-parameter, window-selection, distinct-ion correlation
and Haven-ratio uncertainties are excluded. With uncertainty requested, missing
thermo.out uses a labeled nominal stationary NVT target; the existing ordinary
NE path still requires measured temperature. NPT remains release-blocked.
See Phase 4B.1 report.
The Phase 4B.1.1 correction report
supersedes its effective-count and real-covariance conclusions. Correlated-particle
nominal 95% coverage is 67% in the corrected seeded benchmark; a narrow interval
does not demonstrate statistical convergence.
External validation is opt-in via PYMDKIT_MSD_TEST_DATA or:
python devtools/validate_msd_uncertainty.py --data-dir PATH --output NEW_OUTPUT_DIRECTORY
Output must be a new directory outside the input dataset. The script hashes original inputs/results before and after, regenerates missing diagnostics, reads the original trajectory and removes temporary coordinates. Normal tests do not require this external dataset.
After every directory is calculated or validated for reuse, single-element
self-diff-total.txt and, with -ne, sigma-total.txt summarize directory, temperature (K), and the
isotropic total D (cm²/s, %.2e) or conductivity (mS/cm, %.2f). Rows use
relative paths and sort by numeric temperature, then path. Summaries use internal
unrounded totals. NE uses measured mean production temperature; without NE a
single stationary production NVT target is required (ramps, multiple targets and
missing NVT targets produce an explicit error). Calculation or validation
failures return nonzero and preserve previous summaries. Unresolved templates
are skipped. A successful run without -ne can reuse diffusion from a
compatible previous NE result and retains any existing conductivity summary and fit.
Range runs reuse only the matching segment result and publish totals under
root/msd/segments/START-ENDns/, separately from full-trajectory root summaries.
The companion msd-quality-total.txt retains each directory's PASS/WARNING
status. In NE mode, a directory whose valid coefficients were retained despite
fit-quality rejection appears as WARNING and contributes to both numeric
summaries. A single-element rejection without -ne prevents publication of new
aggregates. Multi-element aggregates identify rejected non-NE elements individually.
-ne ELEMENT requires that element in the selection and thermo.out.
Bare -ne infers the element only for a single-element selection. The default
-charge 1.0 is an explicit +1 formal-charge assumption, not inferred oxidation
state; negative charges are accepted and the sign cancels. The log records charge,
measured and target temperature, volume and fit diagnostics. Thermodynamic rows
are aligned using every run's own output interval. Volume is the absolute cell
determinant from columns 10–18, never a separate column or the initial model
volume. Only records between the first and last saved trajectory timestamps are
averaged; shared sample times cross-check trajectory volumes. The thermo reader
supports NPT mean volumes internally, but this does not enable NPT MSD. NVT
volumes must be constant. Measured mean temperature enters the NE equation;
a >5% target mismatch warns. Temperature ramps are rejected for NE.
Nernst–Einstein conductivity uses self-diffusion and neglects distinct-ion cross
correlations. It is not generally equal to experimental conductivity. The existing
gpumd-out -msd workflow is unchanged.
Standalone Arrhenius fitting
pmk msd -ne calculates MSD, diffusion, and Nernst–Einstein conductivity
and merges their summaries. Batch pmk jump-rate writes a hop frequency summary.
Arrhenius is the default method. Use the following commands in the material
directory, with one subdirectory per temperature.
pmk msd -element Li -ne
pmk jump-rate
pmk fit -jump-rate jump-rate.txt
pmk fit -diff self-diff-total.txt -sigma sigma-total.txt
The global jump-rate fit uses the MD-observed resolved per-Li event rate.
For a generated jump-rate.txt, the fit checks its SHA-256 against
.pmk_jump_rate_index.json, checks each temperature manifest and full-precision
record, and reproduces the displayed rows before fitting the actual temperatures
and unrounded frequencies. Rerun pmk jump-rate to upgrade an older index.
A changed table or inconsistent record stops the fit. An independent input
table is recorded as external_text. The report includes the input digest,
the temperatures and rates used, the OLS coordinates and the precision source.
Zero, missing and nonfinite observations are excluded, as are generated records
with only nominal temperatures. Identical duplicate observations have one vote.
With at least three distinct valid temperatures, free-intercept OLS fits
ln(ωp) = b + m (1000/T). The apparent migration activation energy is
Em_app = −1000 kB m in eV. The apparent migration entropy satisfies
ΔS_app/kB = b − ln(ω0), with a reference frequency of 10¹³ Hz. Doubling
-omega0 subtracts ln(2) from ΔS_app/kB and preserves Em_app. The total rate
already includes all resolved directions, so the fit uses no coordination
multiplier. Local environments, channel weights and site occupancies contribute
to these apparent parameters. A saddle-point vibrational entropy requires
independent microscopic information. The AC conductivity crossover in JACS
2023 defines a separate experimental observable. A constant response has
undefined R². Use -overwrite to replace a changed fit.
Input fields are whitespace-separated. Use single or double quotes around
directory identifiers containing spaces. Blank lines, # comments, and
scientific notation are accepted.
| Input | Column 1 | Column 2 | Column 3 |
|---|---|---|---|
-diff |
Directory identifier | Production temperature (K) | Total self-diffusion coefficient (cm²/s) |
-sigma |
Directory identifier | Production temperature (K) | NE conductivity (mS/cm) |
-hopfreq |
Temperature (K) | Hop frequency (s⁻¹) |
For -hopfreq, use the historical ionhop table with its Temp(K) Hop_freq(s-1)
header or supply a numeric two-column table with no header. A UTF-8 BOM and
full-width header parentheses are accepted. Historical ionhop JSON retains
full precision. Older tables may contain rounded frequencies. The two-column
workflow retains its historical integer-K OLS behavior. Use -hop-data
to fit with measured temperatures and keep zero counts.
For multi-element MSD summaries, prepare a three-column input for the desired element. Quote any space-containing identifiers in a copy of a legacy summary. Supply rows from the same material and compatible analysis conditions. The fitter uses the supplied tables alone and needs no trajectory files or provenance.
The temperature is rounded to the nearest integer Kelvin using round-half-up.
For example, 359.49 K becomes 359 K, 359.50 K and 359.99 K become 360 K, and
399.98 K becomes 400 K. The rounded value T enters both the reciprocal
coordinate and the conductivity response.
| Model | Response y |
Prefactor |
|---|---|---|
D = D0 * exp(-Ea_D / (k_B*T)) |
ln(D) |
D0 = exp(b) in cm²/s |
sigma*T = A_sigma * exp(-Ea_sigma / (k_B*T)) |
ln(sigma*T) |
A_sigma = exp(b) in mS·K/cm |
Gamma = Gamma0 * exp(-Ea_Gamma / (k_B*T)) |
ln(Gamma) |
Gamma0 = exp(b) in s⁻¹ |
Each model uses independent, unweighted ordinary least squares with a free
intercept, y = b + m*x and x = 1000/T. Each activation energy is
Ea = -1000*m*k_B in eV with k_B = 8.617333262145e-5 eV/K.
R² = 1 - sum((y - y_fit)^2) / sum((y - mean(y))^2) is N/A for a constant
response.
Each valid independent simulation contributes to the observation count N,
including runs at the same rounded temperature such as 500, 500-2 and
500-3. There is no averaging across runs. The fit requires at least three
distinct rounded temperatures (N_T). Identical records for a directory and
unavailable, nonfinite, or nonpositive observations are diagnosed and excluded.
For -hopfreq, duplicate detection uses the numerical temperature before
rounding. Identical valid temperature and frequency pairs are excluded, and
distinct original temperatures that round to the same Kelvin each contribute
to N. Zero frequencies are excluded because ln(0) is undefined.
Malformed rows and conflicting duplicates stop publication for the invocation.
Successful fits write arrhenius-diff.txt, arrhenius-sigma.txt, or
arrhenius-hopfreq.txt in the working directory for the requested inputs.
The first line reports the prefactor, energy, R², counts,
Method=OLS, T_rounding=nearest_integer_K_HALF_UP, and FIT_STATUS=PASS.
The second line names the two columns. The data rows contain 1000/T and
the corresponding log response, sorted by increasing 1000/T. Ties are
ordered by directory identifier for diffusion and conductivity and by
increasing original temperature for hop frequency. The prefactors D0,
A_sigma, and Gamma0 use lowercase scientific notation with two decimal
places. Activation energy, R², and both data columns use fixed-point notation
with two decimal places. N and N_T are integers.
The regression uses full floating-point precision after the prescribed Kelvin
rounding. Decimal formatting occurs when the reports are written.
Inspect fit.log for counts and row diagnostics.
If a requested fit has fewer than three distinct temperatures, the command
returns a nonzero status and reports how many more points are needed. It preserves
any existing output for that fit, or writes the available coordinates with
N/A parameters and FIT_STATUS=INSUFFICIENT_DATA when no output exists.
An independently valid fit in the same invocation still publishes. Inputs are
read-only. All requested datasets are parsed before staging and publishing any
outputs.
Count Li site hops in GPUMD trajectories
pmk jump-rate
pmk jump-rate -trajectory 300/dump.xyz
pmk jump-rate -trajectory 300/dump.xyz -model 300/model.xyz
Batch mode scans immediate numeric temperature folders such as 300 and
350K for dump.xyz. The directory label names the job and its outputs.
For temperature, the analyzer uses an explicit single-trajectory -temperature
in K when supplied. Otherwise it prefers the measured thermo.out production
mean with a matching run.in schedule and checked cell volumes, followed by
the mean of per-frame XYZ Temperature= values in K. A fixed thermostat
target or directory label is recorded as nominal when measurement is
unavailable. The JSON includes temperature source and deviations. A deviation
above 5% from a reference emits a warning. Count fits require verified
stationary temperatures by default. An explicit temperature supplies a
user-verified value for a stationary trajectory.
The thermo.out match allows small accumulated GPUMD clock error. For each
nominal dump timestamp, the tolerance is the larger of 0.01 fs and one
billionth of the absolute scheduled time, capped at 0.1% of the dump interval.
The matched schedule is used for thermodynamic alignment. Event timestamps
and Li exposure use the saved trajectory times.
Resolved transport outputs and historical results
Each temperature folder contains jump-rate/events.csv (confirmed events),
candidates.csv (candidate residence runs), transport-summary.json,
jump-rate.json (full kinetics and edge exposures) and manifest.json.
Optional fine-sampled runs also save attempt-frequency.json. Single-trajectory
mode publishes details in the trajectory's folder. Batch mode also writes
hop_fit_data.json for directed-channel fits and five two-column tables.
When migration retains a historical hop_fit_data.json, use the new
jump-rate-hop-fit-data.json for directed-channel fits.
| File | Quantity |
|---|---|
jump-rate.txt |
ωp = J/(N_Li t) in Hz. J counts confirmed nearest-neighbor O→O events with no sampled intermediate O. All Li contribute to exposure, including stationary Li. |
jump-distance.txt |
a = √(Σd²/J) in Å. Each periodic minimum-image site separation uses the cubic cell at confirmation. Zero events give N/A. |
jump-diff.txt |
DJ = 10⁻¹⁶ Σd²/(6 N_Li t) = 10⁻¹⁶ a²ωp/6 in cm²/s. The sum gives zero when no resolved events occur. |
jump-rate-nearest-net.txt |
Legacy nearest net displacement count per Li per second, including nearest endpoints with an intermediate O. Missing reliable counts give N/A with the reason in the temperature manifest. |
correlation-factor.txt |
f_resolved = D*/DJ for the RESOLVED subset. Interpretation as an intrinsic correlation factor for the complete network requires additional evidence. Missing or mismatched tracer data and zero DJ give N/A. Values above one are retained with a warning. |
The five tables and number density use integer Kelvin (half up), increasing
temperature and three significant digits in scientific notation. Conflicting
rounded temperatures stop publication. JSON retains full precision. The
manifest records the authoritative matched D*, f, MSD input hashes and status.
The per-temperature JSON also records the matched D*, f_resolved, event count,
population, elapsed exposure time and input provenance. -self-diff defaults to self-diff-total.txt; the element-resolved table
is also supported. Matching uses the directory, Li selection and population,
trajectory fingerprint, frame count and spacing, temperature and frame window.
The adjacent MSD index and local provenance supply full precision.
On first use the command inspects historical ionhop bundles, including
provenance v2 bundles without a stored RMS distance. For v2 it retains
compatible CPU/NumPy assignment results and existing time-block partitions
when no specific block size is requested. It checks
provenance and output fingerprints, reclassifies the recorded endpoints from
their periodic FCC geometry and intermediate O visits, rejects duplicate
events, and recomputes counts, RMS, frequency and DJ. A candidates file alone
contains insufficient event evidence. Unverifiable records are retained and
the affected temperature is analyzed again. The manifest lists the original
files, sizes, SHA256 values and destinations. Verified details and summaries
are staged together. Authenticated redundant files are retired with rollback
storage during publication only when their SHA-256 matches a digest already
recorded by the original ionhop writer. A fresh copy hash checks transfer
integrity. A stat-only bundle retains its originals with
legacy_ownership_unverified in the manifest. The next invocation checks the
publication journal under an OS lock. Recovery preserves displaced files
and the journal under a unique recovered directory. Inspect any unknown lock
directory or changed recovery file before retrying. Later runs
check input size/mtime, analysis settings and detail SHA256 before reusing
events. Use -overwrite for stale details. A missing root table can be
reconstructed without rereading trajectory coordinates. For strict checks use
pmk jump-rate -verify-input-hash. Establishing the first strict baseline
on an existing fast cache requires -overwrite and fresh analysis.
NE number density
pmk msd -element Li -ne writes number-density.txt using the same selected
Li count and production mean cell volume as the conductivity calculation:
n = 10²⁴ N/V in cm⁻³ for V in ų. In consistent units the NE relation is
σ = n(Ze)²D*/(kB T). The index records the population, volume, data source
and input fingerprints. A validated rerun backfills the missing table and
preserves unchanged diffusion and conductivity files. A fingerprinted fit diagnostic can supply a missing
historical mean volume. Archive-only reuse requires historical trajectory
and run fingerprints, a matching selection, and a historical mean volume.
A missing identity produces UNVERIFIED_LEGACY; incomplete density inputs
produce RECOMPUTE_REQUIRED. The batch preserves the previous summaries on
failure. Use pmk msd -element Li -ne -recompute-archived to analyze the
current trajectory after archiving the per-run MSD directory.
A group restriction applies before element selection. With an explicit list
such as -element Li,O -ne, the first element supplies the existing NE
conductivity column and main density table. Additional selected elements get
their own density file, e.g. number-density-O.txt. Use -ne O to choose
the conductivity species explicitly. MD population density alone does not
measure a thermally activated defect population or its formation energy.
The NPT restriction of the MSD command continues to apply.
The alternatives are -min-frames N and -min-residence-ps T. A run of
N consecutive samples spans (N - 1) * Δt. The default of two samples
spans one dump interval. With 0.2 ps spacing, a 0.4 ps criterion needs three
samples. -radius defaults to 1.25 Å and must be below half the O–T spacing.
-max-frames N selects the first N frames. At least two are required.
The default SciPy periodic KD-tree and optional -backend numpy use the same
site geometry. The reader streams frames in either mode. Vibrational analysis
retains the selected Li positions and labels for spectral processing.
The input must contain Li, I and either Y or La in a fully periodic,
axis-aligned cubic supercell. Isotropic changes in cell size are supported.
Use stable atom order within a trajectory or a unique id:I:1 field if
rows are reordered. The first saved frame determines the one-based Li
row IDs in the output.
The trajectory establishes the iodine reference from up to 16 early frames. The reconstruction removes each frame's relative translation by a periodic median, forms a per-iodine median in fractional coordinates, and estimates the ideal grid translation from the Fourier phase of the iodine coordinates modulo half a conventional FCC cell. Periodic matching resolves the FCC parity. The reference first tries a unique nearest-site match within half the nearest I–I spacing. When locally displaced iodine atoms prevent that match, it estimates the shift from a strict majority of distinct sites within the same bound, then jointly matches all iodine atoms to the ideal sites by minimum total squared periodic distance. The summary records the matching method and reference outliers. The first tracked iodine fixes the translationally equivalent site numbering. Each subsequent frame removes the global iodine median displacement from Li coordinates and requires a strict majority within the same geometric bound. The summary also records frames with local iodine excursions beyond that bound. The octahedral O positions are the FCC grid shifted by half a conventional cell along each axis relative to the iodine grid. The tetrahedral T positions retain their ideal interstitial geometry and O–T connectivity. An optional model is fitted to the same geometry for structural and initial-occupancy diagnostics. Events and CSV initial occupancy refer to the analyzed trajectory in either mode.
The first O-core assignment can establish a left-censored origin. A new
destination must pass the residence criterion. A return to the origin clears
the excursion and its provisional T path. Every T entry is stored in time
order for a confirmed event. An observed intermediate O core makes a completed
displacement UNRESOLVED_INTERMEDIATE_O even when the net displacement is
nearest neighbor. A confirmed nearest-neighbor displacement without such a
visit is RESOLVED at the available sampling. Other non-nearest displacements
are reported separately. The final summary records censored O residences and
unfinished excursions. Finite sampling can miss brief visits and recrossings.
For a directed edge a → b, the resolved event count is J_ab. Divide
by all Li ions N_Li and the first-to-last elapsed time t in seconds for
the observed frequency. Divide by origin core exposure τ_a for the
conditional rate.
$$ \Gamma_{ab}^{\rm obs}=\frac{J_{ab}}{N_{\rm Li}t},\qquad k_{a\to b}=\frac{J_{ab}}{\tau_a},\qquad p_a=\frac{\tau_a}{N_{\rm Li}t},\qquad \Gamma_{ab}^{\rm obs}=p_a k_{a\to b}. $$
The exposure uses the raw core assignment at the left endpoint of each saved
frame interval. T and unassigned intervals contribute to total Li exposure.
Each direction uses its own counts and origin exposure. The rates are in s⁻¹.
Read event_count, origin_exposure_s, origin_fraction,
gamma_obs_s-1, and k_conditional_s-1 in the kinetics JSON edge records. The JSON also
reports O and T Li time fractions, unassigned exposure and the fraction of
site time without Li. All-cation vacancies and target availability are marked
UNAVAILABLE. The model snapshot and initial_occupant are static diagnostics.
GPUMD Time= values are in femtoseconds and must be increasing and equally
spaced within numerical tolerance. If timestamps are absent, a single
matching fixed-step dump block in run.in supplies the interval and is
checked against the frame count.
Arrhenius fits from hop counts
pmk fit -method arrhenius -hop-data hop_fit_data.json
pmk fit -method arrhenius -hop-data hop_fit_data.json -hop-edge 'O1->O2'
pmk fit -method arrhenius -hop-data hop_fit_data.json -hop-edge 'O1->O2' -block-bootstrap 400
pmk fit -method arrhenius -hop-data hop_fit_data.json -hop-model ols
-hop-data also accepts repeatable per-trajectory jump-rate.json inputs.
Compare the same material and analysis criteria. For a directed fit, verify
that the ideal IDs map to the same local environment across trajectories. A
trajectory with positive origin exposure and no observed edge event contributes
a zero count. A trajectory with zero origin exposure lacks an observation for
that conditional rate. -allow-nominal-temperature explicitly opts in to
using nominal temperatures. Ramped targets are excluded.
Poisson fits use J_i ~ Poisson(E_i * A * exp(-Ea/(k_B*T_i))) at full
temperature precision. Here E_i is all-Li exposure for the total observed
frequency, or origin exposure for a conditional edge. OLS is a positive-rate
comparison using log rates and reports its excluded zero count observations.
Use at least three distinct usable temperatures. arrhenius-hops.json reports
the full-precision slope, intercept, prefactor, energy in eV, residuals, fit
range, sample sizes, positive-count log R² and RMSE, and Poisson deviance.
It reports analytical 95% intervals when estimable. Numerical convergence
describes the optimizer or regression. Inspect residuals and physical
consistency to assess the Arrhenius model.
With -block-frames, each saved interval contributes to one contiguous time
block, and an event enters the block containing its confirmation. The optional
bootstrap resamples complete blocks within each trajectory. It needs at least
four complete blocks per trajectory and reports unavailable precision for
poorly identified resamples. Choose a block duration long enough to contain
correlated jumps and verify interval sensitivity. -bootstrap-seed defaults
to zero. Analytical Poisson intervals assume independent events.
Vibrational attempt frequency
pmk jump-rate -trajectory 500/fine.xyz -min-residence-ps 0.4 -attempt-frequency
The GEMDAT-compatible estimator uses the single-sided periodogram of the first difference of unwrapped radial displacement. It computes a power-weighted frequency centroid per Li in Hz and reports the mean and population standard deviation across Li. Site-local estimates use long continuous O-core residence windows after iodine translation and affine cell dilation are removed. Whole-trajectory spectra may contain contributions from migration and drift.
The sampler checks f_Nyquist = 1/(2*Δt), the spectral bin spacing
1/(N*Δt), and the window duration. The default requires at least four
samples per cycle at -attempt-expected-thz 10 and a window of at least ten
cycles and -attempt-min-window-ps 2. A dump interval of 0.2 ps gives
2.5 THz Nyquist and UNAVAILABLE for a 10 THz analysis. Use fine sampling
such as 2–10 fs and check convergence across dump intervals and window
lengths. Sampling eligibility alone cannot establish convergence or rule out
aliasing from higher frequencies.
Apparent migration entropy and transport
pmk fit -method arrhenius -hop-data hop_fit_data.json -hop-edge 'O1->O2' -migration-entropy temperature-dependent -confirm-channel-environment
The fitted global entropy remains in migration-entropy.json. Its
per_temperature records also give the point estimates in both units.
The companion migration_entropy.txt uses the same constant mean or
temperature-dependent origin frequencies as the normalized fit. Zero counts
give N/A in the table and retain their positive exposure in the Poisson fit.
Repeated observations at exactly the same temperature use summed counts and
summed attempt-weighted exposures. Use -overwrite to replace a changed
entropy table or -reuse to verify the inputs, settings and existing results.
The entropy fit requires a conditional edge and qualified origin-local attempt
estimates with matching site, species, residence and radius metadata. Use
repeatable -attempt-data arguments for separate fine-sampled trajectories
at the same analysis temperatures. Use -temperature in single mode when
matched temperatures are independently known. Confirm the correspondence of
site IDs, physical environments and the directed channel before combining the
measurements. Ideal FCC IDs alone do not establish local chemical equivalence.
For -migration-entropy constant, the apparent entropy is
ΔS_app/k_B = ln(A_k/ν_att) with both rates in s⁻¹. This mode uses the average
attempt frequency and requires all input values to lie within 10% of that
average. The temperature-dependent model fits ln(k/ν_att(T)), or uses
τ_a*ν_att(T) as the Poisson offset exposure. The output
migration-entropy.json reports entropy in units of k_B and J mol⁻¹ K⁻¹,
the corresponding activation energy, attempt frequencies, and intervals
conditional on the supplied spectral estimates. A total observed rate still
carries origin occupation and channel weights. The frequency ω_p in JACS
Eq. (7) comes from AC conductivity spectra. The vibrational proxy is derived
from MD. A Vineyard calculation requires vibrational modes at the initial and
saddle configurations. Li et al. (2023)
GEMDAT
The summary reports the resolved-channel jump diffusivity
D_J = Σ|Δr|²/(6*N_Li*t) in cm²/s. Its scope covers the detected resolved
O→O channel set. For a single trajectory, matching-window
-self-diffusivity from pmk msd and -collective-diffusivity from an
independent charge displacement calculation give f_self = D*/D_J and
C_ion = D_sigma/D* where denominators are positive. The former probes
directional self-correlation within the chosen jump scope. The latter probes
collective charge correlations. Optional -ne-conductivity and
-collective-conductivity record matching values in mS/cm for comparison.
A transport ratio based on incomplete jump coverage has a correspondingly
limited interpretation.
Plan GPUMD NVT production from Li MSD
Run the predictor from a project directory containing completed GPUMD tasks.
pmk pred-msd-time -ea 0.2 -temp-interval 50 -max-temp 550
pmk gpumd-job -i model.xyz -nep nep.txt -in run.in -msd-time pred-msd-time.log
The predictor defaults to Li group 0 in grouping method 0 and selects the lowest
eligible measured temperature. Use -group to select a different Li group or
-ref-temp 300 to select a reference by its nominal or measured temperature.
The prediction grid advances by -temp-interval from the reference's nominal
setpoint up to -max-temp. Each target must be above the measured reference.
Inconsistent results at the same reference temperature require resolution
before planning.
Use a completed, fixed-cell NVT production trajectory with its original
run.in, model.xyz, and aligned thermo.out. The predictor requires a
full-trajectory free-intercept OLS result from pmk msd -ne -group 0 (or the
matching Li group) with a +1 formal charge. PASS and WARNING are eligible. A
baseline WARNING carries into every prediction, and REJECT excludes the fit
from baseline selection. Successful MSD analyses write msd/provenance.json
(or the equivalent file in a segment directory), which records source and
result fingerprints, the selected group and fit, and measured thermodynamics
when available. Older full-run results require an identifiable trajectory,
group, fit window and quality, agreement with the saved curve and NE totals,
and output timestamps at least as recent as the inputs. Incomplete or stale
analyses are reported with their reason. Prediction does not rerun MSD.
Measured conductivity comes from the reference MSD slope and Nernst–Einstein
(NE) relation. The forecast uses the measured reference temperature and
conductivity with the conventional ln(sigma*T) Arrhenius relation.
sigma(T) = sigma_r * (T_r / T) * exp[-Ea/kB * (1/T - 1/T_r)]
D(T) = sigma(T) * V(T) * kB * T / (N_Li * q^2) [in consistent units]
t_raw = saved_reference_ns * sqrt(D_reference / D(T))
t_plan = ceil(max(min_production_ns, t_raw)) [ns]
Conductivity is independent of the volume prediction. Diffusion uses the same NE relation with the predicted volume and the reference Li count. With one NVT volume sample the volume is constant. With compatible samples (same full-cell composition, selected Li count and fully periodic fixed-cell convention), it is interpolated between measured temperatures. Targets beyond the measured volume range use the nearest endpoint and generate a warning. Other measured conductivities are compared at their actual measured temperatures. The log reports the absolute gap, fractional gap relative to the measurement, and measured-to-predicted ratio. Different fit windows limit the comparison to an indicative check. The supplied activation energy stays fixed.
The square-root scaling is an empirical planning heuristic. The default 6 ns
is a planning floor, configurable with -min-production-ns. Recommended
durations carry no guarantee of MSD convergence. Determine the actual diffusion
regime and fit quality with pmk msd after production.
Provide a fixed timestep and use the placeholders in the production block of the job template. Earlier equilibration blocks can use their own numeric temperatures and run lengths. The template syntax below is compatible with GPUMD 4.2.
potential nep.txt
time_step 1.0
ensemble npt_scr 300 300 100 0.0 100.0 1000
run 2000000
ensemble nvt_bdp target_t target_t 100
dump_thermo 10
dump_exyz 1000 1 1
compute_msd 5 msd-steps group 0 0
run production-steps
production-stepsis the number of NVT MD integration steps,ceil(t_plan * 1e6 / dt_fs).msd-stepsis GPUMD'sNc, the maximum number of correlation samples. It isfloor(0.5 * t_plan * 1e6 / (sample_interval * dt_fs)). The sample interval is the first argument of the template'scompute_msd. Omit the entire directive if you only need raw-trajectorypmk msd.
Pass -in run.in to the predictor to use the job template's timestep and
sampling interval in the table. Otherwise the table uses the reference run's
settings and shows a dash when the saved run has no compute_msd. The job
generator uses the actual template settings and reports any recalculation.
It validates the latest successful prediction record and the complete job
batch, then creates one directory per target in the invocation directory.
Existing destinations cause the batch to fail before generation. The original
template, equilibration runs, dump_exyz cadence and optional
compute_msd arguments are preserved.
Metadata
Release files for pymdkit 1.7.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pymdkit-1.7.10.tar.gz | 497.1 kB | Without provenance | Details for pymdkit-1.7.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymdkit-1.7.10-py3-none-any.whl | Python 3 | none | any | Details for pymdkit-1.7.10-py3-none-any.whl |
Total release size: 828.2 kB
Release files / pymdkit-1.7.10.tar.gz
| Download URL | pymdkit-1.7.10.tar.gz |
|---|---|
| Size | 497.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69ed7b1b3cbc4c0e8473820c1a3bf431a8d352768e66f5675079f1ff4443d7e3
|
|
BLAKE2b-256 checksum How to use checksums |
56ae93dbbdf2eba797bb54da69a1b275939263ce3f8c6300022d4b3c66a1b276
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|
Release files / pymdkit-1.7.10-py3-none-any.whl
| Download URL | pymdkit-1.7.10-py3-none-any.whl |
|---|---|
| Size | 331.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2582f0201b20f9200b6f6713567228768bc40a7c44bb473ae3da0d1a67f0f31a
|
|
BLAKE2b-256 checksum How to use checksums |
0ce2a70dc8206ea618c0c73921b30374ef5a4da733a4dbd0dbce30b8d891a12f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|
Security for pymdkit 1.7.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.