pymdkit 1.7.4__tar.gz → 1.7.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. {pymdkit-1.7.4 → pymdkit-1.7.6}/CHANGELOG.md +10 -0
  2. {pymdkit-1.7.4/src/pymdkit.egg-info → pymdkit-1.7.6}/PKG-INFO +219 -12
  3. {pymdkit-1.7.4 → pymdkit-1.7.6}/README.md +217 -11
  4. {pymdkit-1.7.4 → pymdkit-1.7.6}/pyproject.toml +2 -1
  5. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/__init__.py +1 -1
  6. pymdkit-1.7.6/src/pymdkit/commands/_dope_certify.py +145 -0
  7. pymdkit-1.7.6/src/pymdkit/commands/_dope_optimize.py +146 -0
  8. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_gpumd_msd.py +11 -11
  9. pymdkit-1.7.6/src/pymdkit/commands/_ionhop.py +703 -0
  10. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_conductivity.py +19 -19
  11. pymdkit-1.7.6/src/pymdkit/commands/_msd_reuse.py +249 -0
  12. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/dope.py +168 -67
  13. pymdkit-1.7.6/src/pymdkit/commands/ionhop.py +54 -0
  14. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/msd.py +69 -11
  15. {pymdkit-1.7.4 → pymdkit-1.7.6/src/pymdkit.egg-info}/PKG-INFO +219 -12
  16. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit.egg-info/SOURCES.txt +9 -0
  17. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit.egg-info/requires.txt +1 -0
  18. pymdkit-1.7.6/tests/test_dope_certify.py +155 -0
  19. pymdkit-1.7.6/tests/test_dope_optimize.py +207 -0
  20. pymdkit-1.7.6/tests/test_ionhop.py +248 -0
  21. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_msd_phase3.py +2 -1
  22. pymdkit-1.7.6/tests/test_msd_reuse.py +256 -0
  23. {pymdkit-1.7.4 → pymdkit-1.7.6}/LICENSE +0 -0
  24. {pymdkit-1.7.4 → pymdkit-1.7.6}/MANIFEST.in +0 -0
  25. {pymdkit-1.7.4 → pymdkit-1.7.6}/setup.cfg +0 -0
  26. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/_config.py +0 -0
  27. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/_logging.py +0 -0
  28. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/__init__.py +0 -0
  29. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_cifio.py +0 -0
  30. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_extxyz.py +0 -0
  31. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_fileio.py +0 -0
  32. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_geometry.py +0 -0
  33. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_gpumd.py +0 -0
  34. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_gpumd_final_structure.py +0 -0
  35. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_gpumd_run.py +0 -0
  36. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_gpumd_status.py +0 -0
  37. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_gpumd_thermo.py +0 -0
  38. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_lattice.py +0 -0
  39. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_auto.py +0 -0
  40. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_coordinates.py +0 -0
  41. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_fit.py +0 -0
  42. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_io.py +0 -0
  43. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_provenance.py +0 -0
  44. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_range.py +0 -0
  45. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_thermo.py +0 -0
  46. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_msd_uncertainty.py +0 -0
  47. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_oxidation.py +0 -0
  48. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_parallel.py +0 -0
  49. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_precision.py +0 -0
  50. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_pred_msd_plan.py +0 -0
  51. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_pred_msd_reference.py +0 -0
  52. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_reduction.py +0 -0
  53. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_submit.py +0 -0
  54. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_submit_vasp.py +0 -0
  55. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_supercell.py +0 -0
  56. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_symmetry.py +0 -0
  57. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_vasp_ehull.py +0 -0
  58. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_vasp_final_structure.py +0 -0
  59. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_vasp_nep.py +0 -0
  60. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_vasp_output.py +0 -0
  61. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/_vaspset.py +0 -0
  62. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/chemsys_entry.py +0 -0
  63. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/compute_rmsd.py +0 -0
  64. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/config.py +0 -0
  65. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/convert.py +0 -0
  66. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/ewald.py +0 -0
  67. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/gpumd_job.py +0 -0
  68. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/gpumd_out.py +0 -0
  69. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/nep_rmse.py +0 -0
  70. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/perturb.py +0 -0
  71. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/pred_msd_time.py +0 -0
  72. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/rd.py +0 -0
  73. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/realloc_occ.py +0 -0
  74. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/submit.py +0 -0
  75. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/supercell.py +0 -0
  76. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/trjconv.py +0 -0
  77. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/vasp_job.py +0 -0
  78. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/commands/vasp_out.py +0 -0
  79. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit/pymdkit_main.py +0 -0
  80. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit.egg-info/dependency_links.txt +0 -0
  81. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit.egg-info/entry_points.txt +0 -0
  82. {pymdkit-1.7.4 → pymdkit-1.7.6}/src/pymdkit.egg-info/top_level.txt +0 -0
  83. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/data/88-Li2YCl3-63-d1.cif +0 -0
  84. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_config_logging.py +0 -0
  85. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_convert.py +0 -0
  86. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_ehull.py +0 -0
  87. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_gpumd_out.py +0 -0
  88. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_lattice_symmetry.py +0 -0
  89. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_msd_auto.py +0 -0
  90. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_msd_fit.py +0 -0
  91. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_msd_large.py +0 -0
  92. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_msd_range.py +0 -0
  93. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_msd_uncertainty.py +0 -0
  94. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_parallel.py +0 -0
  95. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_pred_msd_time.py +0 -0
  96. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_progress.py +0 -0
  97. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_realloc_occ.py +0 -0
  98. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_rmsd_gpu.py +0 -0
  99. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_rmsd_max.py +0 -0
  100. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_rmsd_two_folder.py +0 -0
  101. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_submit.py +0 -0
  102. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_v165.py +0 -0
  103. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_v170_job_infrastructure.py +0 -0
  104. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_v170_vasp_consolidation.py +0 -0
  105. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_v172_vasp_writing.py +0 -0
  106. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_vasp_out.py +0 -0
  107. {pymdkit-1.7.4 → pymdkit-1.7.6}/tests/test_vaspset.py +0 -0
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.5
4
+
5
+ - `pmk msd` reuses validated full-trajectory and range results with version-1
6
+ provenance, including compatible 1.7.4 results. Newly calculated and reused
7
+ results share the total-only batch summaries, with rollback if publication
8
+ fails.
9
+ - Add `pmk ionhop` for iodine-aligned Li site hopping in GPUMD trajectories,
10
+ with single and multi-temperature modes and nearest-neighbor hop frequencies.
11
+ SciPy is a direct dependency for the cKDTree CPU backend.
12
+
3
13
  ## 1.7.4
