quantum-espresso/upflib
giannozz cf1d9099ef Merge branch 'develop' into 'betaclean'
# Conflicts:
#   Doc/release-notes
2024-01-05 08:20:06 +00:00
..
CMakeLists.txt [skip-CI] Merged OpenACC and CPU versions of init_us_2 2023-12-16 11:16:33 +01:00
Makefile [skip-CI] Merged OpenACC and CPU versions of init_us_2 2023-12-16 11:16:33 +01:00
README.md [skip-CI] Small documentation update 2023-12-01 13:56:08 +01:00
TODO_upflib.md [skip-CI] OpenACC version of init_us_2.f90 2023-12-15 12:36:39 +01:00
atom.f90 First compiling version of QE with initial "pseudolib" in upflib/. 2020-04-25 19:13:15 +00:00
atomic_number.f90 Small correction to pseudopotential converters 2020-05-04 17:28:10 +02:00
casino2upf.f90 [skip-CI] Some more upf clean-up, notably in error handling 2023-04-18 17:28:28 +02:00
casino_pp.f90 casino2upf converter restored (?), courtesy Jack Muff 2021-06-16 18:36:13 +02:00
dom.f90 [skip-CI] Add test for upf PP 2023-04-12 15:28:34 +00:00
dqvan2.f90 More upflib cleanup 2023-10-24 11:11:05 +02:00
dylmr2.f90 Derivatives of spherical harmonics (dylmr2*f90) moved to upflib/ 2021-05-02 09:20:21 +02:00
dylmr2_gpu.f90 Derivatives of spherical harmonics (dylmr2*f90) moved to upflib/ 2021-05-02 09:20:21 +02:00
fixfiles.py Convert to Python3 and minor improvements 2020-09-23 23:50:24 +09:00
gen_us_dj.f90 Duplicated code from GWW deleted, small changes done to interpolation routines 2024-01-02 17:37:01 +01:00
gen_us_dy.f90 [skip-CI] Interpolation of beta functions moved to a separate routine 2023-12-29 14:24:52 +01:00
gth.f90 [skip-CI] Fix for f channel of GTH PP 2023-12-18 14:20:36 +01:00
hgh2qe.f90 Replaced dgamma function with gamma because dgamma is only a GNU specific builtin 2020-09-29 18:11:32 +02:00
init_tab_atwfc.f90 [skip-CI] Interpolation table for atomic wavefunctions moved to openacc 2023-06-29 14:39:17 +02:00
init_tab_beta.f90 Cleanup of code computing and using interpolation table "tab": 2023-12-04 21:12:40 +01:00
init_us_0.f90 Minor changes 2021-12-31 09:09:47 +01:00
init_us_1.f90 [skip-CI] Unused CUDA variables removed 2023-12-18 09:46:23 +01:00
init_us_2_acc.f90 Duplicated code from GWW deleted, small changes done to interpolation routines 2024-01-02 17:37:01 +01:00
init_us_b0.f90 Reverted: no point in smoothing GTH pseudopotentials 2022-01-10 08:41:44 +01:00
interp_atwfc.f90 [skip-CI] interp_atwfc GPU and COPU versions arenow the same 2023-06-29 18:04:13 +02:00
paw_variables.f90 init_us_1 moved to upflib 2021-01-16 01:07:21 +01:00
pseudo_types.f90 Support for meta-GGA arrays in upf files added (that is: they are read but not yet used) 2023-12-07 17:07:38 +01:00
qrad_mod.f90 Some more cleanup for USPP Q variables 2023-10-27 16:40:51 +02:00
qvan2.f90 Again a small problem 2023-10-24 12:07:25 +02:00
radial_grids.f90 Unused routines removed 2020-05-02 09:18:00 +02:00
read_cpmd.f90 [skip-CI] More upflib cleanup 2023-04-23 13:10:10 +02:00
read_fhi.f90 [skip-CI] Yet another bug introduced yesterday 2023-12-12 13:33:54 +01:00
read_ncpp.f90 Yet another problem with broadcast of zero-sized array. Fixes #633 2024-01-04 12:43:13 +01:00
read_ps.f90 [skip-CI] Yet another bug introduced yesterday 2023-12-12 13:33:54 +01:00
read_psml.f90 [skip-CI] Yet another bug introduced yesterday 2023-12-12 13:33:54 +01:00
read_upf_new.f90 [skip-CI] Yet another bug introduced yesterday 2023-12-12 13:33:54 +01:00
read_upf_v1.f90 [skip-CI] Yet another bogus UPF v.1 error 2023-08-11 11:02:54 +02:00
read_uspp.f90 [skip-CI] More upf cleanup, notably in pseudppotebtial reading. Now all formats 2023-04-25 10:21:18 +02:00
rhoat_mod.f90 [skip-CI] The most important file was missing 2023-10-14 07:51:37 +02:00
rhoc_mod.f90 [skip-CI] Missing set to zero 2023-10-13 20:36:20 +02:00
simpsn.f90 stress_acc - acc fixes in simpson and sph_bes 2022-08-08 12:52:05 +02:00
sph_bes.f90 stress_acc - acc fixes in simpson and sph_bes 2022-08-08 12:52:05 +02:00
sph_ind.f90 errore => upf_error 2021-04-09 07:57:24 +02:00
spinor.f90 errore => upf_error 2021-04-09 07:57:24 +02:00
splinelib.f90 [skip-CI] OpenACC version of init_us_2.f90 2023-12-15 12:36:39 +01:00
upf_auxtools.f90 [skip-CI] More cleanup, GTH PP re-introduced, fixed a crash with PAW 2023-04-27 11:07:57 +02:00
upf_const.f90 init_us_0.f90 and init_us_b0.f90 disentangled and moved to upflib. 2021-01-15 23:41:27 +01:00
upf_error.f90 [skip-CI] Some more upf clean-up, notably in error handling 2023-04-18 17:28:28 +02:00
upf_invmat.f90 First compiling version of QE with initial "pseudolib" in upflib/. 2020-04-25 19:13:15 +00:00
upf_io.f90 First compiling version of QE with initial "pseudolib" in upflib/. 2020-04-25 19:13:15 +00:00
upf_ions.f90 More cleanup; update on what is left to do 2021-02-26 14:44:58 +00:00
upf_kinds.f90 First compiling version of QE with initial "pseudolib" in upflib/. 2020-04-25 19:13:15 +00:00
upf_kinds.h First compiling version of QE with initial "pseudolib" in upflib/. 2020-04-25 19:13:15 +00:00
upf_parallel_include.f90 First compiling version of QE with initial "pseudolib" in upflib/. 2020-04-25 19:13:15 +00:00
upf_params.f90 increased lmaxx 2021-05-18 23:02:15 +02:00
upf_spinorb.f90 Yet another "device" variable (fcoef) replaced by an OpenACC one 2023-12-01 11:29:48 +01:00
upf_to_internal.f90 Removal of duplicated PP code 2021-04-05 22:21:48 +02:00
upf_utils.f90 [skip-CI] Removed file upftest.f90 erroneously added, moved two small functions 2023-04-12 18:04:13 +02:00
upfconv.f90 Support for meta-GGA arrays in upf files added (that is: they are read but not yet used) 2023-12-07 17:07:38 +01:00
uspp.f90 [skip-CI] Unused CUDA variables removed 2023-12-18 09:46:23 +01:00
uspp_data.f90 Cleanup of code computing and using interpolation table "tab": 2023-12-04 21:12:40 +01:00
uspp_param.f90 Module uspp and uspp_param split 2021-12-30 15:10:13 +01:00
virtual_v2.f90 [skip-CI] Yet another problem with new PP reading code 2023-05-27 10:03:20 +02:00
vloc_mod.f90 [skip-CI] Reorganization of interpolation table for rho_core seems to work 2023-10-08 10:57:14 +02:00
write_upf_new.f90 [skip-CI] Update writing as well 2023-12-07 22:22:13 +01:00
wxml.f90 changed format es24.15 -> es24.15e3 in xml writer. 2023-05-16 09:51:07 +02:00
xmltools.f90 [skip-CI] Fix unexpected side effect of a previous commit 2023-10-18 07:55:31 +02:00
ylmr2.f90 Derivatives of spherical harmonics (dylmr2*f90) moved to upflib/ 2021-05-02 09:20:21 +02:00
ylmr2_gpu.f90 [skip-CI] Comments in CUDA Ylm updated to better reflect reality 2023-12-23 17:45:54 +01:00

