FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support binary LCAO wavefunction input by goodchong · Pull Request #7863 · deepmodeling/abacus-develop · GitHub

Support binary LCAO wavefunction input - #7863

Open
goodchong wants to merge 4 commits into
deepmodeling:developfrom
goodchong:codex/lcao-binary-wfc-read
Open

Support binary LCAO wavefunction input#7863
goodchong wants to merge 4 commits into
deepmodeling:developfrom
goodchong:codex/lcao-binary-wfc-read

Conversation

goodchong commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator

Summary

  • replace read_wfc_lcao with an explicit two-value init_wfc syntax: init_wfc file txt and init_wfc file binary
  • keep the existing init_wfc method field internally while storing the normalized file format separately, so existing PW, LCAO, TDDFT, LR, and EXX flow checks remain stable
  • retain the legacy one-value init_wfc file input for backward compatibility (LCAO defaults to text, PW defaults to binary) while canonicalizing INPUT.info to the explicit two-value form
  • read the native out_wfc_lcao 2 layout for Gamma-only and multi-k calculations, including type conversion and file/index/dimension validation
  • generate binary fixtures at test runtime with the existing writer and cover double, float, complex, skipped bands, mismatched formats, truncated input, and existing text input

Input behavior

  • LCAO accepts init_wfc file txt and init_wfc file binary.
  • PW accepts init_wfc file binary and rejects init_wfc file txt because no PW text reader exists.
  • The selected format is used directly, with no automatic detection or fallback.
  • User documentation and CLI help show only the explicit two-value file syntax.

Binary compatibility

The reader intentionally follows the existing native int/double writer protocol. It does not add magic/version fields or cross-ABI, cross-endian compatibility, and it does not read files accumulated with out_app_flag.

Verification

  • cmake --build build -j2 (full serial build passed)
  • OMP_NUM_THREADS=1 ctest --test-dir /tmp/abacus_wfc_binary_mpi_mpicxx --output-on-failure -R '^(MODULE_IO_read_item_serial|MODULE_IO_write_wfc_nao|MODULE_IO_write_wfc_nao_para|MODULE_IO_read_wfc_nao_test|MODULE_IO_read_wfc_nao_test_parallel)$' (5/5 passed, including 2-rank MPI outside the restricted sandbox)
  • OMP_NUM_THREADS=1 two-stage end-to-end runs passed for text Gamma, binary Gamma, and binary 8-k-point LCAO wavefunctions; source/readback energies differed by at most 5.5e-13 eV
  • legacy one-value LCAO input read the text file successfully and wrote init_wfc file txt to INPUT.info
  • OMP_NUM_THREADS=1 ./build/abacus_basic_omp --check-input: PW file binary passed; PW file txt failed with the expected unsupported-format error
  • ./build/abacus_basic_omp -h init_wfc: only the explicit file txt and file binary forms are documented
  • ./build/abacus_basic_omp -h read_wfc_lcao: returned Unknown parameter
  • regenerated docs/parameters.yaml and docs/advanced/input_files/input-main.md; a fresh YAML generation matched byte-for-byte
  • git diff --check
  • python3 tools/03_code_analysis/agent_governance_check.py --staged (no findings)

#6206

mohanchen added Refactor Refactor ABACUS codes Input&Output Suitable for coders without knowing too many DFT details labels Aug 26, 2026
mohanchen self-requested a review August 29, 2026 02:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL