Skip to content

Commit 2c75f60

Browse files
committed
revised component names
1 parent 55097ce commit 2c75f60

File tree

4 files changed

+67
-12
lines changed

4 files changed

+67
-12
lines changed

CHANGES

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
Following is a brief summary of changes made in each release of Libint.
55

66
- 2022-xx-yy: 2.8.0-beta.1
7+
- UNMERGED PR #271: Add `libint2::configuration_accessor` and `libint2::supports` functions. If
8+
library source is patched, these provides codes for what integrals a library instance can supply.
79
- UNMERGED PR #271: Small pkgconfig and cmake detection improvements. Enable unity build.
810
Testing of solid harmonics runtime switchable from #269.
911
- PR #270: For Windows, basis sets with a star have been renamed to "s" on the filesystem,
@@ -17,6 +19,9 @@ Following is a brief summary of changes made in each release of Libint.
1719
- PR #269: Solid harmonics ordering is runtime switchable in the library. Issue
1820
`libint2::set_solid_harmonics_ordering(libint2::SHGShellOrdering_Gaussian)` or `_Standard` after
1921
initialization. Similarly, prefer new `INT_SOLIDHARMINDEX(sho, l, m)` to usual `(l, m)` version.
22+
- PR #269: The ordering for spherical multipole integrals has been fixed at Standard, rather than
23+
Gaussian or Standard as previously. Note that between this and the next item above, the
24+
`--with-shgauss-ordering=standard|gaussian` has been rendered pointless for the C++ interface.
2025
- PR #268: Python detection (relevant to Python bindings, Fortran, and some tests) now uses modern
2126
`find_package(Python)`. Specify with `Python_EXECUTABLE` (note change in case) or
2227
https://cmake.org/cmake/help/latest/module/FindPython.html for details .

INSTALL.md

+46-12
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@
33
Functions are provided to check the library configuration and solid harmonics orderings at runtime:
44

55
Note: As of v2.8.0 (libtool-based), the configuration_accessor() function will return `(nyi)` by default.
6-
Packagers are encouraged to patch a generated configuration string into file `configuration.cc` to
6+
Packagers are encouraged to patch a generated configuration string into file `configuration.cc.cmake.in` to
77
imitate future cmake-based behavior. See sample patch below.
88

99
```
1010
libint2::initialize();
1111
printf("SHGShell: %d\n", libint2::solid_harmonics_ordering());
1212
libint2::set_solid_harmonics_ordering(libint2::SHGShellOrdering_Gaussian);
1313
printf("SHGShell: %d\n", libint2::solid_harmonics_ordering());
14+
// if patched as described above
1415
printf("Configuration: %s\n", libint2::configuration_accessor().c_str());
16+
printf("Supports: dddd=%d mmmm=%d\n", libint2::supports("eri_dddd_d0"), libint2::supports("eri_mmmm_d0"));
1517
libint2::finalize();
1618
```
1719
```
1820
SHGShell: 1
1921
SHGShell: 2
20-
Configuration: eri_c4_d0_l2;eri_c4_d0_l3;ss;...
22+
Configuration: eri_dddd_d0_l2;eri_ffff_d0;ss;...
23+
Supports: dddd=1 mmmm=0
2124
```
2225

2326
For the C library, a similar function is available:
@@ -26,7 +29,7 @@ For the C library, a similar function is available:
2629
printf("CMake Configuration (C) : %s\n", configuration_accessor());
2730
```
2831
```
29-
CMake Configuration (C) : eri_c4_d0_l2;eri_c4_d0_l3;ss;...
32+
CMake Configuration (C) : eri_dddd_d0;eri_ffff_d0;ss;...
3033
```
3134

3235
If you have a built libint2 library whose history you don't know, a command like this on Linux can provide the same information:
@@ -35,7 +38,7 @@ If you have a built libint2 library whose history you don't know, a command like
3538
strings -n80 /a/random/L2/lying/around/libint2.so
3639
```
3740
```
38-
eri_c2_d0_l2;eri_c2_d0_l3;eri_c2_d1_l2;eri_c3_d0_l2;eri_c3_d0_l3;eri_c3_d1_l2;eri_c4_d0_l2;eri_c4_d1_l2;impure_sh;onebody_d0_l2;onebody_d0_l3;onebody_d1_l2;ss
41+
ss;onebody_i_d0;onebody_h_d0;eri_iiI_d0;eri_iii_d0;eri_II_d0;eri_ii_d0;eri_hhhh_d0;eri_hhH_d0;eri_hhh_d0;eri_HH_d0;eri_hh_d0;eri_gggg_d1;eri_dddd_d1
3942
```
4043

