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 bb56c18 commit abf6948
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 7 deletions.
22 changes: 20 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6)
project (cint C)
set(cint_VERSION_MAJOR "3")
set(cint_VERSION_MINOR "1")
set(cint_VERSION_PATCH "0")
set(cint_VERSION_PATCH "1")
set(cint_VERSION_TWEAK "0")
set(cint_VERSION "${cint_VERSION_MAJOR}.${cint_VERSION_MINOR}.${cint_VERSION_PATCH}")
set(cint_SOVERSION "${cint_VERSION_MAJOR}")
Expand Down Expand Up @@ -94,9 +94,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_EXAMPLE "build examples" 0)
option(ENABLE_TEST "build tests" 0)
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.20 (2020-05-13):
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
libcint
=======

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 @@ -4,6 +4,7 @@
* c to fortran interface
*/

#ifdef WITH_FORTRAN
#include <stdlib.h>
#include <math.h>
#include "cint_bas.h"
Expand Down Expand Up @@ -146,3 +147,4 @@ void cintdel_optimizer_(CINTOpt **opt)
{
cintdel_2e_optimizer_(opt);
}
#endif
8 changes: 8 additions & 0 deletions src/c2f.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
*/

#ifdef WITH_FORTRAN
#include "config.h"

#define ALL_CINT_FORTRAN_(NAME) \
Expand Down Expand Up @@ -54,3 +55,10 @@ FINT c##NAME##_(double *out, FINT *shls, FINT *atm, FINT *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
17 changes: 13 additions & 4 deletions src/cart2sph.c
Original file line number Diff line number Diff line change
Expand Up @@ -2993,12 +2993,11 @@ static double *s_ket_cart2spheric1(double *gsph, double *gcart,
static double *p_bra_cart2spheric(double *gsph, FINT nket, double *gcart, FINT l)
{
#ifdef PYPZPX
double *pgcart = gcart;
FINT 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 @@ -8135,8 +8134,18 @@ static double *sph2e_inner(double *gsph, double *gcart,
{
FINT 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 @@ -26,6 +26,7 @@ double CINTgto_norm(FINT n, double a);
var = (dtype *)(cache); \
cache = (double *)(var + n);

#ifdef WITH_CINT2_INTERFACE
#define ALL_CINT(NAME) \
FINT c##NAME##_cart(double *out, FINT *shls, FINT *atm, FINT natm, \
FINT *bas, FINT nbas, double *env, CINTOpt *opt) { \
Expand Down Expand Up @@ -68,3 +69,10 @@ FINT c##NAME(double *out, FINT *shls, FINT *atm, FINT 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 abf6948

Please sign in to comment.