-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
438 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
libcint/ | ||
workdir/ | ||
testsdir/ | ||
venv/ | ||
*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
sizeof(FINT)=4 | ||
ibas=0 (N=1), jbas=0 (N=1) | ||
1.00000 | ||
ibas=1 (N=1), jbas=0 (N=1) | ||
0.23670 | ||
ibas=1 (N=1), jbas=1 (N=1) | ||
1.00000 | ||
ibas=2 (N=3), jbas=0 (N=1) | ||
0.00000 | ||
0.00000 0.00000 | ||
0.00000 0.00000 0.00000 | ||
ibas=2 (N=3), jbas=1 (N=1) | ||
0.00000 | ||
0.00000 0.00000 | ||
0.00000 0.00000 0.00000 | ||
ibas=2 (N=3), jbas=2 (N=3) | ||
1.00000 | ||
0.00000 1.00000 | ||
0.00000 0.00000 1.00000 | ||
ibas=3 (N=1), jbas=0 (N=1) | ||
0.05255 | ||
ibas=3 (N=1), jbas=1 (N=1) | ||
0.46742 | ||
ibas=3 (N=1), jbas=2 (N=3) | ||
0.00000 | ||
ibas=3 (N=1), jbas=3 (N=1) | ||
1.00000 | ||
ibas=4 (N=1), jbas=0 (N=1) | ||
0.05255 | ||
ibas=4 (N=1), jbas=1 (N=1) | ||
0.46742 | ||
ibas=4 (N=1), jbas=2 (N=3) | ||
0.00000 | ||
ibas=4 (N=1), jbas=3 (N=1) | ||
0.24822 | ||
ibas=4 (N=1), jbas=4 (N=1) | ||
1.00000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include <cint_funcs.h> | ||
|
||
int main() { | ||
printf("sizeof(FINT)=%ld\n", sizeof(FINT)); | ||
|
||
/* water, STO-3G USING | ||
```c | ||
printf("int atm[%d =%d*6 ] = {\n", bs->natm * 6, bs->natm); | ||
for (int iatm = 0; iatm < bs->natm; ++iatm) { | ||
printf(" "); | ||
for (int ipos = 0; ipos < 6; ++ipos) | ||
printf("%d,", bs->atm[iatm * 6 + ipos]); | ||
printf("\n"); | ||
} | ||
printf("};\n"); | ||
printf("int bas[%d =%d*8] = {\n", bs->nbas * 8, bs->nbas); | ||
for (int ibas = 0; ibas < bs->nbas; ++ibas) { | ||
printf(" "); | ||
for (int ipos = 0; ipos < 8; ++ipos) | ||
printf("%d,", bs->bas[ibas * 8 + ipos]); | ||
printf("\n"); | ||
} | ||
printf("};\n"); | ||
printf("double env[%ld] = {\n", bs->env_size); | ||
for(size_t ipos=0; ipos < bs->env_size; ipos++) { | ||
printf("%f,", bs->env[ipos]); | ||
} | ||
printf("};\n"); | ||
``` | ||
*/ | ||
|
||
FINT natm = 3; | ||
FINT atm[18 /* =3*6 */] = { | ||
8,20,0,0,0,0, | ||
1,23,0,0,0,0, | ||
1,26,0,0,0,0, | ||
}; | ||
|
||
FINT nbas = 5; | ||
FINT bas[40 /* =5*8 */] = { | ||
0,0,6,1,0,29,50,0, | ||
0,0,6,1,0,35,56,0, | ||
0,1,3,1,0,41,62,0, | ||
1,0,3,1,0,44,65,0, | ||
2,0,3,1,0,47,68,0, | ||
}; | ||
double env[71] = { | ||
/* twenty zeros */ .0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0, | ||
/* pos O */ .0,.0,0.226017, | ||
/* pos H1 */ .0,1.439618, -0.904064, | ||
/* pos H2 */ .0,-1.439618, -0.904064, | ||
/* 21 exponents */ | ||
/* 1st basis */ 130.709320,23.808861,6.443608,5.033151,1.169596,0.380389, | ||
/* 2nd basis */ 130.709320,23.808861,6.443608,5.033151,1.169596,0.380389, | ||
/* 3rd basis */ 5.033151,1.169596,0.380389, | ||
/* 4th basis */ 3.425251,0.623914,0.168855, | ||
/* 5th basis */ 3.425251,0.623914,0.168855, | ||
/* 21 coefs. (renormalized) */ | ||
/* 1st basis */ 15.072747,14.577702,4.543234,.0,.0,.0, | ||
/* 2nd basis */ .0,.0,.0,-0.848697,1.135201,0.856753, | ||
/* 3rd basis */ 3.429066,2.156289,0.341592, | ||
/* 4th basis */ 0.981707,0.949464,0.295906, | ||
/* 5th basis */ 0.981707,0.949464,0.295906, | ||
}; | ||
|
||
FINT si, sj; | ||
double buff[CART_MAX * CART_MAX]; | ||
|
||
for(FINT ibas=0; ibas < nbas; ibas++) { | ||
si = CINTcgtos_cart(ibas, bas); | ||
for(FINT jbas=0; jbas <= ibas; jbas++) { | ||
sj = CINTcgtos_cart(jbas, bas); | ||
int1e_ovlp_cart(buff, NULL, (FINT[]) {ibas, jbas}, atm, natm, bas, nbas, env, NULL, NULL); | ||
printf("ibas=%ld (N=%ld), jbas=%ld (N=%ld)\n", ibas, si, jbas, sj); | ||
for (FINT ielm=0; ielm < si; ielm++) { | ||
for(FINT jelm=0; jelm < ielm + 1; jelm++) | ||
printf(" %.5f", buff[ielm * si + jelm]); | ||
printf("\n"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
project('test_libcint', 'c', | ||
version : '0.1.0', | ||
default_options : ['warning_level=3'], | ||
) | ||
|
||
cc = meson.get_compiler('c') | ||
|
||
# configure dependencies | ||
project_dep = [] | ||
|
||
build_args = [ | ||
'-DPROJECT_NAME="lib' + meson.project_name() + '"', | ||
'-DPROJECT_VERSION="' + meson.project_version() + '"', | ||
] | ||
|
||
libcint_dep = cc.find_library('libcint', required: false) | ||
if not libcint_dep.found() | ||
libcint_proj = subproject('libcint', default_options: []) | ||
libcint_dep = libcint_proj.get_variable('libcint_dep') | ||
endif | ||
project_dep += libcint_dep | ||
|
||
|
||
# fetch sources and includes | ||
srcs = ['main.c'] | ||
|
||
# Executable | ||
stda_exe = executable( | ||
meson.project_name(), | ||
srcs, | ||
dependencies: project_dep, | ||
c_args : build_args, | ||
install: true | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
sizeof(FINT)=8 | ||
ibas=0 (N=1), jbas=0 (N=1) | ||
1.00000 | ||
ibas=1 (N=1), jbas=0 (N=1) | ||
0.23670 | ||
ibas=1 (N=1), jbas=1 (N=1) | ||
1.00000 | ||
ibas=2 (N=3), jbas=0 (N=1) | ||
0.00000 | ||
0.00000 0.00000 | ||
0.00000 0.00000 0.00000 | ||
ibas=2 (N=3), jbas=1 (N=1) | ||
0.00000 | ||
0.00000 0.00000 | ||
0.00000 0.00000 0.00000 | ||
ibas=2 (N=3), jbas=2 (N=3) | ||
1.00000 | ||
0.00000 1.00000 | ||
0.00000 0.00000 1.00000 | ||
ibas=3 (N=1), jbas=0 (N=1) | ||
0.05255 | ||
ibas=3 (N=1), jbas=1 (N=1) | ||
0.46742 | ||
ibas=3 (N=1), jbas=2 (N=3) | ||
0.00000 | ||
ibas=3 (N=1), jbas=3 (N=1) | ||
1.00000 | ||
ibas=4 (N=1), jbas=0 (N=1) | ||
0.05255 | ||
ibas=4 (N=1), jbas=1 (N=1) | ||
0.46742 | ||
ibas=4 (N=1), jbas=2 (N=3) | ||
0.00000 | ||
ibas=4 (N=1), jbas=3 (N=1) | ||
0.24822 | ||
ibas=4 (N=1), jbas=4 (N=1) | ||
1.00000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include <cint_funcs.h> | ||
|
||
int main() { | ||
printf("sizeof(FINT)=%ld\n", sizeof(FINT)); | ||
|
||
/* water, STO-3G USING | ||
```c | ||
printf("int atm[%d =%d*6 ] = {\n", bs->natm * 6, bs->natm); | ||
for (int iatm = 0; iatm < bs->natm; ++iatm) { | ||
printf(" "); | ||
for (int ipos = 0; ipos < 6; ++ipos) | ||
printf("%d,", bs->atm[iatm * 6 + ipos]); | ||
printf("\n"); | ||
} | ||
printf("};\n"); | ||
printf("int bas[%d =%d*8] = {\n", bs->nbas * 8, bs->nbas); | ||
for (int ibas = 0; ibas < bs->nbas; ++ibas) { | ||
printf(" "); | ||
for (int ipos = 0; ipos < 8; ++ipos) | ||
printf("%d,", bs->bas[ibas * 8 + ipos]); | ||
printf("\n"); | ||
} | ||
printf("};\n"); | ||
printf("double env[%ld] = {\n", bs->env_size); | ||
for(size_t ipos=0; ipos < bs->env_size; ipos++) { | ||
printf("%f,", bs->env[ipos]); | ||
} | ||
printf("};\n"); | ||
``` | ||
*/ | ||
|
||
FINT natm = 3; | ||
FINT atm[18 /* =3*6 */] = { | ||
8,20,0,0,0,0, | ||
1,23,0,0,0,0, | ||
1,26,0,0,0,0, | ||
}; | ||
|
||
FINT nbas = 5; | ||
FINT bas[40 /* =5*8 */] = { | ||
0,0,6,1,0,29,50,0, | ||
0,0,6,1,0,35,56,0, | ||
0,1,3,1,0,41,62,0, | ||
1,0,3,1,0,44,65,0, | ||
2,0,3,1,0,47,68,0, | ||
}; | ||
double env[71] = { | ||
/* twenty zeros */ .0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0,.0, | ||
/* pos O */ .0,.0,0.226017, | ||
/* pos H1 */ .0,1.439618, -0.904064, | ||
/* pos H2 */ .0,-1.439618, -0.904064, | ||
/* 21 exponents */ | ||
/* 1st basis */ 130.709320,23.808861,6.443608,5.033151,1.169596,0.380389, | ||
/* 2nd basis */ 130.709320,23.808861,6.443608,5.033151,1.169596,0.380389, | ||
/* 3rd basis */ 5.033151,1.169596,0.380389, | ||
/* 4th basis */ 3.425251,0.623914,0.168855, | ||
/* 5th basis */ 3.425251,0.623914,0.168855, | ||
/* 21 coefs. (renormalized) */ | ||
/* 1st basis */ 15.072747,14.577702,4.543234,.0,.0,.0, | ||
/* 2nd basis */ .0,.0,.0,-0.848697,1.135201,0.856753, | ||
/* 3rd basis */ 3.429066,2.156289,0.341592, | ||
/* 4th basis */ 0.981707,0.949464,0.295906, | ||
/* 5th basis */ 0.981707,0.949464,0.295906, | ||
}; | ||
|
||
FINT si, sj; | ||
double buff[CART_MAX * CART_MAX]; | ||
|
||
for(FINT ibas=0; ibas < nbas; ibas++) { | ||
si = CINTcgtos_cart(ibas, bas); | ||
for(FINT jbas=0; jbas <= ibas; jbas++) { | ||
sj = CINTcgtos_cart(jbas, bas); | ||
int1e_ovlp_cart(buff, NULL, (FINT[]) {ibas, jbas}, atm, natm, bas, nbas, env, NULL, NULL); | ||
printf("ibas=%ld (N=%ld), jbas=%ld (N=%ld)\n", ibas, si, jbas, sj); | ||
for (FINT ielm=0; ielm < si; ielm++) { | ||
for(FINT jelm=0; jelm < ielm + 1; jelm++) | ||
printf(" %.5f", buff[ielm * si + jelm]); | ||
printf("\n"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
project('test_libcint', 'c', | ||
version : '0.1.0', | ||
default_options : ['warning_level=3'], | ||
) | ||
|
||
cc = meson.get_compiler('c') | ||
|
||
# configure dependencies | ||
project_dep = [] | ||
|
||
build_args = [ | ||
'-DPROJECT_NAME="lib' + meson.project_name() + '"', | ||
'-DPROJECT_VERSION="' + meson.project_version() + '"', | ||
] | ||
|
||
libcint_dep = cc.find_library('libcint', required: false) | ||
if not libcint_dep.found() | ||
libcint_proj = subproject('libcint', default_options: ['i8=true']) | ||
libcint_dep = libcint_proj.get_variable('libcint_dep') | ||
endif | ||
project_dep += libcint_dep | ||
|
||
|
||
# fetch sources and includes | ||
srcs = ['main.c'] | ||
|
||
# Executable | ||
stda_exe = executable( | ||
meson.project_name(), | ||
srcs, | ||
dependencies: project_dep, | ||
c_args : build_args, | ||
install: true | ||
) |
Oops, something went wrong.