4
14
 
5
15
  - `pmk msd -ne` retains finite, positive Einstein diffusion coefficients and
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymdkit
3
- Version: 1.7.4
3
+ Version: 1.7.6
4
4
  Summary: A Python command-line toolkit for high-throughput atomistic workflows in AI-driven materials design.
5
5
  Author-email: Yueda Wang <ydwang0608@ustc.edu.cn>
6
6
  License-Expression: GPL-3.0-or-later
@@ -14,6 +14,7 @@ Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: numpy
17
+ Requires-Dist: scipy
17
18
  Requires-Dist: ase
18
19
  Requires-Dist: pymatgen
19
20
  Requires-Dist: mp-api
@@ -36,6 +37,24 @@ materials design. Install `pymdkit` once and call its tools from anywhere as
36
37
  Commands expose explicit, documented CLI interfaces designed for reproducible shell,
37
38
  HPC, and AI-agent workflows, and each underlying script is still runnable on its own.
38
39
 
40
+ ## 1.7.6 release notes
41
+
42
+ - `pmk dope -ref ELEMENT ELEMENT` now optimizes minimum periodic separation
43
+ when used with `-sn` and `-on`; `-we vac -ref vac vac` optimizes vacancy sites.
44
+ - `-d` is removed. Legacy reference removal uses `--reference-cutoffs`.
45
+ - Optimized structures are validated after writing and accompanied by a ranked
46
+ `optimization-summary.txt`. Scientific data reuse replaces the radius table,
47
+ symmetry-expression evaluation and duplicated exact SI constants.
48
+
49
+ ## 1.7.5 release notes
50
+
51
+ - `pmk msd` reuses compatible full-trajectory or segment results, including
52
+ validated 1.7.4 WARNING results. Reused and newly calculated results contribute
53
+ to the same batch summaries after every directory succeeds.
54
+ - `pmk ionhop` analyzes completed Li octahedral-to-octahedral hops in
55
+ iodine-aligned GPUMD trajectories. It supports single and multi-temperature
56
+ runs with SciPy cKDTree and batched NumPy CPU assignment.
57
+
39
58
  ## 1.7.4 release notes
40
59
 
41
60
  - `pmk msd -ne` retains valid Einstein diffusion coefficients and conductivity
@@ -106,7 +125,7 @@ installed.
106
125
  On a machine with Internet access, run:
107
126
 
108
127
  ```bash
109
- python -m pip download pymdkit==1.7.4 -d pymdkit-offline
128
+ python -m pip download pymdkit==1.7.6 -d pymdkit-offline
110
129
  ```
111
130
 
112
131
  This downloads `pymdkit` and the dependencies resolved by pip into the
@@ -114,14 +133,14 @@ This downloads `pymdkit` and the dependencies resolved by pip into the
114
133
  system. Then, inside the target pymdkit Python or conda environment, run:
115
134
 
116
135
  ```bash
117
- python -m pip install --no-index --find-links=pymdkit-offline pymdkit==1.7.4
136
+ python -m pip install --no-index --find-links=pymdkit-offline pymdkit==1.7.6
118
137
  ```
119
138
 
120
139
  For optional GPU use, prepare the bundle on a networked machine compatible with
121
140
  the target HPC platform and Python environment:
122
141
 
123
142
  ```bash
124
- python -m pip download "pymdkit[gpu-cuda12]==1.7.4" -d pymdkit-offline
143
+ python -m pip download "pymdkit[gpu-cuda12]==1.7.6" -d pymdkit-offline
125
144
  ```
126
145
 
127
146
  Transfer the whole `pymdkit-offline` directory, then install from it on the
@@ -129,7 +148,7 @@ target system:
129
148
 
130
149
  ```bash
131
150
  python -m pip install --no-index --find-links=pymdkit-offline \
132
- "pymdkit[gpu-cuda12]==1.7.4"
151
+ "pymdkit[gpu-cuda12]==1.7.6"
133
152
  ```
134
153
 
135
154
  This GPU bundle includes the optional `cupy-cuda12x` package. Its wheels must also
@@ -212,6 +231,7 @@ preserve occupancy, oxidation, symmetry, and Wyckoff metadata.
212
231
  | `gpumd-job` | Create supercell, temperature, potential, input, and grouped GPUMD jobs |
213
232
  | `pred-msd-time` | Predict Li conductivity, diffusion and NVT production durations from GPUMD MSD |
214
233
  | `gpumd-out` | Export GPUMD thermo/MSD results or gather final structures |
234
+ | `ionhop` | Count completed Li site hops and report nearest-neighbor hop frequencies from GPUMD trajectories |
215
235
  | `mp-chemsys` | Download stable Materials Project structures for a chemical system |
216
236
  | `nep-rmse` | Compute NEP energy/force/stress RMSE and select candidates |
217
237
  | `perturb` | Generate perturbed structures with dpdata |
@@ -562,7 +582,7 @@ the strict `-max-ehull` filter using `ehull.txt` by default. All modes use
562
582
  ### Doping structures
563
583
 
564
584
  ```text
565
- pmk dope -i FILE -se SELECTOR... [-sn NUMBER...] -we ELEMENT|none... [-wn NUMBER...] [-on NUMBER] [-ref SELECTOR...] [-d DISTANCE...] [-o DIR | -output-folder DIR] [-output-format FORMAT] [-seed INTEGER]
585
+ 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]
566
586
  ```
567
587
 
568
588
  `dope` replaces `substitute` and preserves its validation,
@@ -571,6 +591,105 @@ Random mode defaults to `<input-stem>_dope/`; reference-distance mode defaults
571
591
  to `<input-stem>_dope.cif`. Execution details are written to `dope.log`. The
572
592
  standalone `substitute` command is removed.
573
593
 
