Repository navigation
Conversation
Reuse the real-time AO velocity, position integrals and LR transition projection. Read H(R) and S(R) from text CSR for standalone LR and use the in-memory KS blocks for ks-lr. Cover the opt-in gauge with a multik Si absorption regression and check the fixed-orbital SRCH result against an independent Fourier reconstruction. (cherry picked from commit caed480)
Default to eight significant digits in LR energy output and accept values up to 17. Keep 0 as the legacy-format opt-in. Apply the setting to solver output, energy reports, optical energy columns, and saved excitation energies. Refresh the HF Gamma energy references affected by the extra printed digits. Write optional LR state files outside assertions so Release builds honor out_wfc_lr. (cherry picked from commit bbc5d22)
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
The new absorption regression can accept incomplete or NaN output; require a complete finite spectrum before treating the check as passed. Static source review at d040f1eb; no builds or runtime tests were run.
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
The previous three findings are addressed in the source at 024b3fc5a. Two non-blocking regression-test suggestions remain below. This was a static incremental review; I did not rerun the reported tests.
| output_rows = read_spectrum(output) | ||
| for line, (expected, actual) in enumerate(zip(reference_rows, output_rows), start=2): | ||
| for column, (expected_value, actual_value) in enumerate(zip(expected, actual), start=1): | ||
| if abs(expected_value - actual_value) > tolerance: |
There was a problem hiding this comment.
Non-blocking: the new spectrum has 89 of its 100 intensities below 1e-4, so this comparator would accept all 89 being replaced by zero. Could the intensity column use a relative tolerance with a smaller absolute floor, while keeping separate tolerances for the grid columns, and include a small-amplitude regression case?
There was a problem hiding this comment.
Addressed in 15f7092. Frequency and wavelength each retain an absolute tolerance of 1e-4 in their own units. Absorption now uses a 1e-4 relative tolerance with a 1e-8 absolute floor. The collector test accepts a small perturbation around 2.5e-6 and rejects setting it to zero. I also zeroed the 89 weak intensities in the HSE reference and verified that the comparison fails.
There was a problem hiding this comment.
Addressed in 15f7092f7: absorption now uses a relative tolerance with a 1e-8 floor, while both grid columns retain 1e-4 absolute tolerance. The added cases distinguish a small weak-intensity perturbation from zeroed output and check both grid columns. Verified in source only; I did not run the tests.
| basis_type lcao | ||
| gamma_only 0 | ||
| symmetry -1 | ||
| nspin 1 |
There was a problem hiding this comment.
Non-blocking: could a small nspin=2 LR commutator case be retained alongside this HSE spin-one case? The replacement removes the previous two-spin LR projection coverage, and all new CSR runs are spin-one, leaving the hrs2_nao.csr path untested. The RT spin-two case covers the shared AO helper, but not those LR consumers.
There was a problem hiding this comment.
Addressed in 15f7092. The original spin-one HSE test is retained and a separate 08_RI_lr_absorption_csr_spin2 CTest runs the same HSE H2 system with nspin=2. It verifies the separate reads of hrs1_nao.csr and hrs2_nao.csr, compares the in-memory and standalone spectra, and checks the same closed-shell reference and the direct-velocity control. Both tests passed with four MPI ranks on the merged branch.
There was a problem hiding this comment.
Addressed in source in 15f7092f7: the separate nspin=2 workflow checks both CSR file reads and compares the in-memory, standalone and reference spectra, alongside the direct-velocity control. This is closed-shell coverage; unequal spin blocks remain outside this fixture.
# Conflicts: # source/source_hamilt/module_hcontainer/read_hcontainer.cpp # source/source_hamilt/module_xc/exx_info.cpp
| const double *const energies = &this->tda_ene[is * this->nstates]; | ||
| const std::string channel = this->inp_->bse_spin_types[is] + "_tda"; | ||
| LR_Util::print_excitation_energies(this->ofs_running_, energies, this->nstates, channel); | ||
| LR_Util::print_excitation_energies(this->ofs_running_, energies, this->nstates, channel, 0); |
There was a problem hiding this comment.
name the variable first, for example x=0, and put x in the function, so readers can know what '0' means from the name of x
There was a problem hiding this comment.
Updated in 21d9485. BSE now passes the named legacy_energy_precision value and retains its existing output format.
| this->add_item(item); | ||
| } | ||
| { | ||
| Input_Item item("lr_energy_precision"); |
There was a problem hiding this comment.
I would suggest you fix 17 numbers and then remove the input parameter
There was a problem hiding this comment.
Updated in 21d9485. LR excitation energies now use 17 significant digits. I removed the INPUT parameter and its dedicated tests.
There was a problem hiding this comment.
I would suggest adding the head lines like this (with # as first label):
ABACUS version: v3.11.0-beta13
Written at 2026-11-20 14:53:46
Ionic_Step 5
768 # number of points
you can find examples by asking AI agent
There was a problem hiding this comment.
Updated in 21d9485. The text spectrum now uses the shared version, timestamp and one-based ionic-step header, followed by a commented point count. A two-step run confirmed Ionic_Step 2.
|
|
||
| # This two-stage producer/consumer check needs the same SCF artifacts in | ||
| # separate LR runs, which the single-invocation Autotest cases cannot express. | ||
| find_program(LR_ABSORPTION_PYTHON python3) |
There was a problem hiding this comment.
could you try to reduce the complexity of the cmake codes?
There was a problem hiding this comment.
Updated in 21d9485. CMake registers one absorption workflow test. The Python driver runs both spin configurations.
There was a problem hiding this comment.
do you have absorption '.csr outputs'? I didn't find them.
There was a problem hiding this comment.
The spectrum is the text table absorption.dat. CSR refers to the H(R)/S(R) matrix inputs for standalone LR. I renamed the test and driver to clarify this in 21d9485.
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
The fixed excitation-energy precision would benefit from a direct round-trip regression; the existing collector cannot distinguish the intended precision.
Static incremental source review of 21d9485, including LR/BSE callers, provenance and validation workflows; no build or runtime test was run.
| { | ||
| std::ofstream ofs(file); | ||
| const int decimals = lr_excitation_energy_digits - 1; | ||
| ofs << std::scientific << std::setprecision(decimals); |
There was a problem hiding this comment.
Non-blocking: Add a round-trip regression for the fixed excitation-energy precision. The LR property collector rounds energies to six decimals, so it can miss a regression in this 17-digit output contract. A finite value that requires max_digits10 to round-trip would protect the behavior.
There was a problem hiding this comment.
Added MODULE_LR_util_print in ff7dbc2. It writes and reads back the double immediately above 1.0 and a small finite value, then compares them exactly. The test passes at 17 significant digits and fails in a scratch build at 16.
There was a problem hiding this comment.
Addressed in ff7dbc29c: MODULE_LR_util_print now checks exact round trips for the double above 1.0 and 1e-12, protecting the 17-digit output and small finite values.
Static review only; no builds or runtime tests were run.
|
The CUDA failure reproduces on upstream The failing |
Changes
abs_gauge velocity_commutator. It uses in-memory H(R)/S(R) inks-lrand text CSR fromout_hsr 1in standalonelr. The INPUT docs recommend directvelocityfor local and semilocal functionals.absorption.dat.Si SRCH
With identical LR-TDA settings and 0.10 eV Lorentzian HWHM, the 3–6 eV integral of Im εzz rises from 38.81 to 55.31. The digitized RT-TDDFT reference is 59.61. The LR peaks remain about 0.18 and 0.37 eV above the reference. Ji et al., Fig. 4(a)
Verification
cmake --build /tmp/abacus-lr-optical-build -j 12 --target abacus_std_para MODULE_IO_input_test_paraandctest --test-dir /tmp/abacus-lr-optical-build -R '^(MODULE_IO_input_test_para_4|lr_energy_collector|08_RI_lr_absorption_workflow)$'passed, including HSE spectra from in-memory and CSR matrix inputs with one and two spin channels.bash ../integrate/Autotest.sh -a /tmp/abacus-lr-optical-build/abacus_std_para_kxc -n 4 -o 1 -j 2 -r '^(lr_tddft_.*|bse_lr_multik|rt_tddft_hse_current_spin2_up)$'passed all nine selected cases with KXC-enabled LibXC.mpirun -np 2 abacus_std_para) matched the 17-digit saved energies to the solver and report. The BeH₂ two-step relaxation wrote# Ionic_Step 2.Governance notes
No linked issue. The Si spectrum above provides the reproduction. ESolver supplies the AO matrices and HSolver changes energy formatting only. The remaining
PARAMread belongs to the existing direct velocity setup. The added includes declare interface types and the standard double-precision digit count. No exception requested.