This repository contains a small patch for OpenMX 4.0 that fixes failures in
non-collinear spin-orbit coupled optical/CDDF calculations in
source/Band_DFT_NonCol_Optical.c.
Author/contact for follow-up:
Xin Chen xin.chen@iat.cn
For a primitive monolayer MoS2 test case using
scf.SpinPolarization ncscf.SpinOrbit.Coupling onCDDF.start on- default
scf.Generation.Kpoint GCenter
OpenMX 4.0 entered the optical calculation and then failed around
<Optical calculations start>
Broadcast H(noncol) matrix elements.
Broadcast S matrix elements.
Broadcast Position matrix elements.
Depending on the small test used, the failure appeared either as a segmentation fault or as LAPACK/MKL errors:
Parameter 10 was incorrect on entry to ZHEEVX
Parameter 9 was incorrect on entry to DSTEVX
The patch changes only source/Band_DFT_NonCol_Optical.c:
- Adds missing handling of
way_of_kpoint == 3(GCenter) in the non-collinear optical routine. - Caps
MaxNat the actual non-collinear Hamiltonian dimension2*n. The previous code could usen2 = 2*n + 2, causingIU > NinEigenBand_lapack()/LAPACK. - Replaces
MPI_Allreduce(..., MPI_PROD, ...)withMPI_MAXforall_knum. The value is used as an all-processes-have-one-k-point flag; with many k-points and MPI ranks, the product can overflow.
Patch file:
patches/openmx4.0-soc-cddf-fix.patch
The full patched source file is also included under:
fixed-source/Band_DFT_NonCol_Optical.c
The clean patched binary was compiled in a separate OpenMX copy and tested with primitive monolayer MoS2, PBE, SOC, and CDDF:
scf.Kgrid 24 24 1CDDF.Kgrid 24 24 1- 128 MPI ranks
scf.criterion 1.0e-7
The patched calculation converged and finished normally:
NormRD = 0.000000004243 Criterion = 0.000000100000
<Optical calculations start>
<Optical calculations end, time=145.25126 (s)>
The calculation was normally finished.
It generated the expected files:
*.df_im
*.df_re
*.cd_im
*.cd_re
The calculated SOC/non-SOC OpenMX spectra were also compared against VASP
6.6.0 LOPTICS for the same MoS2 primitive cell and 24x24x1 k-mesh. The
main in-plane loss peaks were close:
method eps2 peak loss(in-plane) peak loss(trace) peak
OpenMX non-SOC 2.880 eV 5.000 eV 4.680 eV
OpenMX SOC 2.830 eV 4.950 eV 4.860 eV
VASP non-SOC 2.811 eV 4.933 eV 4.827 eV
VASP SOC 2.767 eV 4.895 eV 4.842 eV
The raw peak summary is included in:
validation/soc_nonsoc_peak_summary.tsv
This is a focused bug fix. It does not change the public input syntax and does
not alter the original OpenMX source tree except for
Band_DFT_NonCol_Optical.c.