8000 Bug in the input parser of nwxc functional · Issue #1073 · nwchemgit/nwchem · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Bug in the input parser of nwxc functional #1073
Open
@iswhy

Description

@iswhy

Describe the bug
When nwxc functional is used and range-separated functionals are specified, NWChem cannot recognize user-defined cam parameters.

Describe settings used
OS: Manjaro Linux 24.2.1
NWCHEM_MODULES="smallqm nwxc"

To Reproduce
Prepare the following input file:

start H2O
geometry units angstrom
  O  0.00000000  0.00000000  0.11726921
  H  0.75698224  0.00000000 -0.46907685
  H -0.75698224  0.00000000 -0.46907685
end
basis spherical
  * library cc-pvdz
end
dft
  xc xcampbe96 1.0 cpbe96 1.0 HFexch 1.0
  cam 0.30 cam_alpha 0.25 cam_beta 0.75
  iterations 100
end
task dft energy

and run. Next, prepare another input file that is the same as above except that the dft block above is replaced with

set dft:gonwxc .true.
dft
  xc new xcampbe96 1.0 cpbe96 1.0 #HFexch 1.0
  cam 0.30 cam_alpha 0.25 cam_beta 0.75
  iterations 100
end

This will trigger NWChem to use nwxc functionals. If you compare the output, they produce different results.

Note that it is not because of the commented-out hfexch keyword in the later input file. In fact, you need to ignore this keyword when nwxc is used to produce the same result as the old XC functional library. This undesired behavior appears to be caused by nwxc inability to allow user-defined cam parameters---it only allows the pre-defined set of cam parameters. In the output of the job above using nwxc, go to "Range-Separation Parameters" section, and you will see that the listed values of the cam parameters are different than what are specified in the input

           Range-Separation Parameters        
           ---------------------------
           Alpha           :  0.00
           Beta            :  1.00
           Gamma           :  0.33
           Short-Range HF  :     F

Now, try running this input file with a different functional:

start H2O
geometry units angstrom
  O  0.00000000  0.00000000  0.11726921
  H  0.75698224  0.00000000 -0.46907685
  H -0.75698224  0.00000000 -0.46907685
end
basis spherical
  * library cc-pvdz
end
dft
  xc xcamb88 1.00 lyp 0.81 vwn_5 0.19 hfexch 1.00
  cam 0.33 cam_alpha 0.19 cam_beta 0.46
  iterations 100
end
task dft energy

then rerun using the nwxc version of the functional, namely, with the dft section replaced with

set dft:gonwxc .true.
dft
  xc new xcamb88 1.00 lyp 0.81 vwn_5 0.19    #hfexch 1.00
  cam 0.33 cam_alpha 0.19 cam_beta 0.46
  iterations 100
end

You will see that this time the two XC libraries produce the same results. This is most likely because the specified combination of functionals and cam parameters belongs to a pre-defined set (I took those values from NWChem user manual).

I have the fix in my repo branch https://github.com/iswhy/nwchem/tree/fix_nwxc in case some reference might be helpful. I am sorry though for the loads of changes, they are mostly due to the files that are not git-tracked in the upstream but are git-tracked in my repo. (like some compile-time-generated *.fh files) The actual debugger modifications are found in src/nwdft/input_dft/dft_input.F and src/nwxc/nwxc/nwxc_nwchem.F.

PS: At the moment I consider the need of the hfexch to be absent when nwxc is used as a feature instead of a bug. If it is a bug, however, it would be independent from the one currently addressed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0