Describe the bug
For a collinear spin-polarized LCAO calculation (nspin = 2), out_mat_hs2 generates hrs1_nao.csr and hrs2_nao.csr, but both Hamiltonian files contain only empty CSR blocks (data_size = 0). Consequently, the Hamiltonian cannot be used by post-processing codes such as TB2J.
In contrast:
srs1_nao.csr is correctly populated.
dmrs1_nao.csr and dmrs2_nao.csr are correctly generated and differ from each other.
- Mulliken analysis shows finite magnetic moments, indicating that the SCF converged to a magnetic solution.
This suggests that the issue is specific to writing the real-space Hamiltonian for nspin = 2.
Expected behavior
hrs1_nao.csr and hrs2_nao.csr should contain the spin-up and spin-down real-space Hamiltonians, respectively, similarly to how srs1_nao.csr contains the overlap matrix.
To Reproduce
Use a collinear spin-polarized LCAO calculation with
basis_type lcao
nspin 2
out_mat_hs2 1 16
out_dmr 1
gamma_only 0
vl_in_h 1
After the SCF finishes, inspect
OUT./hrs1_nao.csr
OUT./hrs2_nao.csr
Both files contain only empty CSR blocks.
Environment
No response
Additional Context
- ABACUS version: v3.11.0-beta.3
- Basis: LCAO
- Spin mode: nspin = 2 (collinear AFM)
out_mat_hs2 precision: 16 digits
- The same material calculated with noncollinear (
nspin = 4) correctly produces a populated hrs1_nao.csr.
dmrs1_nao.csr, dmrs2_nao.csr, and mulliken.txt confirm that the magnetic solution is not trivial.
I also inspected the implementation in ctrl_scf_lcao.cpp, where ModuleIO::write_hsr() receives
std::vector<hamilt::HContainer*> hr_vec = p_hamilt->getHR_vector();
I tested a local patch that explicitly called refresh(true) and updateHk() before getHR_vector(), but this did not change the output: hrs1_nao.csr and hrs2_nao.csr remained empty.
Questions
- Is
out_mat_hs2 currently expected to work for collinear (nspin = 2) LCAO calculations?
- Are there additional input parameters required to populate
hrs1_nao.csr and hrs2_nao.csr?
- Could this be a regression introduced in recent versions of ABACUS?
Task list for Issue attackers (only for developers)
Describe the bug
For a collinear spin-polarized LCAO calculation (
nspin = 2),out_mat_hs2generateshrs1_nao.csrandhrs2_nao.csr, but both Hamiltonian files contain only empty CSR blocks (data_size = 0). Consequently, the Hamiltonian cannot be used by post-processing codes such as TB2J.In contrast:
srs1_nao.csris correctly populated.dmrs1_nao.csranddmrs2_nao.csrare correctly generated and differ from each other.This suggests that the issue is specific to writing the real-space Hamiltonian for
nspin = 2.Expected behavior
hrs1_nao.csrandhrs2_nao.csrshould contain the spin-up and spin-down real-space Hamiltonians, respectively, similarly to howsrs1_nao.csrcontains the overlap matrix.To Reproduce
Use a collinear spin-polarized LCAO calculation with
basis_type lcao
nspin 2
out_mat_hs2 1 16
out_dmr 1
gamma_only 0
vl_in_h 1
After the SCF finishes, inspect
OUT./hrs1_nao.csr
OUT./hrs2_nao.csr
Both files contain only empty CSR blocks.
Environment
No response
Additional Context
out_mat_hs2precision: 16 digitsnspin = 4) correctly produces a populatedhrs1_nao.csr.dmrs1_nao.csr,dmrs2_nao.csr, andmulliken.txtconfirm that the magnetic solution is not trivial.I also inspected the implementation in
ctrl_scf_lcao.cpp, whereModuleIO::write_hsr()receivesstd::vector<hamilt::HContainer*> hr_vec = p_hamilt->getHR_vector();
I tested a local patch that explicitly called
refresh(true)andupdateHk() before getHR_vector(), but this did not change the output:hrs1_nao.csrandhrs2_nao.csrremained empty.Questions
out_mat_hs2currently expected to work for collinear (nspin = 2) LCAO calculations?hrs1_nao.csrandhrs2_nao.csr?Task list for Issue attackers (only for developers)