Skip to content

Commit

Permalink
likely handle max_am correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed May 17, 2024
1 parent 359df6f commit 63235c2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ option_with_print(ENABLE_T1G12_SUPPORT

option_with_default(WITH_MAX_AM
"Support Gaussians of angular momentum up to N.
Can specify values for each derivative level as a semicolon-separated string.
If ERI3 ints are enabled, this option also controls the AM of the paired centers." 4)
If ERI3 ints are enabled, specifing values for each derivative level as a
semicolon-separated string also controls the AM of the paired centers." 4)
option_with_default(WITH_OPT_AM
"Optimize maximally for up to angular momentum N (N <= max-am).
Can specify values for each derivative level as a semicolon-separated string. (default: (libint_max_am/2)+1)" -1)
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"CMake Error: Generator: execution of make failed". Throttle it to physical threads with
`export CMAKE_BUILD_PARALLEL_LEVEL=N`.

* `WITH_MAX_AM` — G — Support Gaussians of angular momentum up to N. Can specify values for each derivative level as a semicolon-separated string. Specify values greater or equal to `WITH_<class>_MAX_AM`; often mirrors `WITH_ERI3_MAX_AM`. [Default=4]
* `WITH_MAX_AM` — G — Support Gaussians of angular momentum up to N. If ERI3 ints are enabled, specifing values for each derivative level as a semicolon-separated string also controls the AM of the paired centers. [Default=4]
* `WITH_OPT_AM` — G — Optimize maximally for up to angular momentum N (N <= WITH_MAX_AM). Can specify values for each derivative level as a semicolon-separated string. [Default=-1 -> `(WITH_MAX_AM/2)+1`]

* `MULTIPOLE_MAX_ORDER` — G — Maximum order of spherical multipole integrals. There is no maximum. [Default=4]
Expand Down
23 changes: 13 additions & 10 deletions cmake/modules/int_am.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@ endif()

foreach(_d RANGE 0 ${_max_deriv})
if (${_d} LESS _ntokens_maxam)
list(GET WITH_MAX_AM ${_d} _candidate0_d${_d})
list(GET WITH_MAX_AM ${_d} _eri3_candidate0_d${_d})
set(_dflt_candidate0_d${_d} "${LIBINT_MAX_AM}")
else()
set(_candidate0_d${_d} "-1")
set(_eri3_candidate0_d${_d} "${LIBINT_MAX_AM}")
set(_dflt_candidate0_d${_d} "-1")
endif()
# _candidate0_dD=int_am defined up to highest ENABLE_cls deriv D from best info from WITH_MAX_AM
message(VERBOSE "setting _candidate0_d${_d}=${_candidate0_d${_d}}")
message(VERBOSE "setting _eri3_candidate0_d${_d}=${_eri3_candidate0_d${_d}}")
message(VERBOSE "setting _dflt_candidate0_d${_d}=${_dflt_candidate0_d${_d}}")
endforeach()

if (LIBINT_MAX_AM GREATER_EQUAL ${LIBINT_HARD_MAX_AM})
Expand Down Expand Up @@ -175,7 +178,7 @@ macro(process_integrals_class class)

foreach(_d RANGE 0 ${_max_deriv})
if (${_d} LESS_EQUAL ${INCLUDE_${class}})
set(_candidate0_${class}_d${_d} ${_candidate0_d${_d}})
set(_candidate0_${class}_d${_d} ${_dflt_candidate0_d${_d}})
message(VERBOSE "setting _candidate0_${class}_d${_d}=${_candidate0_${class}_d${_d}}")
endif()
endforeach()
Expand Down Expand Up @@ -285,7 +288,7 @@ macro(process_integrals_class_alt class)
foreach(_d RANGE 0 ${_max_deriv})
if (${_d} LESS_EQUAL ${INCLUDE_${class}})
# no per-d defaults. use energy
set(_candidate0_${class}_d${_d} ${_candidate0_d0})
set(_candidate0_${class}_d${_d} ${_dflt_candidate0_d0})
message(VERBOSE "setting _candidate0_${class}_d${_d}=${_candidate0_${class}_d${_d}}")
endif()
endforeach()
Expand Down Expand Up @@ -432,8 +435,8 @@ foreach(_cls ONEBODY;ERI;ERI3;ERI2;G12;G12DKH)
endif()
endforeach()
if (_cls STREQUAL "ERI3")
foreach(_lpr RANGE ${LIBINT_HARD_MIN_AM} ${_candidate0_d${_d}}) # LIBINT_MAX_AM[_LIST]
foreach(_lfit RANGE ${LIBINT_HARD_MIN_AM} ${_candidate_${_cls}_d${_d}}) # LIBINT_ERI3_MAX_AM[_LIST]
foreach(_lfit RANGE ${LIBINT_HARD_MIN_AM} ${_candidate_${_cls}_d${_d}}) # LIBINT_ERI3_MAX_AM[_LIST], fitting
foreach(_lpr RANGE ${LIBINT_HARD_MIN_AM} ${_eri3_candidate0_d${_d}}) # LIBINT_MAX_AM[_LIST], paired
if (_lfit GREATER_EQUAL _lpr)
list(APPEND _amlist "eri_${_am${_lpr}}${_am${_lpr}}${_AM${_lfit}}_d${_d}")
list(APPEND _pureamlist "eri_${_am${_lpr}}${_am${_lpr}}${_am${_lfit}}_d${_d}")
Expand All @@ -443,7 +446,7 @@ foreach(_cls ONEBODY;ERI;ERI3;ERI2;G12;G12DKH)
endif()
list(REVERSE _amlist)
list(APPEND Libint2_ERI_COMPONENTS "${_amlist}")
message(VERBOSE "setting component ${_amlist}")
message(VERBOSE "setting components ${_amlist}")
list(REVERSE _pureamlist)
if (_cls STREQUAL "ERI2")
list(APPEND _eri2_impure_sh "${_pureamlist}")
Expand All @@ -453,10 +456,10 @@ foreach(_cls ONEBODY;ERI;ERI3;ERI2;G12;G12DKH)
endforeach()
if ((_cls STREQUAL "ERI3") AND NOT ERI3_PURE_SH)
list(APPEND Libint2_ERI_COMPONENTS "${_eri3_impure_sh}")
message(VERBOSE "setting component ${_eri3_impure_sh}")
message(VERBOSE "setting components ${_eri3_impure_sh}")
elseif ((_cls STREQUAL "ERI2") AND NOT ERI2_PURE_SH)
list(APPEND Libint2_ERI_COMPONENTS "${_eri2_impure_sh}")
message(VERBOSE "setting component ${_eri2_impure_sh}")
message(VERBOSE "setting components ${_eri2_impure_sh}")
endif()
endif()
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions export/cmake/configuration-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
# eri3
no_pure_sh = []
for deriv in range(len(eri3_max_am)):
for am_paired in range(max_am[deriv], 1, -1):
for am_fitting in range(eri3_max_am[deriv], 1, -1):
for am_fitting in range(eri3_max_am[deriv], 1, -1):
for am_paired in range(max_am[deriv], 1, -1):
if am_fitting >= am_paired:
centers = amstr[am_paired].lower() * 2 + amstr[am_fitting].upper()
comp = f"eri_{centers}_d{deriv}"
Expand Down

0 comments on commit 63235c2

Please sign in to comment.