594
+ ### Automatic separation in 1.7.6
595
+
596
+ ```powershell
597
+ pmk dope -i LiI-333.vasp -se Li -sn 18 -we Cu -on 100 -o Li90Cu18I108 -ref Cu Cu -seed 42
598
+ pmk dope -i LiI-333.vasp -se Li -sn 18 -we vac -on 100 -o Li90I108 -ref vac vac -seed 42
599
+ ```
600
+
601
+ With `-sn` and `-on`, an identical reference pair enables automatic max–min
602
+ optimization. One selector and one replacement species are supported, including
603
+ `-we Na -ref Na Na`; mixed references are rejected. Without `-ref`, ordinary
604
+ random substitution/removal is unchanged. `vac` is canonical; `none` is deprecated.
605
+ The primary score is the minimum periodic pair distance, including fixed preexisting
606
+ replacement atoms. Vacancy geometry uses original removed-site coordinates.
607
+
608
+ Small spaces (at most 2,000 combinations) are enumerated exactly. Larger spaces use
609
+ seeded randomized farthest insertion and one-site exchanges. Default restart budget:
610
+ `max(4 * outputs, 8 * ceil(eligible / selected))`; at most `2 * selected` sweeps per
611
+ restart, stopping earlier when no improvement is found. Internal `optimize_sites`
612
+ keyword budgets support controlled validation. Initial and optimized candidates are
613
+ pooled, deduplicated by original indices, then ranked by minimum distance, mean
614
+ nearest-neighbor distance and mean pair distance. Scores rounded to 10 decimal places
615
+ resolve numerical ties; overlap diversity and index order break ties. No secondary
616
+ score can override a primary difference larger than that numerical tolerance.
617
+
618
+ `-on 100` returns the best 100 distinct configurations found, not necessarily global
619
+ optima or symmetry-inequivalent structures. Insufficient combinations or exhausted
620
+ budgets report actual counts and termination. Distance-matrix memory is quadratic in
621
+ eligible plus fixed sites. Identical input, seed, arguments and dependency versions
622
+ reproduce selections. Both doping and vacancy operations share this engine.
623
+
624
+ Default filenames remain `<input-stem>_r1.cif`, etc., in `<input-stem>_dope/` or `-o`.
625
+ Optimized CIFs use P1 to preserve the original cell and fractional coordinates;
626
+ VASP output keeps existing species grouping. Every optimized structure is reloaded
627
+ and checked for composition, lattice metric, retained positions and separation.
628
+ `optimization-summary.txt` is tab-separated with JSON metadata in a comment. It
629
+ contains filename, minimum and mean NN distances (Angstrom), packing diagnostic,
630
+ ratio, zero-based original indices and fractional coordinates. Metadata includes seed,
631
+ counts, fixed sites, budgets, method, termination and best/worst/median separation.
632
+
633
+ Optional exact certification runs **after** the same heuristic search:
634
+
635
+ ```text
636
+ pmk dope -i LiI-333.vasp -se Li -sn 18 -we Cu -on 100 -o Li90Cu18I108 -ref Cu Cu --certify-optimum
637
+ 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
638
+ ```
639
+
640
+ `--certify-time-limit` must be finite and positive and requires `--certify-optimum`.
641
+ Its default is 120 seconds for the entire certification stage; it does not change
642
+ the heuristic budget. Certification requires the automatic `-sn/-on/-ref` mode.
643
+ Small enumerated spaces reuse their proof without invoking a solver. Otherwise
644
+ SciPy's `optimize.milp` (SciPy >= 1.9, bundled HiGHS) tests sparse conflict graphs:
645
+ binary x_i selects a site, sum(x_i)=K, and x_i+x_j<=1 when d_ij<t. Candidate sites
646
+ too close to fixed dopants are disabled; conflicting fixed pairs make t infeasible.
647
+ Binary search over discrete periodic distance levels finds the largest feasible
648
+ threshold. A validated configuration plus proof that the next level is infeasible
649
+ (or exhaustion of all levels) certifies the global max-min distance.
650
+
651
+ All distinct float64 distance levels are retained without rounding or grouping.
652
+ Conflicts use strict d<t; returned configurations must satisfy d>=t with no distance
653
+ relaxation. Binary variables are checked within 1e-6 of 0 or 1. This conservative
654
+ policy may require extra solves for nearly identical distances. Proofs refer to
655
+ the computed geometry subject to HiGHS numerical tolerances, not exact arithmetic.
656
+ The packing diagnostic is not used to prune the proof search.
657
+
658
+ `optimality-certificate.json` records input, species, site indices, seed, solver
659
+ and SciPy version, distance policy, per-threshold outcomes, runtime, bounds and
660
+ saved-structure classifications. `CERTIFIED_OPTIMAL` means the proof completed;
661
+ `IMPROVED_NOT_CERTIFIED` means a validated improvement was retained without proof;
662
+ `NOT_CERTIFIED` means no proof or improvement was obtained. Timeouts and solver
663
+ failures retain valid candidates and never imply infeasibility. Invalid returned
664
+ incumbents are errors. Missing MILP support is reported without losing heuristic
665
+ outputs. Valid solver discoveries enter the existing pool before ranking.
666
+
667
+ The certificate distinguishes the optimum from the number of generated structures
668
+ attaining it; `-on 100` does not imply 100 optimal or symmetry-inequivalent structures.
669
+ Default runs do not import or execute certification code or create this report.
670
+ Geometric separation optimality does not establish energetic or thermodynamic stability.
671
+
672
+ The equal-sphere packing diagnostic is
673
+ `D_upper = (6 * (pi / sqrt(18)) * V / (N * pi)) ** (1/3)`, with total objective-site
674
+ count N including fixed dopants. It is a geometric restriction, not an attainable-site
675
+ promise or proof of heuristic optimality. Physical radii are irrelevant. If the
676
+ shortest self-image lattice translation is smaller than this value, the formula need
677
+ not bound the distinct-site objective: metadata marks it inapplicable and the ratio
678
+ is `nan`. No arbitrary physical cutoff is imposed.
679
+
680
+ `-d`/`-distance` is removed and reports migration guidance. Legacy reference removal
681
+ is selected only when both `-sn` and `-on` are absent:
682
+
683
+ ```powershell
684
+ pmk dope -i input.cif -se Li -we vac -ref La Ta --reference-cutoffs 1.01 1.02
685
+ ```
686
+
687
+ Cutoffs remain Angstrom, one per reference. Omitting them preserves
688
+ `0.7 * (Cordero covalent radius sum)`, sourced from ASE for H through Cm; missing
689
+ radii require an explicit cutoff. Output remains `<input-stem>_dope.cif` in the
690
+ invocation directory. `--reference-cutoffs` is rejected in automatic mode.
691
+ Execution logging remains in `dope.log`.
692
+
574
693
  ### Breaking changes in v1.7.0
575
694
 
576
695
  - `gpumd-thermo` and `gpumd-msd` are replaced by `gpumd-out -thermo` and
@@ -904,8 +1023,27 @@ settings, selection, and sensitivity. Beta-qualified window sensitivity,
904
1023
  all-valid-candidate sensitivity, and three-segment slope spread are reported
905
1024
  separately. Segments and MSD time origins are correlated. Window-to-window spread
906
1025
  measures sensitivity. Formal statistical uncertainty requires an explicit
907
- request. Move an existing `msd` directory aside before repeating a calculation.
908
- Temporary coordinate storage is removed when the calculation ends.
1026
+ request. Temporary coordinate storage is removed when the calculation ends.
1027
+
1028
+ When the result directory is absent, `pmk msd` calculates it. When a compatible
1029
+ result already exists, the command reuses its full-precision coefficients and
1030
+ quality without reading trajectory coordinates or changing the saved result
1031
+ files. It checks version-1 provenance, input and output sizes and modification
1032
+ times, grouping method 0, atom counts, run cadence, fit settings, selected
1033
+ window, and diagnostic and coefficient totals. With `-ne` it also checks the
1034
+ charge and thermodynamic inputs and recomputes the stored conductivity from
1035
+ full-precision D, temperature, volume, and ion count. Primary 1.7.4 results
1036
+ can be reused when diagnostics establish compatibility, including the effective
1037
+ lag bounds for a manual window. Missing provenance, stale files, incomplete
1038
+ outputs, incompatible settings, and REJECT results cause an error and leave the
1039
+ result directory intact. Move that directory aside before recalculating.
1040
+
1041
+ With `--uncertainty covariance`, reuse also requires the original uncertainty
1042
+ settings, output fingerprints, and matching input hashes and paths. Older
1043
+ results without those settings or fingerprints require recalculation for an
1044
+ uncertainty request. The existing full-run NE covariance fallback can reuse
1045
+ nominal temperature when `thermo.out` was unavailable. Ordinary NE and range
1046
+ NE still require `thermo.out`.
909
1047
 
910
1048
  The five-column raw MSD is published immediately after FFT succeeds, before
911
1049
  window search, optional uncertainty, or thermodynamic/NE processing. Later errors
@@ -972,15 +1110,18 @@ original inputs/results before and after, regenerates missing diagnostics,
972
1110
  reads the original trajectory and removes temporary coordinates. Normal tests
973
1111
  do not require this external dataset.
974
1112
 
975
- After every eligible calculation succeeds, root-level `self-diff-total.txt` and,
1113
+ After every directory is calculated or validated for reuse, root-level `self-diff-total.txt` and,
976
1114
  with `-ne`, `sigma-total.txt` summarize directory, temperature (K), and the
977
1115
  isotropic total D (cm²/s, `%.2e`) or conductivity (mS/cm, `%.2f`). Rows use
978
1116
  relative paths and sort by numeric temperature, then path. Summaries use internal
979
1117
  unrounded totals. NE uses measured mean production temperature; without NE a
980
1118
  single stationary production NVT target is required (ramps, multiple targets and
981
- missing NVT targets produce an explicit error). Genuine calculation failures return
982
- nonzero and preserve previous summaries; skipped templates are not failures.
983
- A successful run without `-ne` removes any stale root `sigma-total.txt`.
1119
+ missing NVT targets produce an explicit error). Calculation or validation
1120
+ failures return nonzero and preserve previous summaries. Unresolved templates
1121
+ are skipped. A successful run without `-ne` can reuse diffusion from a
1122
+ compatible previous NE result and removes any stale root `sigma-total.txt`.
1123
+ Range runs reuse only the matching segment result and publish totals under
1124
+ `root/msd/segments/START-ENDns/`, separately from full-trajectory root summaries.
984
1125
  The companion `msd-quality-total.txt` retains each directory's PASS/WARNING
985
1126
  status. In NE mode, a directory whose valid coefficients were retained despite
986
1127
  fit-quality rejection appears as WARNING and contributes to both numeric
@@ -1006,6 +1147,72 @@ Nernst–Einstein conductivity uses self-diffusion and neglects distinct-ion cro
1006
1147
  correlations. It is not generally equal to experimental conductivity. The existing
1007
1148
  `gpumd-out -msd` workflow is unchanged.
1008
1149
 
