Skip to content

Support random vacancies with fixed-lattice SED references - #108

Merged
Tingliangstu merged 2 commits into
codex/pysed-3.0-architecturefrom
codex/pysed-random-vacancies
Nov 9, 2026
Merged

Tingliangstu merged 2 commits into
codex/pysed-3.0-architecturefrom
codex/pysed-random-vacancies

Conversation

@Tingliangstu

@Tingliangstu Tingliangstu commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Static vacancies can now be generated and processed against pySED's complete fixed reference lattice. A trajectory contains only surviving atoms; the four-column basis.in keeps every reference site, and the optional defect_index_file maps each site to a one-based trajectory index (0 means vacant).

  • Add remove_vacancies(element, fraction, seed) and a defect_index.in writer. GPUMD and LAMMPS structures retain the surviving atom order.
  • Pair occupied velocities with their original cell phases on CPU and GPU, without a zero-padded velocity array. Preserve fixed-reference construction, 3.0 normalization, frequency folding, and ordinary-system behavior.
  • Validate complete, unique mappings and report actual per-element vacancy fractions only when the mapping is enabled.
  • Document generation, input numbering, reader order, and the static-vacancy scope.

Validation:

  • WSL pysed: 150 tests and 433 subtests passed, with CPU affinity restricted to one CPU and native threads limited to one.
  • Small fixtures cover independent per-atom FFT comparisons, absent cells/basis sites, reordered atoms, CPU/GPU results, and GPUMD/LAMMPS direct and cached reads.
  • Fixed-reference tests cover the production box after NPT, orthogonal/triclinic cells, and upper/lower triangular expansions.
  • Native Windows vacancy tests: 6 passed; the GPU test was skipped because CuPy is unavailable in that environment. The path assertion compares file identity, including Windows short/long path aliases.
  • Strict Sphinx HTML build and git diff --check passed.

Known baseline CI issue: the existing Windows progress-byte-count test (test_progress_offsets_and_partial_final_batch) fails with 264 versus 256 bytes on the unchanged 3.0 base. This PR leaves that unrelated test unchanged.

Only code, documentation, and tests are included. Trajectories, calculated spectra, and generated images are excluded.

@Tingliangstu

Copy link
Copy Markdown
Collaborator Author

Related to #105 and #58.

@994336637 Thanks for your contribution in #105. I have implemented static-vacancy support for pySED 3.0 in this PR, addressing the vacancy/atom-count issue raised in #58.

The workflow keeps the complete four-column basis.in and uses defect_index.in to map surviving trajectory atoms to their original reference sites. Vacancies are skipped directly, retaining the fixed parent lattice and 3.0 normalization.

Could you try the codex/pysed-random-vacancies branch with your vacancy systems and share any issues or feedback on the spectra? The generation example and mapping instructions are included.

This implementation is ready for testing but not yet merged. Substitutional mass disorder from #105 remains a separate feature.

@Tingliangstu
Tingliangstu merged commit 1e78373 into codex/pysed-3.0-architecture Nov 9, 2026
10 of 16 checks passed
@Tingliangstu
Tingliangstu deleted the codex/pysed-random-vacancies branch November 9, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant