Repository navigation
Unify ionic-step header keyword, cube channel suffixes, and Vxc(R) sparse output filename in IO outputs #8293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mohanchen
wants to merge
126
commits into
deepmodeling:develop
Choose a base branch
from
mohanchen:2026-11-05-a
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+13,264
−4,192
Open
Changes from all commits
Commits
Show all changes
126 commits
Select commit
Hold shift + click to select a range
f9b5a27
update INPUT file
2535321
fix(bands): add BANDS/ subdirectory and per-step filename suffix for …
17a6862
Unify ionic step label to "Ionic_Step" across all output files.
d4c3c69
Unify IONIC STEP to Ionic_Step in WFC and band output headers.
4038796
unify ionic step header keyword to Ionic_Step in DOS/eig_occ/HS outputs
f2f3394
Fix hs_dense_io test assertions for Ionic_Step keyword sync.
411b16e
unify CSR sparse-matrix step header from "STEP: N" to "Ionic_Step N"
cd6a9c3
Unify "# istep:" to "# Ionic_Step" in PDOS text output.
91465ba
sync test reference headers with Ionic_Step keyword in HS matrix outputs
ffbb420
Correct out_mat_r output filename documentation
1cdac73
refactor(io): disambiguate cube channel suffixes from real spin indices
6343111
Rename Vxc(R) sparse output to vxcrs{spin}_nao.csr
6703379
sync remaining .ref fixtures with Ionic_Step keyword
8ba451b
fix(ASE): accept Ionic_Step header when counting eig_occ frames
1021fac
fix(io): pass band output directory explicitly to write_bands
d04111e
fix(test): make hsr_writer tests MPI-safe for multi-rank launches
3b770f5
fix(io): rename MO-basis Vxc matrix to vxcmo to avoid vxck collision
574e84f
fix(io): make out_mat_xc2 a final-step snapshot without g suffix
384e1cd
fix(io): write spin-independent H terms once with correct spin labels
cde869f
fix(io): add one-based Ionic_Step marker to Lx/Ly/Lz matrix output
97dd337
fix(io): honor out_app_flag for mulliken.txt output
568b530
fix(io): honor out_app_flag and out_freq_ion for eig_occ.txt
8b1a7b0
fix(io): write band outputs on the out_freq_ion rhythm
43d2d80
fix(io): write eband outputs on the out_freq_ion rhythm
73700fb
fix(io): number projected-band XML files per step and annotate the frame
81e8740
fix(io): route xc(r) cubes through CHG/ and out_app_flag
3a5ee91
fix(io): unify scalar-text ionic-step markers as "# Ionic_Step N"
ef9764d
fix(io): use the bare "Ionic_Step N" marker for CSR and real-space ma…
d3d466f
docs(example): align relax/output INPUT comments with actual products
5f47ede
fix(io): add spin and step suffixes to the k-space dH matrix names
af89f99
fix(io): report the real ionic step in the LDOS cube header
6d491af
fix(io): write a valid cube header for the out_xc_r files
0b26605
docs(input): describe the final-snapshot and cube-header behaviour
274a4dd
fix(io): report the real ionic step in the partial-charge cube header
d11ec9b
fix(io): report the real ionic step in the PW LDOS / STM cube headers
0e8c42d
fix(test): align MO-basis Vxc references with 1-based ionic step
af5a0e6
docs(example): document output layout convention for out_app_flag modes
2504a57
Merge remote-tracking branch 'upstream/develop' into pr-8293
32d97c3
fix(io): match Libxc mixed-derivative labels to packing order
004ce71
test(io): pin sparse writer truncation for final-snapshot outputs
c72ee57
fix(ase): discover eig_occ files for all out_app_flag modes
e041630
refactor(io): pass out_app_flag to nscf_bands explicitly
58874b0
fix(io): correct v4rho3sigma channel labels
7eb3518
fix(io): append MO Vxc matrices in mode 1
1e33947
test(io): capture process rank once in hsr writer tests
48a6638
test(io): cover mode-2 band snapshots in BANDS/
6b2df07
test(io): write eig_occ test files to testing::TempDir()
a02332e
test(io): write sparse H/S test file to testing::TempDir()
f7cf5ff
docs(input): document band, Vxc and xc_r output naming
b7b69aa
fix(io): make dS/dR sparse output spin-independent
068fa11
refactor(io): drop spin suffix from dS/dR sparse output names
b9b0d63
refactor(io): write dH/dR and dS/dR in the H(R)/S(R) CSR layout
42b8493
refactor(io): split r(R) sparse output into per-axis CSR files
c1ff9a6
feat(io): align tr_nao.csr with the self-describing CSR layout
bfbe07d
feat(io): write angular-momentum matrices in the self-describing CSR …
a0286ce
feat(io): add per-frame provenance headers to ionic-step outputs
156abc0
Align H(k)/S(k) text output format with write_dmk
1f93a72
Fix text hk filename k-index and prefix
dac4928
Update integration-test refs for new H(k)/S(k) text format
c0c8b83
S(k) filename: drop redundant spin suffix
38ff398
Fix ibz_ik formula for symmetry-reduced k-point lists
fac73df
Align T(k) text output format with write_dmk / write_hsk
b4c7c5c
Align Hamiltonian-term H(k) text output with write_dmk / write_hsk
1500cec
Align Vxc(R) CSR output with the H(R) CSR layout
bab7046
Unify running-log file-written notices
e03e819
Announce remaining LCAO output files in running log
3c48904
Announce structural and run-metadata files in running log
5eefe27
Fix running-log banners, units and cube descriptors
9405813
Write the NAO orbital table once per run
5d82d7d
Drop the duplicated H(k)/S(k) banner
7a482d0
Wrap the skipped-autoset warning across several log lines
7f144c8
fix(ase): align eig_occ frames by Ionic_Step ID
a523997
docs(example): refresh output comments in 04_relax_with_output_lcao I…
2c0c585
fix(io): align H(k)/T(k) naming and dense text output contract
059e7a4
chore(io): clean reference whitespace and lock T(k) naming
ec61879
test(io): cover dense H(k) text output and isolate dS/dR artifacts
5593726
CI: add paths-ignore to non-required-check workflows
8ae5f75
test(io): parse DOS grid size past the provenance header
05c92b8
fix(io): report H(R) term output only after a successful write
fd0172d
fix(io): write H(k)/S(k) text bodies in row-major order
a71f4dd
fix(io): truncate H(k) term files at the first ionic step
3fb10d7
refactor(io): pass rank and log handles explicitly to cut global use
181541f
fix(ase): never fall back to a stale eig_occ.txt for announced runs
e904c7e
chore(io): trim header includes and align output docs with tests
87fb942
test(io): cover the Vxc(MO) text append contract
92fa197
test(io): smoke-test the Angmom_op CSR assembly path
340c1b5
test(io): assert Angmom_op CSR values against the L kernels
b66485a
docs(io): document vxc matrix naming and gate README-only PRs
c122448
Merge remote-tracking branch 'upstream/develop' into 2026-11-05-a
930cecf
fix(io): adapt local writers to the Parallel_Blkcyclic rename
f81a490
test(io): decouple band dir from the global one and assert shifted sp…
a20dd89
test(ase): cover the legacy ionic step marker in eig_occ parsing
9ba3cba
refactor(io): extract libxc cube channel suffixes and test them
1d075de
refactor(io): centralize the per-step frame append decision
60e23fe
fix(io): stop emitting transposed T(k) and DM(k) text bodies
d46e01e
fix(io): make DM(k) reading match the written format
f13a927
feat(io): restart LCAO from DM(k) with streaming reads
4ea3390
fix(io): always persist the final ionic step output
af5783b
refactor(io): unify CSR text headers and skip empty R blocks
12436a8
refactor(io): use the shared CSR header for S(R) output
44a063a
refactor(io): centralize sparse R-space file naming
d5a01e9
docs(input): state that CSR outputs omit empty R blocks
8f8ed40
fix(pw): resolve EXX source files in the mode-2 output layout
1253c5a
docs(pw): describe EXX source file discovery for hybrid NSCF
51bf49c
refactor(io): use out_freq_ion as the only output cadence
d0de95b
fix(io): reject out_mat_l with nspin=4 during input parsing
69ba37a
refactor(io): share the CSR banner between sparse writers and HContainer
74696ac
perf(io): skip row-wise reductions for empty CSR blocks
7f0241e
fix(io): pass real istep to write_Vxc_LIP so # Ionic_Step is 1-based
cdf5bcb
fix(io): reject non-positive text precision for out_hsk/out_dmk/out_m…
ab851cf
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
315ac2a
docs(input): correct out_mat_xc description for lcao_in_pw output dir…
2024e74
test(io): cover stale-frame truncation and payload in Vxc(MO) append …
8497763
fix(esolver): create MAT/ before output_SR in get_s mode-2 runs
3f19a7b
fix(io): validate stored k coordinates in read_dmk
db517ba
fix(lcao): broadcast DMR presence decision in init_chg_dm
0f805b6
test(io): use TempDir and assert stream opens in empty-CSR test
f70f501
test(io): replace default basis argument with PW convenience overload
8ee1ccc
test(io): rename dH/dk outputs to dhkK<dir>_iaN and update refs
cc268b1
fix(io): reject non-finite DM(k) restart values
2987444
docs(io): document DM(k) conj-first element convention
d07665a
test(ref): sync CSR refs with case-input R counts after hs_sparse_io …
eaa182d
fix(dmk): propagate UnitCell parse failures instead of misreading coo…
f5772dc
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
62dc5d0
fix(dmk): broadcast read status on descriptor communicator
1155916
docs(input): clarify out_xc_r cube file naming channels
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: README metadata | ||
|
|
||
| # pytest.yml ignores docs and markdown-only changes, which also skips | ||
| # README edits even though the Python packages declare those files as | ||
| # their package readme. Keep a lightweight check on that path. | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '**/README.md' | ||
| - '**/pyproject.toml' | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| metadata: | ||
| name: Package readme metadata | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7.0.1 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: 3.8 | ||
| - name: Validate readme declarations | ||
| run: | | ||
| python - <<'EOF' | ||
| import pathlib | ||
| import re | ||
| import sys | ||
|
|
||
| failures = [] | ||
| for pyproject in sorted(pathlib.Path(".").rglob("pyproject.toml")): | ||
| text = pyproject.read_text(encoding="utf-8") | ||
| match = re.search(r'^\s*readme\s*=\s*["\']([^"\']+)["\']', text, re.M) | ||
| if match is None: | ||
| continue | ||
| readme = pyproject.parent / match.group(1) | ||
| if not readme.is_file(): | ||
| failures.append(f"{pyproject}: declared readme {match.group(1)} does not exist") | ||
| elif readme.stat().st_size == 0: | ||
| failures.append(f"{pyproject}: declared readme {match.group(1)} is empty") | ||
| else: | ||
| print(f"ok: {pyproject} -> {match.group(1)}") | ||
|
|
||
| for failure in failures: | ||
| print(f"error: {failure}") | ||
| sys.exit(1 if failures else 0) | ||
| EOF |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,45 @@ | ||
| # Extracting Position Matrices | ||
|
|
||
| In ABACUS, we provide the INPUT keyword [out_mat_r](../input_files/input-main.md#out_mat_r) to write the position matrices into a file named `data-rR-tr` in the directory `OUT.${suffix}`. The position matrices is defined as: | ||
| In ABACUS, we provide the INPUT keyword [out_mat_r](../input_files/input-main.md#out_mat_r) to write the position matrices into three files, one per Cartesian component: `rrx_nao.csr`, `rry_nao.csr` and `rrz_nao.csr`. They are stored in the matrix output directory, which is `OUT.${suffix}` when [out_app_flag](../input_files/input-main.md#out_app_flag) is 0 or 1 and its `MAT/` subdirectory when out_app_flag is 2; in the latter case a `g${step}` index is inserted before `_nao.csr`, where `${step}` is the one-based ionic-step index. The position matrices are defined as: | ||
|
|
||
| $$\langle \chi_\mu|\hat{r}|\chi_\nu\rangle$$ | ||
|
|
||
| This functionality is not available for gamma_only calculations. If you want to use it in gamma_only calculations, you should turn off [gamma_only](../input_files/input-main.md#gamma_only), and explicitly specifies that gamma point is the only k point in the KPT file. | ||
|
|
||
| Each file or each section of the appended file starts with "STEP: " followed by the current ion/md step, then the second line starts with "Matrix Dimension of $r(R)$: " followed by the dimension of the matrix, and the third line starts with "Matrix number of $r(R)$: " followed by the matrix number. The rest of the format is arranged into blocks, such as: | ||
| Each file or each section of the appended file starts with an informative header: | ||
|
|
||
| ``` | ||
| -5 -5 -5 //R (lattice vector) | ||
| ... | ||
| -5 -5 -4 //R (lattice vector) | ||
| ... | ||
| -5 -5 -3 //R (lattice vector) | ||
| Ionic_Step 1 | ||
| # print r matrix in real space r(R) x-component | ||
| 1 # number of spin directions | ||
| 1 # spin index | ||
| 6 # number of localized basis | ||
| 9 # number of Bravais lattice vector R | ||
|
|
||
| user_defined_lattice | ||
| ... | ||
|
|
||
| #----------------------------------------------------------------------# | ||
| # CSR Format # | ||
| ... | ||
| #----------------------------------------------------------------------# | ||
| ``` | ||
|
|
||
| Each block here contains the matrix for the corresponding cell. There are three columns in each block, giving the matrix elements in x, y, z directions, respectively. There are altogether nbasis * nbasis lines in each block, which emulates the matrix elements. | ||
| The header records the ionic step, the matrix label and Cartesian component, the spin metadata, the number of localized basis functions and the number of non-empty Bravais lattice vectors actually written, followed by the `user_defined_lattice` cell block and the CSR format description. The rest of the file consists of one sparse block per non-empty Bravais lattice vector (an R vector is kept when at least one of the three Cartesian components has an element above the sparse threshold), such as: | ||
|
|
||
| In molecular dynamics (MD) calculations, the output frequency is controlled by [out_freq_ion](../input_files/input-main.md#out_freq_ion). With out_app_flag = 2, each written ionic step has its own file named `rrg${step}_nao.txt`, where `${step}` is the one-based ionic-step index; with out_app_flag = 0 or 1 the fixed name `rr_nao.txt` is reused (mode 0 truncates and overwrites it at every write, mode 1 appends one record per written step). The single-shot output of `calculation = get_s` is always named `rr_nao.txt`. The files are stored in `OUT.${suffix}` when [out_app_flag](../input_files/input-main.md#out_app_flag) is 0 or 1, and in its `MAT/` subdirectory when out_app_flag is 2. For example, if we are running a 10-step MD with out_freq_ion = 3 and out_app_flag = 2, the files are `MAT/rrg1_nao.txt`, `MAT/rrg4_nao.txt`, `MAT/rrg7_nao.txt`, and `MAT/rrg10_nao.txt`. | ||
| ``` | ||
| -5 -5 -5 12 // R (lattice vector) and number of non-zero elements | ||
| # CSR values | ||
| ... | ||
| # CSR column indices | ||
| ... | ||
| # CSR row pointers | ||
| ... | ||
| ``` | ||
|
|
||
| Values wrap every six entries and column indices every sixteen entries. Only Bravais lattice vectors for which at least one of the three components has a non-zero element are written; a component that is empty for a given `R` is still recorded as a valid zero block, so the three files share the same sequence of `R` blocks. | ||
|
|
||
| In molecular dynamics (MD) calculations, the output frequency is controlled by [out_freq_ion](../input_files/input-main.md#out_freq_ion). With out_app_flag = 2, each written ionic step has its own files named `rrxg${step}_nao.csr`, `rryg${step}_nao.csr` and `rrzg${step}_nao.csr`, where `${step}` is the one-based ionic-step index; with out_app_flag = 0 or 1 the fixed names `rrx_nao.csr`, `rry_nao.csr` and `rrz_nao.csr` are reused (mode 0 truncates and overwrites them at every write, mode 1 appends one record per written step). The single-shot output of `calculation = get_s` is always written to the fixed names. For example, if we are running a 10-step MD with out_freq_ion = 3 and out_app_flag = 2, the x-component files are `MAT/rrxg1_nao.csr`, `MAT/rrxg4_nao.csr`, `MAT/rrxg7_nao.csr`, and `MAT/rrxg10_nao.csr`, and the y/z components follow the same pattern. | ||
|
|
||
| ## get_s | ||
| We also offer the option of only calculating the position matrix without running SCF. For that purpose, in `INPUT` file we need to set the keyword [calculation](../input_files/input-main.md#calculation) to `get_s`, and [out_mat_r](../input_files/input-main.md#out_mat_r) to `true`. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.