1150
+ ## Count Li site hops in GPUMD trajectories
1151
+
1152
+ ```bash
1153
+ pmk ionhop -model model.xyz -trajectory dump.xyz -prefix Li4YI7_300K
1154
+ pmk ionhop -prefix LiYI7
1155
+ ```
1156
+
1157
+ Supply both paths for single mode. It writes `<prefix>_sites.csv`,
1158
+ `<prefix>_jumps.csv`, and `<prefix>_summary.json`. The sites CSV lists the
1159
+ one-based site IDs, fractional coordinates, O/T type, and initial occupancy.
1160
+ The jumps CSV records the Li atom and site IDs, arrival and confirmation times
1161
+ in ps, displacement in Å, hop class, and sampled tetrahedral evidence.
1162
+ The JSON includes counts, site-link statistics, initial occupancy, iodine
1163
+ alignment, mean displacement, sampling and processing timings, and method
1164
+ limitations.
1165
+
1166
+ With both paths omitted, batch mode looks for immediate integer-temperature
1167
+ subdirectories with `model.xyz` and `dump.xyz`. It warns about incomplete
1168
+ directories, rejects duplicate integer temperatures, and processes complete
1169
+ directories in numeric order. Use a plain prefix such as `LiYI7` to write
1170
+ `LiYI7_300K_sites.csv`, `LiYI7_300K_jumps.csv`, and
1171
+ `LiYI7_300K_summary.json` inside `300/`. After every trajectory succeeds it
1172
+ atomically publishes root `hop_freq.txt`, with header `Temp(K) Hop_freq(s-1)`
1173
+ and one temperature and frequency per row. Existing batch outputs require
1174
+ `-overwrite`. A failed batch can leave per-temperature files already written.
1175
+
1176
+ | Option | Default | Meaning |
1177
+ |---|---|---|
1178
+ | `-model` | Omitted | Model XYZ path, paired with `-trajectory` |
1179
+ | `-trajectory` | Omitted | GPUMD dump XYZ path, paired with `-model` |
1180
+ | `-prefix` | Required | Output prefix in single mode, plain material label in batch mode |
1181
+ | `-radius` | 1.25 Å | Site-core radius, positive and below half the O–T spacing |
1182
+ | `-min-frames` | 2 | Consecutive destination frames needed to confirm a hop, at least one |
1183
+ | `-max-frames` | Omitted | Limit the number of frames read, at least two when supplied |
1184
+ | `-backend` | `cpu` | SciPy cKDTree or `numpy` for batched analytic CPU assignment |
1185
+ | `-batch-frames` | 256 | Positive batch size for the NumPy backend |
1186
+ | `-no-iodine-align` | Off | Disable iodine-frame alignment for legacy comparisons |
1187
+ | `-overwrite` | Off | Allow replacing existing batch outputs |
1188
+
1189
+ Each option also accepts its double-dash spelling. Both backends use the CPU.
1190
+ The model must contain Li, I, and either Y or La, with an fcc iodine sublattice.
1191
+ The trajectory must preserve atom order and have evenly spaced, increasing
1192
+ `Time=` values in fs. Axis-aligned cubic cells may vary in volume.
1193
+
1194
+ Octahedral O sites are the ideal fcc cation positions. Tetrahedral T sites are
1195
+ the ideal interstices. Periodic nearest-site assignment uses the site cores.
1196
+ Iodine atoms are matched to ideal references in the model and tracked by atom
1197
+ identity. Each frame removes the median three-dimensional minimum-image iodine
1198
+ displacement from the Li coordinates. Reported site fractions are in that
1199
+ aligned frame.
1200
+
1201
+ A completed hop starts at a persistent O site and ends at another O site
1202
+ after the configured consecutive destination frames. T visits contribute only
1203
+ pathway evidence. The reported frequency is the number of confirmed
1204
+ nearest-neighbor O-to-O hops divided by the number of Li ions and the elapsed
1205
+ seconds from the first to the last saved frame. The unit is s⁻¹. Long or
1206
+ unresolved multihops are counted separately. A trajectory can miss brief T
1207
+ visits and recrossings between frames, so an O-to-O hop with no sampled T visit
1208
+ leaves its pathway unresolved.
1209
+
1210
+ The site-core and residence-time approach follows de Klerk et al.,
1211
+ *ACS Applied Energy Materials* **1**, 3230–3242 (2018), and Lavrinenko et al.
1212
+ (GEMDAT), *npj Computational Materials* **12**, 259 (2026).
1213
+ [DOI 10.1021/acsaem.8b00457](https://doi.org/10.1021/acsaem.8b00457)
1214
+ and [DOI 10.1038/s41524-026-02133-7](https://doi.org/10.1038/s41524-026-02133-7).
1215
+
1009
1216
  ## Plan GPUMD NVT production from Li MSD
1010
1217
 
1011
1218
  Run the predictor from a project directory containing completed GPUMD tasks.
@@ -7,6 +7,24 @@ materials design. Install `pymdkit` once and call its tools from anywhere as
7
7
  Commands expose explicit, documented CLI interfaces designed for reproducible shell,
8
8
  HPC, and AI-agent workflows, and each underlying script is still runnable on its own.
9
9
 
10
+ ## 1.7.6 release notes
11
+
12
+ - `pmk dope -ref ELEMENT ELEMENT` now optimizes minimum periodic separation
13
+ when used with `-sn` and `-on`; `-we vac -ref vac vac` optimizes vacancy sites.
14
+ - `-d` is removed. Legacy reference removal uses `--reference-cutoffs`.
15
+ - Optimized structures are validated after writing and accompanied by a ranked
16
+ `optimization-summary.txt`. Scientific data reuse replaces the radius table,
17
+ symmetry-expression evaluation and duplicated exact SI constants.
18
+
19
+ ## 1.7.5 release notes
20
+
21
+ - `pmk msd` reuses compatible full-trajectory or segment results, including
22
+ validated 1.7.4 WARNING results. Reused and newly calculated results contribute
23
+ to the same batch summaries after every directory succeeds.
24
+ - `pmk ionhop` analyzes completed Li octahedral-to-octahedral hops in
25
+ iodine-aligned GPUMD trajectories. It supports single and multi-temperature
26
+ runs with SciPy cKDTree and batched NumPy CPU assignment.
27
+
10
28
  ## 1.7.4 release notes
11
29
 
12
30
  - `pmk msd -ne` retains valid Einstein diffusion coefficients and conductivity
@@ -77,7 +95,7 @@ installed.
77
95
  On a machine with Internet access, run:
78
96
 
79
97
  ```bash
80
- python -m pip download pymdkit==1.7.4 -d pymdkit-offline
98
+ python -m pip download pymdkit==1.7.6 -d pymdkit-offline
81
99
  ```
82
100
 
83
101
  This downloads `pymdkit` and the dependencies resolved by pip into the
@@ -85,14 +103,14 @@ This downloads `pymdkit` and the dependencies resolved by pip into the
85
103
  system. Then, inside the target pymdkit Python or conda environment, run:
86
104
 
87
105
  ```bash
88
- python -m pip install --no-index --find-links=pymdkit-offline pymdkit==1.7.4
106
+ python -m pip install --no-index --find-links=pymdkit-offline pymdkit==1.7.6
89
107
  ```
90
108
 
91
109
  For optional GPU use, prepare the bundle on a networked machine compatible with
92
110
  the target HPC platform and Python environment:
93
111
 
94
112
  ```bash
95
- python -m pip download "pymdkit[gpu-cuda12]==1.7.4" -d pymdkit-offline
113
+ python -m pip download "pymdkit[gpu-cuda12]==1.7.6" -d pymdkit-offline
96
114
  ```
97
115
 
98
116
  Transfer the whole `pymdkit-offline` directory, then install from it on the
@@ -100,7 +118,7 @@ target system:
100
118
 
101
119
  ```bash
102
120
  python -m pip install --no-index --find-links=pymdkit-offline \
103
- "pymdkit[gpu-cuda12]==1.7.4"
121
+ "pymdkit[gpu-cuda12]==1.7.6"
104
122
  ```
105
123
 
106
124
  This GPU bundle includes the optional `cupy-cuda12x` package. Its wheels must also
@@ -183,6 +201,7 @@ preserve occupancy, oxidation, symmetry, and Wyckoff metadata.
183
201
  | `gpumd-job` | Create supercell, temperature, potential, input, and grouped GPUMD jobs |
184
202
  | `pred-msd-time` | Predict Li conductivity, diffusion and NVT production durations from GPUMD MSD |
185
203
  | `gpumd-out` | Export GPUMD thermo/MSD results or gather final structures |
204
+ | `ionhop` | Count completed Li site hops and report nearest-neighbor hop frequencies from GPUMD trajectories |
186
205
  | `mp-chemsys` | Download stable Materials Project structures for a chemical system |
187
206
  | `nep-rmse` | Compute NEP energy/force/stress RMSE and select candidates |
188
207
  | `perturb` | Generate perturbed structures with dpdata |
@@ -533,7 +552,7 @@ the strict `-max-ehull` filter using `ehull.txt` by default. All modes use
533
552
  ### Doping structures
534
553
 
535
554
  ```text
536
- pmk dope -i FILE -se SELECTOR... [-sn NUMBER...] -we ELEMENT|none... [-wn NUMBER...] [-on NUMBER] [-ref SELECTOR...] [-d DISTANCE...] [-o DIR | -output-folder DIR] [-output-format FORMAT] [-seed INTEGER]
555
+ 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]
537
556
  ```
538
557
 
539
558
  `dope` replaces `substitute` and preserves its validation,
@@ -542,6 +561,105 @@ Random mode defaults to `<input-stem>_dope/`; reference-distance mode defaults
542
561
  to `<input-stem>_dope.cif`. Execution details are written to `dope.log`. The
543
562
  standalone `substitute` command is removed.
544
563
 
564
+ ### Automatic separation in 1.7.6
565
+
566
+ ```powershell
567
+ pmk dope -i LiI-333.vasp -se Li -sn 18 -we Cu -on 100 -o Li90Cu18I108 -ref Cu Cu -seed 42
568
+ pmk dope -i LiI-333.vasp -se Li -sn 18 -we vac -on 100 -o Li90I108 -ref vac vac -seed 42
569
+ ```
570
+
571
+ With `-sn` and `-on`, an identical reference pair enables automatic max–min
572
+ optimization. One selector and one replacement species are supported, including
573
+ `-we Na -ref Na Na`; mixed references are rejected. Without `-ref`, ordinary
574
+ random substitution/removal is unchanged. `vac` is canonical; `none` is deprecated.
575
+ The primary score is the minimum periodic pair distance, including fixed preexisting
576
+ replacement atoms. Vacancy geometry uses original removed-site coordinates.
577
+
578
+ Small spaces (at most 2,000 combinations) are enumerated exactly. Larger spaces use
579
+ seeded randomized farthest insertion and one-site exchanges. Default restart budget:
580
+ `max(4 * outputs, 8 * ceil(eligible / selected))`; at most `2 * selected` sweeps per
581
+ restart, stopping earlier when no improvement is found. Internal `optimize_sites`
582
+ keyword budgets support controlled validation. Initial and optimized candidates are
583
+ pooled, deduplicated by original indices, then ranked by minimum distance, mean
584
+ nearest-neighbor distance and mean pair distance. Scores rounded to 10 decimal places
585
+ resolve numerical ties; overlap diversity and index order break ties. No secondary
586
+ score can override a primary difference larger than that numerical tolerance.
587
+
588
+ `-on 100` returns the best 100 distinct configurations found, not necessarily global
589
+ optima or symmetry-inequivalent structures. Insufficient combinations or exhausted
590
+ budgets report actual counts and termination. Distance-matrix memory is quadratic in
591
+ eligible plus fixed sites. Identical input, seed, arguments and dependency versions
592
+ reproduce selections. Both doping and vacancy operations share this engine.
593
+
594
+ Default filenames remain `<input-stem>_r1.cif`, etc., in `<input-stem>_dope/` or `-o`.
595
+ Optimized CIFs use P1 to preserve the original cell and fractional coordinates;
596
+ VASP output keeps existing species grouping. Every optimized structure is reloaded
597
+ and checked for composition, lattice metric, retained positions and separation.
598
+ `optimization-summary.txt` is tab-separated with JSON metadata in a comment. It
599
+ contains filename, minimum and mean NN distances (Angstrom), packing diagnostic,
600
+ ratio, zero-based original indices and fractional coordinates. Metadata includes seed,
601
+ counts, fixed sites, budgets, method, termination and best/worst/median separation.
602
+
603
+ Optional exact certification runs **after** the same heuristic search:
604
+
605
+ ```text
606
+ pmk dope -i LiI-333.vasp -se Li -sn 18 -we Cu -on 100 -o Li90Cu18I108 -ref Cu Cu --certify-optimum
607
+ 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
608
+ ```
609
+
610
+ `--certify-time-limit` must be finite and positive and requires `--certify-optimum`.
611
+ Its default is 120 seconds for the entire certification stage; it does not change
612
+ the heuristic budget. Certification requires the automatic `-sn/-on/-ref` mode.
613
+ Small enumerated spaces reuse their proof without invoking a solver. Otherwise
614
+ SciPy's `optimize.milp` (SciPy >= 1.9, bundled HiGHS) tests sparse conflict graphs:
615
+ binary x_i selects a site, sum(x_i)=K, and x_i+x_j<=1 when d_ij<t. Candidate sites
616
+ too close to fixed dopants are disabled; conflicting fixed pairs make t infeasible.
617
+ Binary search over discrete periodic distance levels finds the largest feasible
618
+ threshold. A validated configuration plus proof that the next level is infeasible
619
+ (or exhaustion of all levels) certifies the global max-min distance.
620
+
621
+ All distinct float64 distance levels are retained without rounding or grouping.
622
+ Conflicts use strict d<t; returned configurations must satisfy d>=t with no distance
623
+ relaxation. Binary variables are checked within 1e-6 of 0 or 1. This conservative
624
+ policy may require extra solves for nearly identical distances. Proofs refer to
625
+ the computed geometry subject to HiGHS numerical tolerances, not exact arithmetic.
626
+ The packing diagnostic is not used to prune the proof search.
627
+
628
+ `optimality-certificate.json` records input, species, site indices, seed, solver
629
+ and SciPy version, distance policy, per-threshold outcomes, runtime, bounds and
630
+ saved-structure classifications. `CERTIFIED_OPTIMAL` means the proof completed;
631
+ `IMPROVED_NOT_CERTIFIED` means a validated improvement was retained without proof;
632
+ `NOT_CERTIFIED` means no proof or improvement was obtained. Timeouts and solver
633
+ failures retain valid candidates and never imply infeasibility. Invalid returned
634
+ incumbents are errors. Missing MILP support is reported without losing heuristic
635
+ outputs. Valid solver discoveries enter the existing pool before ranking.
636
+
637
+ The certificate distinguishes the optimum from the number of generated structures
638
+ attaining it; `-on 100` does not imply 100 optimal or symmetry-inequivalent structures.
639
+ Default runs do not import or execute certification code or create this report.
640
+ Geometric separation optimality does not establish energetic or thermodynamic stability.
641
+
642
+ The equal-sphere packing diagnostic is
643
+ `D_upper = (6 * (pi / sqrt(18)) * V / (N * pi)) ** (1/3)`, with total objective-site
644
+ count N including fixed dopants. It is a geometric restriction, not an attainable-site
645
+ promise or proof of heuristic optimality. Physical radii are irrelevant. If the
646
+ shortest self-image lattice translation is smaller than this value, the formula need
647
+ not bound the distinct-site objective: metadata marks it inapplicable and the ratio
648
+ is `nan`. No arbitrary physical cutoff is imposed.
649
+
650
+ `-d`/`-distance` is removed and reports migration guidance. Legacy reference removal
651
+ is selected only when both `-sn` and `-on` are absent:
652
+
653
+ ```powershell
654
+ pmk dope -i input.cif -se Li -we vac -ref La Ta --reference-cutoffs 1.01 1.02
655
+ ```
656
+
657
+ Cutoffs remain Angstrom, one per reference. Omitting them preserves
658
+ `0.7 * (Cordero covalent radius sum)`, sourced from ASE for H through Cm; missing
659
+ radii require an explicit cutoff. Output remains `<input-stem>_dope.cif` in the
660
+ invocation directory. `--reference-cutoffs` is rejected in automatic mode.
661
+ Execution logging remains in `dope.log`.
662
+
545
663
  ### Breaking changes in v1.7.0
546
664
 
547
665
  - `gpumd-thermo` and `gpumd-msd` are replaced by `gpumd-out -thermo` and
@@ -875,8 +993,27 @@ settings, selection, and sensitivity. Beta-qualified window sensitivity,
875
993
  all-valid-candidate sensitivity, and three-segment slope spread are reported
876
994
  separately. Segments and MSD time origins are correlated. Window-to-window spread
877
995
  measures sensitivity. Formal statistical uncertainty requires an explicit
878
- request. Move an existing `msd` directory aside before repeating a calculation.
879
- Temporary coordinate storage is removed when the calculation ends.
996
+ request. Temporary coordinate storage is removed when the calculation ends.
997
+
998
+ When the result directory is absent, `pmk msd` calculates it. When a compatible
999
+ result already exists, the command reuses its full-precision coefficients and
1000
+ quality without reading trajectory coordinates or changing the saved result
1001
+ files. It checks version-1 provenance, input and output sizes and modification
1002
+ times, grouping method 0, atom counts, run cadence, fit settings, selected
1003
+ window, and diagnostic and coefficient totals. With `-ne` it also checks the
1004
+ charge and thermodynamic inputs and recomputes the stored conductivity from
1005
+ full-precision D, temperature, volume, and ion count. Primary 1.7.4 results
1006
+ can be reused when diagnostics establish compatibility, including the effective
1007
+ lag bounds for a manual window. Missing provenance, stale files, incomplete
1008
+ outputs, incompatible settings, and REJECT results cause an error and leave the
1009
+ result directory intact. Move that directory aside before recalculating.
1010
+
1011
+ With `--uncertainty covariance`, reuse also requires the original uncertainty
1012
+ settings, output fingerprints, and matching input hashes and paths. Older
1013
+ results without those settings or fingerprints require recalculation for an
1014
+ uncertainty request. The existing full-run NE covariance fallback can reuse
1015
+ nominal temperature when `thermo.out` was unavailable. Ordinary NE and range
1016
+ NE still require `thermo.out`.
880
1017
 
881
1018
  The five-column raw MSD is published immediately after FFT succeeds, before
882
1019
  window search, optional uncertainty, or thermodynamic/NE processing. Later errors
@@ -943,15 +1080,18 @@ original inputs/results before and after, regenerates missing diagnostics,
943
1080
  reads the original trajectory and removes temporary coordinates. Normal tests
944
1081
  do not require this external dataset.
945
1082
 
946
- After every eligible calculation succeeds, root-level `self-diff-total.txt` and,
1083
+ After every directory is calculated or validated for reuse, root-level `self-diff-total.txt` and,
947
1084
  with `-ne`, `sigma-total.txt` summarize directory, temperature (K), and the
948
1085
  isotropic total D (cm²/s, `%.2e`) or conductivity (mS/cm, `%.2f`). Rows use
949
1086
  relative paths and sort by numeric temperature, then path. Summaries use internal
950
1087
  unrounded totals. NE uses measured mean production temperature; without NE a
951
1088
  single stationary production NVT target is required (ramps, multiple targets and
952
- missing NVT targets produce an explicit error). Genuine calculation failures return
953
- nonzero and preserve previous summaries; skipped templates are not failures.
954
- A successful run without `-ne` removes any stale root `sigma-total.txt`.
1089
+ missing NVT targets produce an explicit error). Calculation or validation
1090
+ failures return nonzero and preserve previous summaries. Unresolved templates
1091
+ are skipped. A successful run without `-ne` can reuse diffusion from a
1092
+ compatible previous NE result and removes any stale root `sigma-total.txt`.
1093
+ Range runs reuse only the matching segment result and publish totals under
1094
+ `root/msd/segments/START-ENDns/`, separately from full-trajectory root summaries.
955
1095
  The companion `msd-quality-total.txt` retains each directory's PASS/WARNING
956
1096
  status. In NE mode, a directory whose valid coefficients were retained despite
957
1097
  fit-quality rejection appears as WARNING and contributes to both numeric
@@ -977,6 +1117,72 @@ Nernst–Einstein conductivity uses self-diffusion and neglects distinct-ion cro
977
1117
  correlations. It is not generally equal to experimental conductivity. The existing
978
1118
  `gpumd-out -msd` workflow is unchanged.
979
1119
 
1120
+ ## Count Li site hops in GPUMD trajectories
1121
+
1122
+ ```bash
1123
+ pmk ionhop -model model.xyz -trajectory dump.xyz -prefix Li4YI7_300K
1124
+ pmk ionhop -prefix LiYI7
1125
+ ```
1126
+
1127
+ Supply both paths for single mode. It writes `<prefix>_sites.csv`,
1128
+ `<prefix>_jumps.csv`, and `<prefix>_summary.json`. The sites CSV lists the
1129
+ one-based site IDs, fractional coordinates, O/T type, and initial occupancy.
1130
+ The jumps CSV records the Li atom and site IDs, arrival and confirmation times
1131
+ in ps, displacement in Å, hop class, and sampled tetrahedral evidence.
1132
+ The JSON includes counts, site-link statistics, initial occupancy, iodine
1133
+ alignment, mean displacement, sampling and processing timings, and method
1134
+ limitations.
1135
+
1136
+ With both paths omitted, batch mode looks for immediate integer-temperature
1137
+ subdirectories with `model.xyz` and `dump.xyz`. It warns about incomplete
1138
+ directories, rejects duplicate integer temperatures, and processes complete
1139
+ directories in numeric order. Use a plain prefix such as `LiYI7` to write
1140
+ `LiYI7_300K_sites.csv`, `LiYI7_300K_jumps.csv`, and
1141
+ `LiYI7_300K_summary.json` inside `300/`. After every trajectory succeeds it
1142
+ atomically publishes root `hop_freq.txt`, with header `Temp(K) Hop_freq(s-1)`
1143
+ and one temperature and frequency per row. Existing batch outputs require
1144
+ `-overwrite`. A failed batch can leave per-temperature files already written.
1145
+
1146
+ | Option | Default | Meaning |
1147
+ |---|---|---|
1148
+ | `-model` | Omitted | Model XYZ path, paired with `-trajectory` |
1149
+ | `-trajectory` | Omitted | GPUMD dump XYZ path, paired with `-model` |
1150
+ | `-prefix` | Required | Output prefix in single mode, plain material label in batch mode |
1151
+ | `-radius` | 1.25 Å | Site-core radius, positive and below half the O–T spacing |
1152
+ | `-min-frames` | 2 | Consecutive destination frames needed to confirm a hop, at least one |
1153
+ | `-max-frames` | Omitted | Limit the number of frames read, at least two when supplied |
1154
+ | `-backend` | `cpu` | SciPy cKDTree or `numpy` for batched analytic CPU assignment |
1155
+ | `-batch-frames` | 256 | Positive batch size for the NumPy backend |
1156
+ | `-no-iodine-align` | Off | Disable iodine-frame alignment for legacy comparisons |
1157
+ | `-overwrite` | Off | Allow replacing existing batch outputs |
1158
+
1159
+ Each option also accepts its double-dash spelling. Both backends use the CPU.
1160
+ The model must contain Li, I, and either Y or La, with an fcc iodine sublattice.
1161
+ The trajectory must preserve atom order and have evenly spaced, increasing
1162
+ `Time=` values in fs. Axis-aligned cubic cells may vary in volume.
1163
+
1164
+ Octahedral O sites are the ideal fcc cation positions. Tetrahedral T sites are
1165
+ the ideal interstices. Periodic nearest-site assignment uses the site cores.
1166
+ Iodine atoms are matched to ideal references in the model and tracked by atom
1167
+ identity. Each frame removes the median three-dimensional minimum-image iodine
1168
+ displacement from the Li coordinates. Reported site fractions are in that
1169
+ aligned frame.
1170
+
1171
+ A completed hop starts at a persistent O site and ends at another O site
1172
+ after the configured consecutive destination frames. T visits contribute only
1173
+ pathway evidence. The reported frequency is the number of confirmed
1174
+ nearest-neighbor O-to-O hops divided by the number of Li ions and the elapsed
1175
+ seconds from the first to the last saved frame. The unit is s⁻¹. Long or
1176
+ unresolved multihops are counted separately. A trajectory can miss brief T
1177
+ visits and recrossings between frames, so an O-to-O hop with no sampled T visit
1178
+ leaves its pathway unresolved.
1179
+
1180
+ The site-core and residence-time approach follows de Klerk et al.,
1181
+ *ACS Applied Energy Materials* **1**, 3230–3242 (2018), and Lavrinenko et al.
1182
+ (GEMDAT), *npj Computational Materials* **12**, 259 (2026).
1183
+ [DOI 10.1021/acsaem.8b00457](https://doi.org/10.1021/acsaem.8b00457)
1184
+ and [DOI 10.1038/s41524-026-02133-7](https://doi.org/10.1038/s41524-026-02133-7).
1185
+
980
1186
  ## Plan GPUMD NVT production from Li MSD
981
1187
 
982
1188
  Run the predictor from a project directory containing completed GPUMD tasks.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pymdkit"
7
- version = "1.7.4"
7
+ version = "1.7.6"
8
8
  description = "A Python command-line toolkit for high-throughput atomistic workflows in AI-driven materials design."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -25,6 +25,7 @@ classifiers = [
25
25
  # individual commands, so the dispatcher and pmk -help stay fast.
26
26
  dependencies = [
27
27
  "numpy",
28
+ "scipy",
28
29
  "ase",
29
30
  "pymatgen",
30
31
  "mp-api",