Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Example 003: NiV(0) in diamond

This example computes the SOC-induced zero-field splitting tensor for the neutral nickel-vacancy center in diamond using the Sternheimer approach.

Files

  • compute_dso_pw.py: driver script for decomp_mode="pw"
  • compute_dso_band.py: driver script for decomp_mode="band"
  • qe_calculation/: Quantum ESPRESSO wavefunction, pseudopotential, and local-potential data
  • reference/: reference JSON output and example logs

Required inputs

The driver reads:

  • qe_calculation/pwscf.save/data-file-schema.xml
  • qe_calculation/pwscf.save/wfcup1.dat
  • qe_calculation/pwscf.save/wfcdw1.dat
  • qe_calculation/pwscf.save/C.upf
  • qe_calculation/pwscf.save/Ni.upf
  • qe_calculation/potential_up.cube
  • qe_calculation/potential_dw.cube

For the Sternheimer workflow, the .cube local-potential files come from Quantum ESPRESSO. If higher numerical accuracy is needed, you may optionally patch the Quantum ESPRESSO cube writer in PP/src/cube.f90 and rebuild:

! original
WRITE(ounit,'(6E13.5)') (rho(i1,i2,i3),i3=1,nr3)

! higher-precision output
WRITE(ounit,'(6E23.15)') (rho(i1,i2,i3),i3=1,nr3)

This change is optional, but it may improve the accuracy of calculations that use .cube local potentials.

Run

From this directory, the two reference drivers are:

python compute_dso_pw.py
python compute_dso_band.py

For scheduled runs on Slurm:

srun -n 4 -u python compute_dso_pw.py > dso_pw.out
srun -n 4 -u python compute_dso_band.py > dso_band.out

Parallelization modes

This Sternheimer workflow supports two decomposition modes:

  • decomp_mode="pw" for plane-wave decomposition
  • decomp_mode="band" for band decomposition

For band decomposition, the currently supported layouts are:

  • band_distribution="contiguous"
  • band_distribution="block-cyclic"

The bundled compute_dso_band.py example uses decomp_mode="band" with the default contiguous band layout. A custom constructor call looks like:

dso = dso_sternheimer(
    wfc_files,
    pp_files,
    v_local_files,
    nbnd_occ,
    v_local_batch_size=1,
    decomp_mode="band",
    band_distribution="contiguous",
)

Reference GPU timings

The reference/ directory includes GPU runs for both decomposition modes on 4 MPI ranks / 4 GPUs:

  • reference/ref_dso_pw.out: compute_dso wall time 19.923608 s
  • reference/ref_dso_band.out: compute_dso wall time 10.699127 s

In these reference runs, band decomposition is about 1.86x faster than plane-wave decomposition, corresponding to about 46% lower wall time. This comparison is hardware- and workload-dependent, but it gives a useful baseline for this example.

Outputs

The calculation writes:

  • dso_stern_pw.json: structured ZFS results, metadata, and timings for decomp_mode="pw"
  • dso_stern_band.json: structured ZFS results, metadata, and timings for decomp_mode="band"

If you redirect standard output, dso_pw.out and dso_band.out will contain the console logs for the two runs.