Skip to content

Commit

Permalink
Version 3.1.1
Browse files Browse the repository at this point in the history
Fix bug in (py, pz, px) order
  • Loading branch information
sunqm committed Aug 26, 2020
1 parent 0e842ea commit 995e017
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 8 deletions.
32 changes: 28 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
cmake_minimum_required (VERSION 2.6)
project (qcint C)
set(qcint_VERSION "3.1.0")
set(qcint_SOVERSION "3")

set(qcint_VERSION_MAJOR "3")
set(qcint_VERSION_MINOR "1")
set(qcint_VERSION_PATCH "1")
set(qcint_VERSION_TWEAK "0")
set(qcint_VERSION "${qcint_VERSION_MAJOR}.${qcint_VERSION_MINOR}.${qcint_VERSION_PATCH}")
set(qcint_SOVERSION "${qcint_VERSION_MAJOR}")

#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 -DNDEBUG")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE RELWITHDEBINFO)
endif()
Expand All @@ -15,6 +20,7 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -funroll-loops -ftree-vectorize -ffast-math")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-math-errno -fno-strict-overflow -fomit-frame-pointer")
endif()
message("${CMAKE_C_FLAGS}")


if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.3)
Expand Down Expand Up @@ -97,9 +103,27 @@ endif(WITH_GTG)

if(PYPZPX)
add_definitions(-DPYPZPX)
message("P orbitals are sorted to (py, pz, px)")
message("P orbitals convention (py, pz, px)")
else()
message("P orbitals convention (px, py, pz)")
endif(PYPZPX)

option(WITH_FORTRAN "Fortran interface" on)
if(WITH_FORTRAN)
add_definitions(-DWITH_FORTRAN)
message("Enable Fortran interface")
else()
message("Exclude Fortran interface")
endif(WITH_FORTRAN)

option(WITH_CINT2_INTERFACE "Old libcint (version 2) interface" on)
if(WITH_CINT2_INTERFACE)
add_definitions(-DWITH_CINT2_INTERFACE)
message("Enable old cint (version 2) interface")
else()
message("Exclude old cint (version 2) interface")
endif(WITH_CINT2_INTERFACE)

option(BUILD_SHARED_LIBS "build shared libraries" 1)
option(ENABLE_STATIC "Enforce static library build" 0)
if(ENABLE_STATIC)
Expand Down
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Version 3.1.1 (2020-08-25):
* Fix bug in (py, pz, px) order
Version 3.1.0 (2020-08-25):
* Add convention py, pz, px
Version 3.0.19 (2019-11-30):
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ qcint (quick libcint)

An optimized libcint branch for X86 platform

version 3.1.0
version 3.1.1

2020-08-25

Expand Down
2 changes: 2 additions & 0 deletions src/c2f.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* c to fortran interface
*/

#ifdef WITH_FORTRAN
#include <stdlib.h>
#include <math.h>
#include "cint_bas.h"
Expand Down Expand Up @@ -178,3 +179,4 @@ void cintdel_optimizer_(CINTOptPtrAsInteger8 *optptr)
cintdel_2e_optimizer_(optptr);
}
*/
#endif
8 changes: 8 additions & 0 deletions src/c2f.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifdef WITH_FORTRAN
#define ALL_CINT_FORTRAN_(NAME) \
int c##NAME##_sph_(double *out, int *shls, int *atm, int *natm, \
int *bas, int *nbas, double *env, size_t optptr_as_integer8) { \
Expand Down Expand Up @@ -67,3 +68,10 @@ int c##NAME##_(double *out, int *shls, int *atm, int *natm, \
return NAME##_spinor((double complex *)out, NULL, shls, \
atm, *natm, bas, *nbas, env, NULL, NULL); \
}

#else

#define ALL_CINT_FORTRAN_(NAME)
#define ALL_CINT1E_FORTRAN_(NAME)

#endif
16 changes: 13 additions & 3 deletions src/cart2sph.c
Original file line number Diff line number Diff line change
Expand Up @@ -2933,9 +2933,9 @@ static double *p_bra_cart2spheric(double *gsph, int nket, double *gcart, int l)
#ifdef PYPZPX
int i;
for (i = 0; i < nket; i++) {
gsph[i*nket+0] = gcart[i*nket+1]; // py
gsph[i*nket+1] = gcart[i*nket+2]; // pz
gsph[i*nket+2] = gcart[i*nket+0]; // px
gsph[i*3+0] = gcart[i*3+1]; // py
gsph[i*3+1] = gcart[i*3+2]; // pz
gsph[i*3+2] = gcart[i*3+0]; // px
}
return gsph;
#else
Expand Down Expand Up @@ -8255,8 +8255,18 @@ static double *sph2e_inner(double *gsph, double *gcart,
{
int n;
switch (l) {
#ifdef PYPZPX
case 0:
return gcart;
case 1:
for (n = 0; n < ncall; n++) {
p_ket_cart2spheric(gsph+n*sizsph, gcart+n*sizcart, nbra, nbra, l);
}
break;
#else
case 0: case 1:
return gcart;
#endif
case 2:
for (n = 0; n < ncall; n++) {
d_ket_cart2spheric(gsph+n*sizsph, gcart+n*sizcart, nbra, nbra, l);
Expand Down
8 changes: 8 additions & 0 deletions src/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ double CINTsquare_dist(const double *r1, const double *r2);
double CINTgto_norm(int n, double a);


#ifdef WITH_CINT2_INTERFACE
#define ALL_CINT(NAME) \
int c##NAME##_cart(double *out, int *shls, int *atm, int natm, \
int *bas, int nbas, double *env, CINTOpt *opt) { \
Expand Down Expand Up @@ -79,3 +80,10 @@ int c##NAME(double *out, int *shls, int *atm, int natm, \
return NAME##_spinor((double complex *)out, NULL, shls, \
atm, natm, bas, nbas, env, NULL, NULL); \
}

#else

#define ALL_CINT(NAME)
#define ALL_CINT1E(NAME)

#endif // WITH_CINT2_INTERFACE

0 comments on commit 995e017

Please sign in to comment.