4144
A patch like the following is suitable for an export tarball generated from the next following.
@@ -49,8 +52,8 @@ A patch like the following is suitable for an export tarball generated from the
4952
const char * configuration_accessor() {
5053
//return "@Libint2_CONFIG_COMPONENTS@";
5154
- return "(nyi)";
52-
+ return "eri_c2_d0_l2;eri_c2_d0_l3;eri_c2_d0_l4;eri_c2_d0_l5;eri_c2_d0_l6;eri_c2_d1_l2;eri_c2_d1_l3;eri_c2_d1_l4;eri_c2_d1_l5;eri_c3_d0_l2;eri_c3_d0_l3;eri_c3_d0_l4;eri_c3_d0_l5;eri_c3_d0_l6;eri_c3_d1_l2;eri_c3_d1_l3;eri_c3_d1_l4;eri_c3_d1_l5;eri_c4_d0_l2;eri_c4_d0_l3;eri_c4_d0_l4;eri_c4_d0_l5;eri_c4_d1_l2;eri_c4_d1_l3;eri_c4_d1_l4;g12_d0_l2;g12_d0_l3;g12_d0_l4;g12_d1_l2;g12_d1_l3;g12_d1_l4;impure_sh;onebody_d0_l2;onebody_d0_l3;onebody_d0_l4;onebody_d0_l5;onebody_d0_l6;onebody_d1_l2;onebody_d1_l3;onebody_d1_l4;onebody_d1_l5;onebody_d2_l2;onebody_d2_l3;onebody_d2_l4;ss";
53-
}
55+
+ return "ss;multipole_n;multipole_m;multipole_l;multipole_k;multipole_i;multipole_h;multipole_g;multipole_f;multipole_d;onebody_i_d0;onebody_h_d0;onebody_g_d0;onebody_f_d0;onebody_d_d0;onebody_h_d1;onebody_g_d1;onebody_f_d1;onebody_d_d1;onebody_g_d2;onebody_f_d2;onebody_d_d2;eri_hhhh_d0;eri_gggg_d0;eri_ffff_d0;eri_dddd_d0;eri_gggg_d1;eri_ffff_d1;eri_dddd_d1;eri_iiI_d0;eri_hhI_d0;eri_hhH_d0;eri_ggI_d0;eri_ggH_d0;eri_ggG_d0;eri_ffI_d0;eri_ffH_d0;eri_ffG_d0;eri_ffF_d0;eri_ddI_d0;eri_ddH_d0;eri_ddG_d0;eri_ddF_d0;eri_ddD_d0;eri_hhH_d1;eri_ggH_d1;eri_ggG_d1;eri_ffH_d1;eri_ffG_d1;eri_ffF_d1;eri_ddH_d1;eri_ddG_d1;eri_ddF_d1;eri_ddD_d1;eri_iii_d0;eri_hhi_d0;eri_hhh_d0;eri_ggi_d0;eri_ggh_d0;eri_ggg_d0;eri_ffi_d0;eri_ffh_d0;eri_ffg_d0;eri_fff_d0;eri_ddi_d0;eri_ddh_d0;eri_ddg_d0;eri_ddf_d0;eri_ddd_d0;eri_hhh_d1;eri_ggh_d1;eri_ggg_d1;eri_ffh_d1;eri_ffg_d1;eri_fff_d1;eri_ddh_d1;eri_ddg_d1;eri_ddf_d1;eri_ddd_d1;eri_II_d0;eri_HH_d0;eri_GG_d0;eri_FF_d0;eri_DD_d0;eri_HH_d1;eri_GG_d1;eri_FF_d1;eri_DD_d1;eri_ii_d0;eri_hh_d0;eri_gg_d0;eri_ff_d0;eri_dd_d0;eri_hh_d1;eri_gg_d1;eri_ff_d1;eri_dd_d1;g12_g_d0;g12_f_d0;g12_d_d0;g12_g_d1;g12_f_d1;g12_d_d1";
56+
}
5457
```
5558
```
5659
./configure \
@@ -60,24 +63,55 @@ A patch like the following is suitable for an export tarball generated from the
6063
--enable-1body=2 \
6164
--enable-g12=1 \
6265
--disable-1body-property-derivs \
63-
--with-multipole-max-order=4 \
66+
--with-multipole-max-order=10 \
6467
--with-g12-max-am=4 \
6568
--with-eri-max-am=5,4 \
6669
--with-eri3-max-am=6,5 \
6770
--with-eri2-max-am=6,5 \
6871
--with-max-am=6,5
6972
```
7073

74+
7175
#### Configuration Codes
7276

7377
Evenually, these will be CMake Components, too.
7478

7579
```
76-
onebody_dD_lL - library includes 1-body integrals with derivative order D (D=0,1,2,...) and max angular momentum up to L (L=2,3,4,...)
77-
eri_cC_dD_lL - library includes 2-body integrals with C (C=2,3,4) centers, derivative order D (D=0,1,2,...), and max angular momentum up to L (L=2,3,4,...)
78-
g12_dD-lL - library includes F12 integrals with Gaussian factors with derivative order D and max angular momentum up to L
79-
80-
impure_sh - library doesn't assume that 2- and 3-center integrals involve pure solid harmonics
80+
multipole_h - library includes spherical multipole integrals with max angular momentum up to
81+
"h" (h=(sp)dfghikl...; s,p not enumerated).
82+
For example, the presence of "multipole_i" means mpole ints are available for L=6.
83+
onebody_h_dD - library includes 1-body integrals with max angular momentum up to "h"
84+
(h=(sp)dfghikl...; s,p not enumerated) and derivative order "D" (D=0,1,2,...).
85+
For example, the presence of "onebody_i_d1" means onebody gradient ints are
86+
available for L=6.
87+
eri_hhhh_dD - library includes 2-body integrals with 4 centers and max angular momentum up to
88+
"h" (h=(sp)dfghikl...; s,p not enumerated) and derivative order "D" (D=0,1,2,...).
89+
For example, the presence of "eri_ffff_d1" means 4-center gradient ints are
90+
available for L=3. That is, the library was configured with at least
91+
"--enable-eri=1 --with-eri-max-am=?,>=3".
92+
eri_hhL_dD - library includes 2-body integrals with 3 centers and max angular momentum up to
93+
eri_hhl_dD Cartesian "h" for the two paired centers and Cartesian "l" or solid harmonics "L"
94+
for the unpaired/fitting center, (h/l=(sp)dfghikl..., L=(SP)DFGHIKL...; l>=h
95+
enumerated; s,p not enumerated) and derivative order "D" (D=0,1,2,...). The
96+
"eri_hhL_dD" component is always available when 3-center ints are present. When pure
97+
solid harmonics are assumed for 3-center ints, "eri_hhl_dD" will *not be available*.
98+
For example, the presence of "eri_ffG_d0" means 3-center energy ints are
99+
available for L=3 (paired centers) and L=4 (fitting center). That is, the library
100+
was configured with at least "--enable-eri3=0 --with-max-am=3 --with-eri3-max-am=4".
101+
The presence of "eri_ffg_d0" means the library configuration did not additionally
102+
include "--enable-eri3-pure-sh[=yes]".
103+
eri_HH_dD - library includes 2-body integrals with 2 centers and max angular momentum up to
104+
eri_hh_dD Cartesian "h" or solid harmonics "H", (h=(sp)dfghikl..., H=(SP)DFGHIKL...; s,p not
105+
enumerated) and derivative order "D" (D=0,1,2,...). The "eri_HH_dD" component is
106+
always available when 2-center ints are present. When pure solid harmonics are
107+
assumed for 2-center ints, "eri_hh_dD" will *not be available*.
108+
For example, the presence of "eri_FF_d2" means 2-center Hessian ints are
109+
available for L=3. That is, the library was configured with at least
110+
"--enable-eri2=2 --with-eri2-max-am=?,?,>=3". The presence of "eri_ff_d2" means the
111+
library configuration did not additionally include "--enable-eri2-pure-sh[=yes]".
112+
g12_h_dD - library includes F12 integrals with Gaussian factors max angular momentum up to
113+
"h" (h=(sp)dfghikl...; s,p not enumerated) and derivative order "D" (D=0,1,2,...).
114+
For example, the presence of "g12_i_d2" means g12 Hessian ints are available for L=6.
81115
82116
cart shell_set used_by
83117
-------- --------- -------