README.md

Library of pseudopotential code

This directory contains the "upflib" library of pseudopotential-related code, extracted from the Quantum ESPRESSO distribution. This library depends only upon module mp.f90 of UtilXlib and upon a few modules and routines of devXlib; upon a few LAPACK routines; requires a suitable ../make.inc file in Makefile. Other than this, it can be independently compiled.

Currently, upflib includes

  • basic definitions of the UPF (Unified Pseudopotential File) format
  • basic I/O operations on UPF files
  • setup of the interpolation tables and of other basic variables
  • interpolation of pseudopotentials
  • generation of various pseudopotentials matrix elements
  • utilities: spherical harmonics and Bessel functions, integration routines

The available information on pseudopotential formats can be found here: https://gitlab.com/QEF/q-e/-/wikis/Developers/Format-of-pp-files

In addition to the libupf.a library, executable utilities are produced:

  • upfconv.x, converting pseudopotentials in other formats into UPF: see upfconv.x -h for more

  • virtual_v2.x, courtesy Jingyang Wang (jw598@cornell.edu), generates an averaged pseudopotential suitable for Virtual Crystal Approximation

  • casino2upf.x, courtesy Mike Towler (see below)

A python script fixfile.py is also present, to remove undesired & characters from UPF files that hinder their parsing by xml tools.

