diff --git a/utilities/external-interface/CMakeLists.txt b/utilities/external-interface/CMakeLists.txt index d37bb6c4d5..779332e6aa 100644 --- a/utilities/external-interface/CMakeLists.txt +++ b/utilities/external-interface/CMakeLists.txt @@ -20,3 +20,10 @@ target_link_libraries(external_interface ) target_set_warning_flags(external_interface) + +foreach(DRIVER IN ITEMS "ccsd" "nevpt2") + add_test( + NAME "sequant/external_interface/${DRIVER}" + COMMAND external_interface --driver "${CMAKE_CURRENT_LIST_DIR}/examples/${DRIVER}.json" + ) +endforeach() diff --git a/utilities/external-interface/external_interface.cpp b/utilities/external-interface/external_interface.cpp index 0ca5a4f508..cabc8c686c 100644 --- a/utilities/external-interface/external_interface.cpp +++ b/utilities/external-interface/external_interface.cpp @@ -422,8 +422,15 @@ void generalSetup() { int main(int argc, char **argv) { set_locale(); - set_default_context({.index_space_registry = IndexSpaceRegistry(), - .vacuum = Vacuum::SingleProduct}); + Context ctx({.index_space_registry = IndexSpaceRegistry(), + .vacuum = Vacuum::SingleProduct}); + // TODO: This only hides a bug/issue in the processing code where SeQuant + // assumes that it is okay to freely rename external indices while + // canonicalizing an expression. However, this breaks down as soon as those + // indices are tracked externally (e.g. ResultExpr) as those won't get updated + // to use the new names. + ctx.set(CanonicalizeOptions{.method = CanonicalizationMethod::Complete}); + set_default_context(ctx); generalSetup(); CLI::App app(