include/libint2/util/configuration.h

+15
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ const char * configuration_accessor();
2828

2929
#ifdef _libint2_src_lib_libint_cxxapi_h_
3030
#include <string>
31+
#include <sstream>
32+
#include <vector>
3133

3234
namespace libint2 {
3335

@@ -38,6 +40,19 @@ namespace libint2 {
3840
std::string components = ::configuration_accessor();
3941
return components;
4042
}
43+
44+
/// Runtime accessor for individual library configuration components:
45+
/// integral derivatives, AM, orderings, etc.
46+
/// @param[in] target CMake component with maximally uniform AM
47+
/// @return whether target component available
48+
inline bool supports(std::string component) {
49+
std::string segment;
50+
std::vector<std::string> seglist;
51+
std::stringstream ca(configuration_accessor());
52+
while(std::getline(ca, segment, ';')) { seglist.push_back(segment); }
53+
bool tf = (std::find(seglist.begin(), seglist.end(), component) != seglist.end());
54+
return tf;
55+
}
4156
}
4257
#endif /* cxxapi guard */
4358

tests/unit/test.cc

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ int main( int argc, char* argv[] )
3434
libint2::initialize();
3535
libint2::set_solid_harmonics_ordering(libint2::SHGShellOrdering_Standard); // redundant
3636
printf("Configuration S: sho=%d components=%s\n", libint2::solid_harmonics_ordering(), libint2::configuration_accessor().c_str());
37+
printf("Supports: dddd=%d mmmm=%d FF=%d\n", libint2::supports("eri_dddd_d0"), libint2::supports("eri_mmmm_d0"), libint2::supports("eri_FF_d0"));
3738

3839
#ifdef LIBINT_HAS_MPFR
3940
// default to 256 bits of precision for mpf_class

0 commit comments

Comments
 (0)