CASINO and QE pseudopotentials

The following notes are kept for reference (they might be obsolete). Code upfconv.x -c should replace code upf2casino2.x mentioned below. Code casino2upf.x was moved to upflib/ and works (?) again, at least for the example provided by Jake Muff, since v.6.8. Old notes start here:

Two utilities are provided with the Quantum Espresso distribution to enable the PWscf code to be used in conjunction with the CASINO quantum Monte Carlo code.

Of course all pseudopotentials generated via these automatic tools should be tested before being used for production runs.

It should be noted that ultrasoft and PAW pseudopotentials cannot be used with the CASINO code. Currently only UPF files containing norm-conserving pseudopotentials can be converted using these utilities.

casino2upf.x

The first of these is casino2upf.x . This utility takes a given CASINO tabulated pseudopotential file and one or more awfn.data files specifying the pseudoatomic wavefunctions to be used in creating the Kleinman-Bylander projectors. A UPF file containing the projectors and the local potential is then written to the file name specified in inputpp. Any errors are communicated to the user via stderr.

Usage:

    ./casino2upf.x < inputpp

A sample inputpp file for converting a Trail and Needs pseudopotential would be:

inputpp:
	&inputpp
		pp_data='pp.data'
		upf_file='my_pseudo_potential.UPF'
	/
	3
	awfn.data_s1_2S
	awfn.data_p1_2P
	awfn.data_d1_2D

Here pp_data specifies the name and location of the file containing the CASINO pseudopotential. The utility then expects an input card after &inputpp consisting of the number of awfn.data files supplied (in this case 3) and then their names. The files are searched sequentially so the first s wavefunction found will be used for the s projector, first p for the p projector and so on.

A note on the radial grid

The utility currently performs no interpolation and attempts to use the same radial grid as the original pseudopotential. It therefore assumes that the grid will be of the standard form used by Trail and Needs.

If this is not the case the flag tn_grid=.false. can be set in the input file. The standard logarithmic form, r(i)=exp(xmin + i*dx) / Z is then assumed. Values for xmin and dx can also be specified in the input file in the usual way.

If interpolation from a different non-standard grid is required then the current recommended route is to use the casino2gon utility supplied with the CASINO distribution. This produces the older GON format that is (currently) still read by PWscf.

Ghost states

The Kleinman-Bylander form can unfortunately introduce ghost states into some calculations. If this does occur we recommend that the pseudopotential is re-converted using a different local channel. The local channel can be specified in the original CASINO pp.data file and is read in automatically by casino2upf.x .

up2casino.x

This utility takes a standard UPF pseudopotential from standard input and writes a CASINO tabulated pseudopotential file to standard output. Any errors are communicated via stderr.

Usage:

./up2casino.x < pseudo.UPF > pp.data

Care must be taken that the resulting pseudopotential file spec fies the required local channel. Also this utility should only be used with norm-conserving pseudopotentials.