Hello community, here is the log from the commit of package xcfun for openSUSE:Factory checked in at 2020-11-08 20:59:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xcfun (Old) and /work/SRC/openSUSE:Factory/.xcfun.new.11331 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xcfun" Sun Nov 8 20:59:39 2020 rev:2 rq:846956 version:2.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/xcfun/xcfun.changes 2020-09-25 16:30:57.787859966 +0200 +++ /work/SRC/openSUSE:Factory/.xcfun.new.11331/xcfun.changes 2020-11-08 20:59:49.616228700 +0100 @@ -1,0 +2,7 @@ +Sun Nov 8 16:36:24 UTC 2020 - andy great <andythe_gr...@pm.me> + +- Update to version 2.1.0. + * XCFun now provides many functionals in the SCAN family of + metaGGAs. + +------------------------------------------------------------------- Old: ---- xcfun-2.0.2.tar.gz New: ---- xcfun-2.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xcfun.spec ++++++ --- /var/tmp/diff_new_pack.C8WpeS/_old 2020-11-08 20:59:50.092227777 +0100 +++ /var/tmp/diff_new_pack.C8WpeS/_new 2020-11-08 20:59:50.096227768 +0100 @@ -19,7 +19,7 @@ %define major 2 %define libname lib%{name}%{major} Name: xcfun -Version: %{major}.0.2 +Version: %{major}.1.0 Release: 0 Summary: Exchange-correlation functionals with arbitrary-order derivatives License: MPL-2.0 ++++++ xcfun-2.0.2.tar.gz -> xcfun-2.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/.azure-pipelines.yml new/xcfun-2.1.0/.azure-pipelines.yml --- old/xcfun-2.0.2/.azure-pipelines.yml 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/.azure-pipelines.yml 2020-09-18 14:14:48.000000000 +0200 @@ -14,3 +14,18 @@ maxParallel: 2 steps: - template: ./.ci/macos.yml + +- job: 'Windows_64' + pool: + vmImage: 'windows-latest' + strategy: + matrix: + Python38: + python.version: '3.8' + Python37: + python.version: '3.7' + Python36: + python.version: '3.6' + maxParallel: 2 + steps: + - template: ./.ci/windows.yml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/.ci/windows.yml new/xcfun-2.1.0/.ci/windows.yml --- old/xcfun-2.0.2/.ci/windows.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/.ci/windows.yml 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,64 @@ +steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: "Using Python version: $(python.version)" + + - script: | + python -m pip install --upgrade pip pytest numpy + displayName: 'Pip install Python dependencies' + + - script: | + cmake -H. -Bbuild ^ + -A x64 ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=$(Agent.BuildDirectory)\Software\xcfun ^ + -DCMAKE_CXX_COMPILER=cl.exe ^ + -DXCFUN_PYTHON_INTERFACE=ON + displayName: "Configure XCFun" + + - script: | + cmake --build build ^ + --config Release ^ + --target install + displayName: "Build XCFun" + + - script: | + cd build + ctest --output-on-failure ^ + -C Release ^ + -E python-interface ^ + --verbose + displayName: "Test XCFun with CTest" + + # Test we can build the C++ example + - script: | + cmake -H.\examples\CXX_host -Bbuild_CXX_host ^ + -A x64 ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DXCFun_DIR=$(Agent.BuildDirectory)\Software\xcfun\share\cmake\XCFun ^ + -DCMAKE_CXX_COMPILER=cl.exe + displayName: "Configure C++ host examples" + + - script: | + cmake --build build_CXX_host + displayName: "Build C++ host example" + + # Test we can build the C example + - script: | + cmake -H.\examples\C_host -Bbuild_C_host ^ + -A x64 ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DXCFun_DIR=$(Agent.BuildDirectory)\Software\xcfun\share\cmake\XCFun ^ + -DCMAKE_C_COMPILER=cl.exe + displayName: "Configure C host examples" + + - script: | + cmake --build build_C_host + displayName: "Build C host example" + +# - script: | +# set PYTHONPATH=$(Agent.BuildDirectory)\Software\xcfun\lib\python;%PYTHONPATH% +# ls $(Agent.BuildDirectory)\Software\xcfun\lib\python\xcfun +# python -c "import xcfun; print(xcfun.xcfun_splash())" +# displayName: "Test XCFun Python module" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/.travis.yml new/xcfun-2.1.0/.travis.yml --- old/xcfun-2.0.2/.travis.yml 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/.travis.yml 2020-09-18 14:14:48.000000000 +0200 @@ -71,7 +71,7 @@ env: global: - - CMAKE_VERSION="3.11.4" + - CMAKE_VERSION="3.14.7" before_install: - test -n $CC && unset CC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/.zenodo.json new/xcfun-2.1.0/.zenodo.json --- old/xcfun-2.0.2/.zenodo.json 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/.zenodo.json 2020-09-18 14:14:48.000000000 +0200 @@ -60,6 +60,10 @@ { "type": "Other", "name": "Victorovich, Yuri" + }, + { + "type": "Other", + "name": "Furness, James" } ], "license": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/CHANGELOG.md new/xcfun-2.1.0/CHANGELOG.md --- old/xcfun-2.0.2/CHANGELOG.md 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/CHANGELOG.md 2020-09-18 14:14:48.000000000 +0200 @@ -1,5 +1,17 @@ # Change Log +## [Version 2.1.0] - 2020-09-18 + +- Many new functionals in the SCAN family have been added. Thanks to James + Furness for the contribution. + See [PR #140](https://github.com/dftlibs/xcfun/pull/140) +- The library is now available both as a Spack and a Conda package. +- The library can now be _natively_ compiled on Linux, macOS, and Windows. + +### Changed + +- **BREAKING** CMake >= 3.14 is required to configure the code. + ## [Version 2.0.2] - 2020-07-15 ### Fixed @@ -114,6 +126,7 @@ - **BREAKING** The Fortran interface is no longer build with the code, but shipped as a separate file to be compiled within your own Fortran code. +[Version 2.1.0]: https://github.com/dftlibs/xcfun/compare/v2.0.2...v2.1.0 [Version 2.0.2]: https://github.com/dftlibs/xcfun/compare/v2.0.1...v2.0.2 [Version 2.0.1]: https://github.com/dftlibs/xcfun/compare/v2.0.0...v2.0.1 [Version 2.0.0]: https://github.com/dftlibs/xcfun/compare/v2.0.0a7...v2.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/CMakeLists.txt new/xcfun-2.1.0/CMakeLists.txt --- old/xcfun-2.0.2/CMakeLists.txt 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/CMakeLists.txt 2020-09-18 14:14:48.000000000 +0200 @@ -2,7 +2,7 @@ # Copyright (c) 2015-2020 by Radovan Bast, Roberto Di Remigio, Jonas Juselius, and contributors. # set minimum cmake version -cmake_minimum_required(VERSION 3.11 FATAL_ERROR) +cmake_minimum_required(VERSION 3.14 FATAL_ERROR) # project name project(XCFun LANGUAGES CXX) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/README.md new/xcfun-2.1.0/README.md --- old/xcfun-2.0.2/README.md 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/README.md 2020-09-18 14:14:48.000000000 +0200 @@ -3,10 +3,6 @@ [![GitHub license](https://img.shields.io/github/license/dftlibs/xcfun.svg?style=flat-square)](https://github.com/dftlibs/xcfun/blob/master/LICENSE.md) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3576419.svg)](https://doi.org/10.5281/zenodo.3576419) -[![GitHub issues](https://img.shields.io/github/issues/dftlibs/xcfun.svg?style=flat-square)](https://github.com/dftlibs/xcfun/issues) -[![GitHub forks](https://img.shields.io/github/forks/dftlibs/xcfun.svg?style=flat-square)](https://github.com/dftlibs/xcfun/network) -[![GitHub stars](https://img.shields.io/github/stars/dftlibs/xcfun.svg?style=flat-square)](https://github.com/dftlibs/xcfun/stargazers) - # XCFun: A library of exchange-correlation functionals with arbitrary-order derivatives Copyright Ulf Ekström and [contributors](.zenodo.json) 2009-2020. @@ -23,4 +19,6 @@ The documentation is available at https://xcfun.readthedocs.io. -XCFun can now be installed in a [Spack](https://spack.io) environment: https://xcfun.readthedocs.io/en/latest/using.html#installing-using-spack +XCFun can be installed with popular package managers: + - [Spack](https://spack.io): https://xcfun.readthedocs.io/en/latest/using.html#installing-using-spack + - [Conda](https://docs.conda.io): https://xcfun.readthedocs.io/en/latest/using.html#installing-using-conda diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/cmake/autocmake.yml new/xcfun-2.1.0/cmake/autocmake.yml --- old/xcfun-2.0.2/cmake/autocmake.yml 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/cmake/autocmake.yml 2020-09-18 14:14:48.000000000 +0200 @@ -3,7 +3,7 @@ # adapt the following lines and expand name: XCFun -min_cmake_version: 3.11 +min_cmake_version: 3.14 setup_script: setup url_root: https://github.com/coderefinery/autocmake/raw/master/ default_build_type: Debug diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/cmake/custom/xcfun.cmake new/xcfun-2.1.0/cmake/custom/xcfun.cmake --- old/xcfun-2.0.2/cmake/custom/xcfun.cmake 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/cmake/custom/xcfun.cmake 2020-09-18 14:14:48.000000000 +0200 @@ -23,17 +23,12 @@ set(XCFUN_MAX_ORDER 6 CACHE STRING "Maximum order of derivatives of the exchange-correlation kernel" FORCE) endif() -set(PROJECT_VERSION 2.0.2) +set(PROJECT_VERSION 2.1.0) set(PROJECT_VERSION_MAJOR 2) -set(PROJECT_VERSION_MINOR 0) -set(PROJECT_VERSION_PATCH 2) +set(PROJECT_VERSION_MINOR 1) +set(PROJECT_VERSION_PATCH 0) -if(WIN32 AND NOT CYGWIN) - set(DEF_INSTALL_CMAKEDIR CMake) -else() - set(DEF_INSTALL_CMAKEDIR share/cmake/${PROJECT_NAME}) -endif() -set(CMAKECONFIG_INSTALL_DIR ${DEF_INSTALL_CMAKEDIR} CACHE PATH "Installation directory for CMake files") +set(CMAKECONFIG_INSTALL_DIR share/cmake/${PROJECT_NAME} CACHE PATH "Installation directory for CMake files") add_subdirectory(${PROJECT_SOURCE_DIR}/api) add_subdirectory(${PROJECT_SOURCE_DIR}/src) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/docs/conf.py new/xcfun-2.1.0/docs/conf.py --- old/xcfun-2.0.2/docs/conf.py 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/docs/conf.py 2020-09-18 14:14:48.000000000 +0200 @@ -25,7 +25,7 @@ author = 'Ulf Ekström and contributors' # The full version, including alpha/beta/rc tags -release = '2.0.2' +release = '2.1.0' # -- General configuration --------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/docs/using.rst new/xcfun-2.1.0/docs/using.rst --- old/xcfun-2.0.2/docs/using.rst 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/docs/using.rst 2020-09-18 14:14:48.000000000 +0200 @@ -32,6 +32,18 @@ spack install xcfun +Installing using Conda +---------------------- + +XCFun can be installed in a `Conda +<https://docs.conda.io/>`_ environment with:: + + conda create -n myenv xcfun -c conda-forge + conda activate myenv + +The package is built with derivatives up to 8th order and includes the Python bindings. + + .. _integration: Integration with your build system diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/examples/CXX_host/CMakeLists.txt new/xcfun-2.1.0/examples/CXX_host/CMakeLists.txt --- old/xcfun-2.0.2/examples/CXX_host/CMakeLists.txt 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/examples/CXX_host/CMakeLists.txt 2020-09-18 14:14:48.000000000 +0200 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.14) project(CXX_host LANGUAGES CXX) @@ -16,7 +16,7 @@ FetchContent_Declare(xcfun_sources QUIET URL - https://github.com/dftlibs/xcfun/archive/v2.0.2.tar.gz + https://github.com/dftlibs/xcfun/archive/v2.1.0.tar.gz ) FetchContent_GetProperties(xcfun_sources) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/examples/C_host/CMakeLists.txt new/xcfun-2.1.0/examples/C_host/CMakeLists.txt --- old/xcfun-2.0.2/examples/C_host/CMakeLists.txt 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/examples/C_host/CMakeLists.txt 2020-09-18 14:14:48.000000000 +0200 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.14) project(C_host LANGUAGES C) @@ -16,7 +16,7 @@ FetchContent_Declare(xcfun_sources QUIET URL - https://github.com/dftlibs/xcfun/archive/v2.0.2.tar.gz + https://github.com/dftlibs/xcfun/archive/v2.1.0.tar.gz ) FetchContent_GetProperties(xcfun_sources) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/examples/Fortran_host/CMakeLists.txt new/xcfun-2.1.0/examples/Fortran_host/CMakeLists.txt --- old/xcfun-2.0.2/examples/Fortran_host/CMakeLists.txt 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/examples/Fortran_host/CMakeLists.txt 2020-09-18 14:14:48.000000000 +0200 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.14) project(Fortran_host LANGUAGES Fortran) @@ -12,7 +12,7 @@ FetchContent_Declare(xcfun_sources QUIET URL - https://github.com/dftlibs/xcfun/archive/v2.0.2.tar.gz + https://github.com/dftlibs/xcfun/archive/v2.1.0.tar.gz ) FetchContent_GetProperties(xcfun_sources) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/python/CMakeLists.txt new/xcfun-2.1.0/python/CMakeLists.txt --- old/xcfun-2.0.2/python/CMakeLists.txt 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/python/CMakeLists.txt 2020-09-18 14:14:48.000000000 +0200 @@ -1,4 +1,4 @@ -pybind11_add_module(_xcfun MODULE THIN_LTO +pybind11_add_module(_xcfun THIN_LTO export_xcfun.cpp ) @@ -23,8 +23,6 @@ set_target_properties(_xcfun PROPERTIES - PREFIX "${PYTHON_MODULE_PREFIX}" - SUFFIX "${PYTHON_MODULE_EXTENSION}" MACOSX_RPATH ON SKIP_BUILD_RPATH OFF BUILD_WITH_INSTALL_RPATH OFF @@ -37,11 +35,12 @@ ) foreach(_f __init__.py xcfun.py) - add_custom_target(symlink_${_f} ALL - COMMAND - ${CMAKE_COMMAND} -E create_symlink + file( + CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/${_f} ${PROJECT_BINARY_DIR}/${PYMOD_INSTALL_FULLDIR}/${_f} + COPY_ON_ERROR + SYMBOLIC ) endforeach() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/CMakeLists.txt new/xcfun-2.1.0/src/functionals/CMakeLists.txt --- old/xcfun-2.0.2/src/functionals/CMakeLists.txt 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/src/functionals/CMakeLists.txt 2020-09-18 14:14:48.000000000 +0200 @@ -51,6 +51,16 @@ ${CMAKE_CURRENT_SOURCE_DIR}/revtpssc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/revtpssx.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rpbex.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rSCANc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rSCANx.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/r2SCANc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/r2SCANx.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/r4SCANc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/r4SCANx.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rppSCANc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rppSCANx.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/SCANc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/SCANx.cpp ${CMAKE_CURRENT_SOURCE_DIR}/slaterx.cpp ${CMAKE_CURRENT_SOURCE_DIR}/spbec.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tfk.cpp @@ -80,6 +90,7 @@ revtpssc_eps.hpp revtpssx_eps.hpp slater.hpp + SCAN_like_eps.hpp tpssc_eps.hpp tpssx_eps.hpp vwn.hpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/SCAN_like_eps.hpp new/xcfun-2.1.0/src/functionals/SCAN_like_eps.hpp --- old/xcfun-2.0.2/src/functionals/SCAN_like_eps.hpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/SCAN_like_eps.hpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,520 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "config.hpp" +#include "constants.hpp" +#include "functional.hpp" +#include "pw92eps.hpp" + +/*! Common code for SCAN and SCAN-like functionals + * + * Implemented by James Furness, + * + * SCAN - J. Sun, A. Ruzsinszky, and J. P. Perdew, Phys. Rev. Lett. 115, 036402 + * (2015) rSCAN - A. P. Bartok and J. R. Yates, J. Chem. Phys. 150, 161101 (2019) + * r2SCAN - J Furness, A Kaplan, J Ning, J Perdew, & J Sun; J. Chem. Phys. Lett.; + * Accepted (DOI: 10.1021/acs.jpclett.0c02405) + * + * The r++SCAN (aka "rppSCAN") and r4SCAN functionals are relatives of r2SCAN. They + * are not recommended for general use. + * + * r++SCAN, r4SCAN - J Furness, A Kaplan, J Ning, J Perdew, & J Sun; in preparation. + */ + +namespace SCAN_eps { +template <class num> +static num get_SCAN_Fx(const num, + const num, + const num, + const int, + const int, + const int); +template <class num> +static num SCAN_X_Fx(const num, const num, const parameter, const int, const int); +template <class num> +static num r2SCAN_C(const densvars<num> &, const int, const int, const int); +template <class num> +static num scan_ec0(const num, + const num, + const num, + const parameter, + const parameter, + const parameter); +template <class num> +static num lda_0(const num, const parameter, const parameter, const parameter); +template <class num> +static num scan_ec1(const num, + const num, + const num, + const parameter[8], + const parameter, + const parameter, + const parameter, + const parameter, + const int); +template <class num> +static void get_lsda1(const num, const num, const num, num &, num &); +template <class num> +static void gcor2(const parameter[6], const num, const num, num &, num &); + +template <class num> static num fx_unif(const num & d) { + return (-0.75 * pow(3 / PI, 1.0 / 3.0)) * pow(d, 4.0 / 3.0); +} + +template <class num> +static num get_SCAN_Fx(const num d_n, + const num d_g, + const num d_tau, + const int IALPHA, + const int IINTERP, + const int IDELFX) { + const parameter ETA = 1.0e-3; + const parameter TAU_R = 1.0e-4; + const parameter A_REG = 1.0e-3; + + num tauw = d_g / (8.0 * d_n); + + num tauUnif = 0.0; + if (IALPHA == 1) { + tauUnif = ((3.0 / 10.0) * pow(3 * PI2, 2.0 / 3.0) * pow(d_n, 5.0 / 3.0)) + TAU_R; + } else { + tauUnif = (0.3 * pow(3 * PI2, 2.0 / 3.0) * pow(d_n, 5.0 / 3.0)); + } + + num alpha = 0.0; + if (IALPHA == 0) { + // alpha (SCAN) + if (abs(d_tau - tauw) > 1.0e-14) { + alpha = (d_tau - tauw) / tauUnif; + } + + } else if (IALPHA == 1) { + // alpha' (rSCAN) + alpha = (d_tau - tauw) / tauUnif; + alpha = pow(alpha, 3) / (pow2(alpha) + A_REG); + + } else if (IALPHA == 2) { + // \bar{alpha} (r2SCAN, r4SCAN) + if (abs(d_tau - tauw) > 1.0e-14) { + alpha = (d_tau - tauw) / (tauUnif + ETA * tauw); + } + + } else { + // Unknown IALPHA choice + printf("ERROR: Unknown IALPHA %d\n", IALPHA); + } + + num s = 0.0; + if (abs(d_g) > 1.0e-16) { + s = sqrt(d_g) / + (2.0 * pow(3.0 * PI2, 1.0 / 3.0) * pow(d_n, 4.0 / 3.0)); // Eq. (4) + }; + + num Fx = SCAN_X_Fx(s, alpha, ETA, IINTERP, IDELFX); + + return Fx; +} + +template <class num> +static num SCAN_X_Fx(const num s, + const num alpha, + const parameter ETA, + const int IINTERP, + const int IDELFX) { + const parameter A1 = 4.9479; + const parameter K1 = 0.065; + const parameter K0 = 0.174; + const parameter MU = 10.0 / 81.0; + + const parameter IE_PARAMS[8] = {1.0, + -0.667, + -0.4445555, + -0.663086601049, + 1.451297044490, + -0.887998041597, + 0.234528941479, + -0.023185843322}; + const parameter CFX1 = 0.667; + const parameter CFX2 = 0.8; + const parameter CFDX1 = 1.24; + + const parameter D_DAMP2 = 0.361; + const parameter DX_DAMP4_P = 0.232; + const parameter DX_DAMP4_A = 0.232; + const parameter B1 = 0.156632; + const parameter B2 = 0.12083; + const parameter B3 = 0.5; + const parameter B4 = MU * MU / K1 - 0.112654; + + const parameter ALPHA_GE = 20.0 / 27.0 + ETA * 5.0 / 3.0; + + // Interpolation function + num oma = 1.0 - alpha; + num ief = 0.0; + if (IINTERP == 0) { + // SCAN + if (alpha < 1.0) { + ief = exp(-CFX1 * alpha / oma); + } else { + ief = -CFDX1 * exp(CFX2 / oma); + } + } else if (IINTERP == 1) { + // rSCAN + if (alpha < 1.0e-13) { + ief = exp(-CFX1 * alpha / oma); + } else if (alpha < 2.5) { + for (int i = 0; i < 8; i++) { + ief += IE_PARAMS[i] * pow(alpha, i); + } + } else { + ief = -CFDX1 * exp(CFX2 / oma); + } + } else { + printf("ERROR: Unknown IINTERP %d\n", IINTERP); + } + + // Single orbital enhancement + num h0x = 1.0 + K0; + + // Slowly varying enhancement + num p = s * s; + num del_f2 = 0.0; + num C2 = 0.0; + num h1x = 0.0; + + if (IDELFX == 0) { + // 2nd and 4th order gradient expansion corrections for SCAN interpolation + num wfac = B4 * pow2(p) * exp(-B4 * p / MU); + num vfac = B1 * p + B2 * oma * exp(-B3 * pow2(oma)); + num yfac = MU * p + wfac + pow2(vfac); + + h1x = 1.0 + K1 - K1 / (1.0 + yfac / K1); + } else if (IDELFX == 1 || IDELFX == 2) { + // 2nd order GE corrections for rSCAN interpolation + for (int i = 1; i < 8; i++) { + del_f2 += i * IE_PARAMS[i]; + } + C2 = -del_f2 * (1.0 - h0x); + + num damp = exp(-pow2(p) / pow(D_DAMP2, 4)); + h1x = 1.0 + K1 - K1 / (1.0 + p * (MU + ALPHA_GE * C2 * damp) / K1); + } else { + printf("ERROR: Unknown IDELFX %d\n", IDELFX); + } + + // Scaling correction + num gx = 1.0 - exp(-A1 / pow(p, 1.0 / 4.0)); + + // 4th order gradient enhancement + num del_fx = 0.0; + if (IDELFX == 2) { + // 4th order correction for rSCAN interpolation (r4SCAN) + num eta_term = ETA * 3.0 / 4.0 + 2.0 / 3.0; + + num del_f4 = 0.0; + for (int i = 1; i < 8; i++) { + del_f4 += i * (i - 1) * IE_PARAMS[i]; + } + + num C_aa = 73.0 / 5000.0 - 0.5 * del_f4 * (h0x - 1.0); + num C_pa = 511.0 / 13500 - 73.0 / 1500.0 * ETA - del_f2 * (ALPHA_GE * C2 + MU); + num C_pp = 146.0 / 2025.0 * pow2(eta_term) - 73.0 / 405.0 * eta_term + + pow2(ALPHA_GE * C2 + MU) / K1; + + num order_1 = C2 * (oma - ALPHA_GE * p); + num t1 = order_1 + C_aa * pow2(oma) + C_pa * p * oma + C_pp * pow2(p); + + num damp_4_t1 = 2.0 * pow2(alpha) / (1.0 + pow(alpha, 4)); + num damp_4_t2 = + exp(-pow2(oma) / pow2(DX_DAMP4_A) - pow2(p) / pow(DX_DAMP4_P, 4)); + num damp_4 = damp_4_t1 * damp_4_t2; + + del_fx = t1 * damp_4; + } + + num fx = (h1x + ief * (h0x - h1x) + del_fx) * gx; + + return fx; +} + +template <class num> +static num SCAN_C(const densvars<num> & d, + const int IALPHA, + const int IINTERP, + const int IDELEC) { + + const parameter CFC1 = 0.64; + const parameter CFC2 = 1.5; + const parameter CFDC1 = 0.7; + const parameter IE_PARAMS[8] = {1.0, + -0.64, + -0.4352, + -1.535685604549, + 3.061560252175, + -1.915710236206, + 0.516884468372, + -0.051848879792}; + + const parameter ETA = 1.0e-3; + const parameter TAU_R = 1.0e-4; + const parameter A_REG = 1.0e-3; + + const parameter B1C = 0.0285764; + const parameter B2C = 0.0889; + const parameter B3C = 0.125541; + + num rs = pow(4.0 * PI * d.n / 3.0, -(1.0 / 3.0)); + num sqrtrs = 0.0; + if (abs(rs) > 1.0e-16) { + sqrtrs = sqrt(rs); + } + + num ds_z = ufunc(d.zeta, 5.0 / 3.0) / 2.0; + + num s = sqrt(d.gnn) / (2.0 * pow(3.0 * PI2, 1.0 / 3.0) * pow(d.n, 4.0 / 3.0)); + + num tueg_con = 3.0 / 10.0 * pow(3.0 * PI2, 2.0 / 3.0); + num tueg = 0.0; + if (IALPHA == 1) { + tueg = (tueg_con * pow(d.n, 5.0 / 3.0) + TAU_R) * ds_z; + } else { + tueg = tueg_con * pow(d.n, 5.0 / 3.0) * ds_z; + } + + num tauw = d.gnn / (8.0 * d.n); + + num alpha = 0.0; + if (IALPHA == 0) { + // alpha (SCAN) + if (abs(d.tau - tauw) > 1.0e-14) { + alpha = (d.tau - tauw) / tueg; + } + + } else if (IALPHA == 1) { + // alpha' (rSCAN) + alpha = (d.tau - tauw) / tueg; + alpha = pow(alpha, 3) / (pow2(alpha) + A_REG); + + } else if (IALPHA == 2) { + // \bar{alpha} (r2SCAN, r4SCAN) + if (abs(d.tau - tauw) > 1.0e-14) { + alpha = (d.tau - tauw) / (tueg + ETA * tauw); + } + + } else { + // Unknown IALPHA choice + printf("ERROR: Unknown IALPHA %d\n", IALPHA); + } + + // Interpolation function + num oma = 1.0 - alpha; + num ief = 0.0; + if (IINTERP == 0) { + // SCAN + if (alpha < 1.0) { + ief = exp(-CFC1 * alpha / oma); + } else { + ief = -CFDC1 * exp(CFC2 / oma); + } + } else if (IINTERP == 1) { + // rSCAN + if (alpha < 1.0e-13) { + ief = exp(-CFC1 * alpha / oma); + } else if (alpha < 2.5) { + for (int i = 0; i < 8; i++) { + ief += IE_PARAMS[i] * pow(alpha, i); + } + } else { + ief = -CFDC1 * exp(CFC2 / oma); + } + } else { + printf("ERROR: Unknown IINTERP %d\n", IINTERP); + } + + num ec0 = scan_ec0(rs, s, d.zeta, B1C, B2C, B3C); + num ec1 = scan_ec1(rs, s, d.zeta, IE_PARAMS, ETA, B1C, B2C, B3C, IDELEC); + + num eps_c = (ec1 + ief * (ec0 - ec1)) * d.n; + + return eps_c; +} + +template <class num> +static num scan_ec0(const num rs, + const num s, + const num zeta, + const parameter B1C, + const parameter B2C, + const parameter B3C) { + const parameter CHI_LD = 0.12802585262625815; + + num eclda = lda_0(rs, B1C, B2C, B3C); + + num dx_z = ufunc(zeta, 4.0 / 3.0) / 2.0; + num gc_z = (1.0 - 2.363 * (dx_z - 1.0)) * (1 - pow(zeta, 12)); + + num w0 = exp(-eclda / B1C) - 1.0; + + num ginf = 1.0 / pow(1.0 + 4.0 * CHI_LD * s * s, 1.0 / 4.0); + + num h0 = B1C * log(1.0 + w0 * (1.0 - ginf)); + + return (eclda + h0) * gc_z; +} + +template <class num> +static num lda_0(const num rs, + const parameter B1C, + const parameter B2C, + const parameter B3C) { + + return -B1C / (1.0 + B2C * sqrt(rs) + B3C * rs); +} + +template <class num> +static num scan_ec1(const num rs, + const num s, + const num zeta, + const parameter IE_PARAMS[8], + const parameter ETA, + const parameter B1C, + const parameter B2C, + const parameter B3C, + const int IDELEC) { + const parameter BETA_MB = 0.066725; + const parameter AFACTOR = 0.1; + const parameter BFACTOR = 0.1778; + const parameter GAMMA = 0.031090690869655; + const parameter AFIX_T = sqrt(PI / 4.0) * pow(9.0 * PI / 4.0, 1.0 / 6.0); + const parameter D_DAMP2 = 0.361; + + num dx_z = ufunc(zeta, 4.0 / 3.0) / 2.0; + num gc_z = (1.0 - 2.363 * (dx_z - 1.0)) * (1 - pow(zeta, 12)); + num phi = ufunc(zeta, 2.0 / 3.0) / 2.0; + num phi3 = pow(phi, 3); + + num sqrtrs = sqrt(rs); + + num eclda0 = lda_0(rs, B1C, B2C, B3C); + + num eclsda1 = 0.0; + num d_eclsda1_drs = 0.0; + get_lsda1(rs, sqrtrs, zeta, eclsda1, d_eclsda1_drs); + + num t = AFIX_T * s / (sqrtrs * phi); + + num w1 = exp(-eclsda1 / (GAMMA * phi3)) - 1.0; + + num beta = BETA_MB * (1.0 + AFACTOR * rs) / (1.0 + BFACTOR * rs); + num y = beta / (GAMMA * w1) * pow2(t); + + num del_y = 0.0; + if (IDELEC == 0) { + // No correction for 2nd order GE in correlation (SCAN) + del_y = 0.0; + } else if (IDELEC == 1 || IDELEC == 2) { + // correcting terms for 2nd order GE with rSCAN interpolation + // Note that IDELEC = 1 is identical to 2 + + num p = s * s; + num ds_z = ufunc(zeta, 5.0 / 3.0) / 2.0; + + num del_f2 = 0.0; + for (int i = 1; i < 8; i++) { + del_f2 += i * IE_PARAMS[i]; + } + + num eclsda0 = eclda0 * gc_z; + num d_eclsda0_drs = gc_z * (B3C + B2C / (2.0 * sqrtrs)) * pow2(eclda0) / B1C; + + num t1 = del_f2 / (27.0 * GAMMA * ds_z * phi3 * w1); + num t2 = 20.0 * rs * (d_eclsda0_drs - d_eclsda1_drs); + num t3 = 45.0 * ETA * (eclsda0 - eclsda1); + + num k = t1 * (t2 - t3); + + num damp = exp(-pow2(p) / pow(D_DAMP2, 4)); + + del_y = k * p * damp; + } else { + printf("ERROR: Unrecognised IDELEC %d\n", IDELEC); + } + + num g_y = 1.0 / pow(1.0 + 4.0 * (y - del_y), 1.0 / 4.0); + + num h1 = GAMMA * phi3 * log(1.0 + w1 * (1.0 - g_y)); + + return eclsda1 + h1; +} + +template <class num> +static void get_lsda1(const num rs, + const num sqrtrs, + const num zeta, + num & eclda1, + num & d_eclda1_drs) { + const parameter GAM = 0.51984209978974632953442121455650; + const parameter FZZ = 8.0 / (9.0 * GAM); + const parameter p_eu[6] = { + 0.03109070, 0.213700, 7.59570, 3.58760, 1.63820, 0.492940}; + const parameter p_ep[6] = { + 0.015545350, 0.205480, 14.11890, 6.19770, 3.36620, 0.625170}; + const parameter p_alfm[6] = { + 0.01688690, 0.111250, 10.3570, 3.62310, 0.880260, 0.496710}; + + num eu = 0.0; + num deudrs = 0.0; + gcor2(p_eu, rs, sqrtrs, eu, deudrs); + num ep = 0.0; + num depdrs = 0.0; + gcor2(p_ep, rs, sqrtrs, ep, depdrs); + num alfm = 0.0; + num dalfmdrs = 0.0; + gcor2(p_alfm, rs, sqrtrs, alfm, dalfmdrs); + + num z3 = pow(zeta, 3); + num z4 = zeta * z3; + + num f = (ufunc(zeta, 4.0 / 3.0) - 2.0) / GAM; + + eclda1 = eu * (1.0 - f * z4) + ep * f * z4 - alfm * f * (1.0 - z4) / FZZ; + d_eclda1_drs = + (1.0 - z4 * f) * deudrs + z4 * f * depdrs - (1.0 - z4) * f * dalfmdrs / FZZ; + return; +} + +template <class num> +static void gcor2(const parameter P[6], + const num rs, + const num sqrtrs, + num & GG, + num & GGRS) { + enum IDX { A, A1, B1, B2, B3, B4 }; + + num Q0 = -2.0 * P[A] * (1.0 + P[A1] * rs); + num Q0RS = -2.0 * P[A] * P[A1]; + + num Q1 = 2.0 * P[A] * sqrtrs * + (P[B1] + sqrtrs * (P[B2] + sqrtrs * (P[B3] + P[B4] * sqrtrs))); + num Q1RS = P[A] * (2.0 * P[B2] + P[B1] / sqrtrs + 3.0 * P[B3] * sqrtrs + + 4.0 * P[B4] * rs); + + num Q2 = log(1.0 + 1.0 / Q1); + num Q2RS = -Q1RS / ((1.0 + 1.0 / Q1) * pow2(Q1)); + + GG = Q0 * Q2; + GGRS = Q0 * Q2RS + Q2 * Q0RS; + return; +} +} // namespace SCAN_eps diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/SCANc.cpp new/xcfun-2.1.0/src/functionals/SCANc.cpp --- old/xcfun-2.0.2/src/functionals/SCANc.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/SCANc.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,43 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num SCANC(const densvars<num> & d) { + num eps_c = SCAN_eps::SCAN_C(d, 0, 0, 0); + + return eps_c; +} + +FUNCTIONAL(XC_SCANC) = { + "SCAN correlation functional", + "SCAN correlation functional.\n" + "J. Sun, A. Ruzsinszky, and J. P. Perdew, Phys. Rev. Lett. 115, 036402 (2015)." + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(SCANC) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-7.42689151900e-03, + -1.91882337268e-02, + -6.34666733088e-02, + 1.08870558794e-02, + 2.17741117588e-02, + 1.08870558794e-02, + -1.76437503720e-02, + -1.76437503720e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/SCANx.cpp new/xcfun-2.1.0/src/functionals/SCANx.cpp --- old/xcfun-2.0.2/src/functionals/SCANx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/SCANx.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,49 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num SCANX(const densvars<num> & d) { + num Fx_a; + num Fx_b; + Fx_a = SCAN_eps::get_SCAN_Fx(2.0 * d.a, 4.0 * d.gaa, 2.0 * d.taua, 0, 0, 0); + num epsxunif_a = SCAN_eps::fx_unif(2 * d.a); + Fx_b = SCAN_eps::get_SCAN_Fx(2.0 * d.b, 4.0 * d.gbb, 2.0 * d.taub, 0, 0, 0); + num epsxunif_b = SCAN_eps::fx_unif(2 * d.b); + + return 0.5 * (Fx_a * epsxunif_a + Fx_b * epsxunif_b); +} + +FUNCTIONAL(XC_SCANX) = { + "SCAN exchange functional", + "SCAN exchange functional.\n" + "Strongly constrained and appropriately normed functional\n" + "J. Sun, A. Ruzsinszky, and J. P. Perdew, Phys. Rev. Lett. 115, 036402 (2015)." + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(SCANX) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-1.62177290711e-01, + -8.67282272330e-01, + -5.58386982606e-01, + -4.08961346066e-02, + 0.00000000000e+00, + -9.83984390668e-02, + 6.55853126427e-02, + 5.18444044761e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/aliases.cpp new/xcfun-2.1.0/src/functionals/aliases.cpp --- old/xcfun-2.0.2/src/functionals/aliases.cpp 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/src/functionals/aliases.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -130,6 +130,11 @@ {"tw", "von Weizsacker correction to be put in effective potential.", {{"tw", 1.0}}}, + {"scan", "Strongly Constrained and Appropriately Normed", {{"scanx", 1.0}, {"scanc", 1.0}}}, + {"rscan", "regularised Strongly Constrained and Appropriately Normed", {{"rscanx", 1.0}, {"rscanc", 1.0}}}, + {"rppscan", "regularised-improved Strongly Constrained and Appropriately Normed", {{"rppscanx", 1.0}, {"rppscanc", 1.0}}}, + {"r2scan", "regularised-restored Strongly Constrained and Appropriately Normed", {{"r2scanx", 1.0}, {"r2scanc", 1.0}}}, + {"r4scan", "4th order regularised-restored Strongly Constrained and Appropriately Normed", {{"r4scanx", 1.0}, {"r4scanc", 1.0}}} }; struct alias_data * xcint_aliases = aliases_array; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/list_of_functionals.hpp new/xcfun-2.1.0/src/functionals/list_of_functionals.hpp --- old/xcfun-2.0.2/src/functionals/list_of_functionals.hpp 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/src/functionals/list_of_functionals.hpp 2020-09-18 14:14:48.000000000 +0200 @@ -60,6 +60,16 @@ XC_TPSSX, XC_REVTPSSC, XC_REVTPSSX, + XC_SCANC, + XC_SCANX, + XC_RSCANC, + XC_RSCANX, + XC_RPPSCANC, + XC_RPPSCANX, + XC_R2SCANC, + XC_R2SCANX, + XC_R4SCANC, + XC_R4SCANX, XC_PZ81C, XC_P86C, XC_P86CORRC, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/r2SCANc.cpp new/xcfun-2.1.0/src/functionals/r2SCANc.cpp --- old/xcfun-2.0.2/src/functionals/r2SCANc.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/r2SCANc.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,44 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num r2SCANC(const densvars<num> & d) { + num eps_c = SCAN_eps::SCAN_C(d, 2, 1, 1); + + return eps_c; +} + +FUNCTIONAL(XC_R2SCANC) = {"r2SCAN correlation functional", + "r2SCAN correlation functional.\n" + "Restored-Regularised SCAN functional\n" + "J Furness, A Kaplan, J Ning, J Perdew, & J Sun; J. Chem. " + "Phys. Lett.; Accepted (DOI: 10.1021/acs.jpclett.0c02405)" + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(r2SCANC) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-7.52536253477e-03, + -1.99923310008e-02, + -6.45082284064e-02, + 1.10376734989e-02, + 2.20753469977e-02, + 1.10376734989e-02, + -1.76333423096e-02, + -1.76333423096e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/r2SCANx.cpp new/xcfun-2.1.0/src/functionals/r2SCANx.cpp --- old/xcfun-2.0.2/src/functionals/r2SCANx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/r2SCANx.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,49 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num r2SCANX(const densvars<num> & d) { + num Fx_a; + num Fx_b; + Fx_a = SCAN_eps::get_SCAN_Fx(2.0 * d.a, 4.0 * d.gaa, 2.0 * d.taua, 2, 1, 1); + num epsxunif_a = SCAN_eps::fx_unif(2 * d.a); + Fx_b = SCAN_eps::get_SCAN_Fx(2.0 * d.b, 4.0 * d.gbb, 2.0 * d.taub, 2, 1, 1); + num epsxunif_b = SCAN_eps::fx_unif(2 * d.b); + + return 0.5 * (Fx_a * epsxunif_a + Fx_b * epsxunif_b); +} + +FUNCTIONAL(XC_R2SCANX) = {"r2SCAN exchange functional", + "r2SCAN exchange functional.\n" + "Restored-Regularised SCAN functional\n" + "J Furness, A Kaplan, J Ning, J Perdew, & J Sun; J. Chem. " + "Phys. Lett.; Accepted (DOI: 10.1021/acs.jpclett.0c02405)" + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(r2SCANX) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-1.62076202284e-01, + -8.60008389872e-01, + -5.57023311096e-01, + -3.79265043692e-02, + 0.00000000000e+00, + -1.04606093722e-01, + 5.89149529531e-02, + 5.50319523444e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/r4SCANc.cpp new/xcfun-2.1.0/src/functionals/r4SCANc.cpp --- old/xcfun-2.0.2/src/functionals/r4SCANc.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/r4SCANc.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,43 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num r4SCANC(const densvars<num> & d) { + num eps_c = SCAN_eps::SCAN_C(d, 2, 1, 2); + + return eps_c; +} + +FUNCTIONAL(XC_R4SCANC) = {"r4SCAN correlation functional", + "Equivalent to r2SCAN correlation functional.\n" + "Restored-Regularised fourt order SCAN functional\n" + "J Furness, in preparation" + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(r4SCANC) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-7.52536253477e-03, + -1.99923310008e-02, + -6.45082284064e-02, + 1.10376734989e-02, + 2.20753469977e-02, + 1.10376734989e-02, + -1.76333423096e-02, + -1.76333423096e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/r4SCANx.cpp new/xcfun-2.1.0/src/functionals/r4SCANx.cpp --- old/xcfun-2.0.2/src/functionals/r4SCANx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/r4SCANx.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,48 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num r4SCANX(const densvars<num> & d) { + num Fx_a; + num Fx_b; + Fx_a = SCAN_eps::get_SCAN_Fx(2.0 * d.a, 4.0 * d.gaa, 2.0 * d.taua, 2, 1, 2); + num epsxunif_a = SCAN_eps::fx_unif(2 * d.a); + Fx_b = SCAN_eps::get_SCAN_Fx(2.0 * d.b, 4.0 * d.gbb, 2.0 * d.taub, 2, 1, 2); + num epsxunif_b = SCAN_eps::fx_unif(2 * d.b); + + return 0.5 * (Fx_a * epsxunif_a + Fx_b * epsxunif_b); +} + +FUNCTIONAL(XC_R4SCANX) = {"r4SCAN exchange functional", + "r4SCAN exchange functional.\n" + "Restored-Regularised fourth order SCAN functional\n" + "J Furness, in preparation" + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(r4SCANX) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-1.62076202198e-01, + -8.60008367983e-01, + -5.57023311096e-01, + -3.79265181913e-02, + 0.00000000000e+00, + -1.04606093722e-01, + 5.89149583569e-02, + 5.50319523444e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/rSCANc.cpp new/xcfun-2.1.0/src/functionals/rSCANc.cpp --- old/xcfun-2.0.2/src/functionals/rSCANc.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/rSCANc.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,44 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num rSCANC(const densvars<num> & d) { + num eps_c = SCAN_eps::SCAN_C(d, 1, 1, 0); + + return eps_c; +} + +FUNCTIONAL(XC_RSCANC) = { + "rSCAN correlation functional", + "rSCAN correlation functional.\n" + "Regularised SCAN functional\n" + "A. P. Bartok and J. R. Yates, J. Chem. Phys. 150, 161101 (2019)." + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(rSCANC) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-7.50556494224e-03, + -1.96870403236e-02, + -6.41852283218e-02, + 1.09960132228e-02, + 2.19920264457e-02, + 1.09960132228e-02, + -1.76965520905e-02, + -1.76965520905e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/rSCANx.cpp new/xcfun-2.1.0/src/functionals/rSCANx.cpp --- old/xcfun-2.0.2/src/functionals/rSCANx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/rSCANx.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,49 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num rSCANX(const densvars<num> & d) { + num Fx_a; + num Fx_b; + Fx_a = SCAN_eps::get_SCAN_Fx(2.0 * d.a, 4.0 * d.gaa, 2.0 * d.taua, 1, 1, 0); + num epsxunif_a = SCAN_eps::fx_unif(2 * d.a); + Fx_b = SCAN_eps::get_SCAN_Fx(2.0 * d.b, 4.0 * d.gbb, 2.0 * d.taub, 1, 1, 0); + num epsxunif_b = SCAN_eps::fx_unif(2 * d.b); + + return 0.5 * (Fx_a * epsxunif_a + Fx_b * epsxunif_b); +} + +FUNCTIONAL(XC_RSCANX) = { + "rSCAN exchange functional", + "rSCAN exchange functional.\n" + "Regularised SCAN functional\n" + "A. P. Bartok and J. R. Yates, J. Chem. Phys. 150, 161101 (2019)." + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(rSCANX) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-1.62495194787e-01, + -8.63571918470e-01, + -5.57161075215e-01, + -3.59375593614e-02, + 0.00000000000e+00, + -1.08233529563e-01, + 5.72375010611e-02, + 5.69395908684e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/rppSCANc.cpp new/xcfun-2.1.0/src/functionals/rppSCANc.cpp --- old/xcfun-2.0.2/src/functionals/rppSCANc.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/rppSCANc.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,43 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num rppSCANC(const densvars<num> & d) { + num eps_c = SCAN_eps::SCAN_C(d, 2, 1, 0); + + return eps_c; +} + +FUNCTIONAL(XC_RPPSCANC) = {"r++SCAN correlation functional", + "r++SCAN correlation functional.\n" + "Restored-Regularised SCAN functional\n" + "J Furness, in preparation" + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(rppSCANC) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-7.52313999333e-03, + -1.98575241135e-02, + -6.43444019823e-02, + 1.09821296406e-02, + 2.19642592812e-02, + 1.09821296406e-02, + -1.76156638566e-02, + -1.76156638566e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/functionals/rppSCANx.cpp new/xcfun-2.1.0/src/functionals/rppSCANx.cpp --- old/xcfun-2.0.2/src/functionals/rppSCANx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xcfun-2.1.0/src/functionals/rppSCANx.cpp 2020-09-18 14:14:48.000000000 +0200 @@ -0,0 +1,48 @@ +/* + * XCFun, an arbitrary order exchange-correlation library + * Copyright (C) 2020 Ulf Ekström and contributors. + * + * This file is part of XCFun. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * For information on the complete list of contributors to the + * XCFun library, see: <https://xcfun.readthedocs.io/> + */ + +#include "SCAN_like_eps.hpp" +#include "constants.hpp" +#include "functional.hpp" + +template <class num> static num rppSCANX(const densvars<num> & d) { + num Fx_a; + num Fx_b; + Fx_a = SCAN_eps::get_SCAN_Fx(2.0 * d.a, 4.0 * d.gaa, 2.0 * d.taua, 2, 1, 0); + num epsxunif_a = SCAN_eps::fx_unif(2 * d.a); + Fx_b = SCAN_eps::get_SCAN_Fx(2.0 * d.b, 4.0 * d.gbb, 2.0 * d.taub, 2, 1, 0); + num epsxunif_b = SCAN_eps::fx_unif(2 * d.b); + + return 0.5 * (Fx_a * epsxunif_a + Fx_b * epsxunif_b); +} + +FUNCTIONAL(XC_RPPSCANX) = {"r++SCAN exchange functional", + "r++SCAN exchange functional.\n" + "Early Restored-Regularised SCAN functional\n" + "J Furness, in preparation" + "Implemented by James Furness (@JFurness1)\n", + XC_DENSITY | XC_GRADIENT | XC_KINETIC, + ENERGY_FUNCTION(rppSCANX) XC_A_B_GAA_GAB_GBB_TAUA_TAUB, + XC_PARTIAL_DERIVATIVES, + 1, + 1e-11, + {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328}, + {-1.62422140833e-01, + -8.63058918283e-01, + -5.58294304642e-01, + -3.58443838214e-02, + 0.00000000000e+00, + -9.88320884046e-02, + 5.70095454667e-02, + 5.20592592676e-02}}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/src/version_info.hpp new/xcfun-2.1.0/src/version_info.hpp --- old/xcfun-2.0.2/src/version_info.hpp 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/src/version_info.hpp 2020-09-18 14:14:48.000000000 +0200 @@ -16,8 +16,8 @@ namespace xcfun { constexpr auto PROJECT_VERSION_MAJOR = 2; -constexpr auto PROJECT_VERSION_MINOR = 0; -constexpr auto PROJECT_VERSION_PATCH = 2; +constexpr auto PROJECT_VERSION_MINOR = 1; +constexpr auto PROJECT_VERSION_PATCH = 0; constexpr auto XCFun_VERSION = ((PROJECT_VERSION_MAJOR << 16) | PROJECT_VERSION_MINOR | PROJECT_VERSION_PATCH); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcfun-2.0.2/tests/CMakeLists.txt new/xcfun-2.1.0/tests/CMakeLists.txt --- old/xcfun-2.0.2/tests/CMakeLists.txt 2020-07-15 18:31:29.000000000 +0200 +++ new/xcfun-2.1.0/tests/CMakeLists.txt 2020-09-18 14:14:48.000000000 +0200 @@ -21,11 +21,12 @@ test_xcfun.py ) foreach(_file IN LISTS _pytest_files) - add_custom_target(symlink_${_file} ALL - COMMAND - ${CMAKE_COMMAND} -E create_symlink + file( + CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${PROJECT_BINARY_DIR}/${PYMOD_INSTALL_FULLDIR}/../${_file} + COPY_ON_ERROR + SYMBOLIC ) endforeach()