Skip to content

klsk007/openmx-soc-cddf-fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenMX 4.0 SOC CDDF fix

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

Problem

For a primitive monolayer MoS2 test case using

  • scf.SpinPolarization nc
  • scf.SpinOrbit.Coupling on
  • CDDF.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

Changes

The patch changes only source/Band_DFT_NonCol_Optical.c:

  1. Adds missing handling of way_of_kpoint == 3 (GCenter) in the non-collinear optical routine.
  2. Caps MaxN at the actual non-collinear Hamiltonian dimension 2*n. The previous code could use n2 = 2*n + 2, causing IU > N in EigenBand_lapack()/LAPACK.
  3. Replaces MPI_Allreduce(..., MPI_PROD, ...) with MPI_MAX for all_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

Validation

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 1
  • CDDF.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

Notes

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.

About

Patch for OpenMX 4.0 SOC CDDF failures in non-collinear optical calculations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors