qmcpack icon indicating copy to clipboard operation
qmcpack copied to clipboard

Wrong norm of k-point from pw2qmcpack converter

Open romanfanta4 opened this issue 9 months ago • 6 comments

Description:

I’m encountering an issue using the pw2qmcpack.x converter for a molecular system in periodic boundary conditions. I’m using Quantum ESPRESSO to generate orbitals with a Gamma-only NSCF calculation (the supercell is large enough to justify Gamma-only). Both SCF and NSCF steps complete without error.

However, when running the conversion with pw2qmcpack.x, the converter fails with the following error in p2q.out: The wrong norm of k-point 1 band 110 , before collection, is 0.999659127727580 The orbitals read from QE files are incorrect. Perhaps your QE orbital files are corrupted.

Context:

The calculation is for a molecule in PBC, where I want to preserve magnetic properties. The system uses only the Gamma point defined in nscf as K_POINTS crystal 0 0 0 1.0

SCF was done with 2 2 2 K-point grid.

I am running this on the Perlmutter (NERSC) system. I've successfully run other QE → QMCPACK conversions before for different systems on this machine without problems. Input/output files are attached as a .zip archive.

What I’ve tried: Verified the SCF and NSCF wavefunction files look correct. Repeated the workflow without DFT+U and saw the same issue.

nscf.zip

romanfanta4 avatar Mar 24 '25 21:03 romanfanta4

Can you please also add the scf inputs so that we can repeat the full calculation?

prckent avatar Mar 24 '25 22:03 prckent

Sure. I added SCF to the zip file.

scf_and_nscf.zip

romanfanta4 avatar Mar 24 '25 22:03 romanfanta4

To get fast turnaround on a 16 core workstation I tried running the scf->nscf->p2q steps at 100Ry, but with no other changes. Using QE 7.3.1 and p2qmcpack added via the cmake plugin I did not hit the normalization error. (I had been speculating about options such as the gamma point optimized route in QE. ) My successful run used 2 pools, 8 cores/pool, and OMP_NUM_THREADS=1, and was built with the Ubuntu24 default distribution versions of gcc/gfortran 13.3.0, OpenMPI 4.1.6, OpenBLAS, FFTW. Can you please try running afresh at a low cutoff to see if the problem reoccurs? Do you find this problem for any other calculations?

prckent avatar Mar 25 '25 16:03 prckent

Thank you for the suggestion. I tested the calculation with various plane-wave cutoffs - 100, 200, 300, and 400 Ry. For cutoff values up to 300 Ry, the pw2qmcpack.x converter runs without any issues. However, at 400 Ry, I encounter the previously mentioned error.

I then tried running pw2qmcpack using 2 nodes instead of 1, and the conversion completed successfully, even at 400 Ry. This suggests the problem is likely related to memory limitations rather than an issue with the QE files themselves. That said, it would be helpful if the converter provided a clearer error message indicating a memory problem, rather than suggesting corrupted orbitals.

romanfanta4 avatar Mar 25 '25 23:03 romanfanta4

Good to hear that you have a working route. What is not yet clear is whether the bug is with pw.x, pw2qmcpack.x, or both. Clearly there is some issue with large memory usage and/or parallelization, or perhaps there is an integer overflow with large calculations somewhere. I would normally say to check with the latest QE 7.4.1, but we know there is a parallel symmetrization bug in that (fixed on develop). When the next official release is out (7.4.2, 7.5 etc.), can you please update this issue with what you find?

prckent avatar Mar 26 '25 13:03 prckent

I tried running the conversion on the CPU node on Perlmutter, and it worked. I assume there is an issue with the GPU versions of the QE/converter. Once the new versions are out, I will test them. I appreciate your help.

romanfanta4 avatar Mar 27 '25 22:03 romanfanta4