From 2a142241b3fbb3c8552c7a1b7570e7e317f85c60 Mon Sep 17 00:00:00 2001 From: fbischoff Date: Wed, 19 Jul 2023 13:34:11 +0200 Subject: [PATCH] minor changes --- src/apps/cc2/cc2.cc | 7 +++++++ src/madness/chem/CC2.cc | 2 +- src/madness/chem/CC2.h | 1 - src/madness/chem/CCPotentials.h | 4 ++-- src/madness/chem/CCStructures.cc | 2 ++ src/madness/chem/CCStructures.h | 1 + src/madness/chem/TDHF.cc | 6 ------ src/madness/chem/nemo.cc | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/apps/cc2/cc2.cc b/src/apps/cc2/cc2.cc index 47684ea4ae9..50b03add557 100644 --- a/src/apps/cc2/cc2.cc +++ b/src/apps/cc2/cc2.cc @@ -76,8 +76,13 @@ int main(int argc, char **argv) { std::shared_ptr nemo(new Nemo(world, parser)); nemo->param.set_derived_value("print_level", 2); + nemo->get_calc()->param.set_derived_value("print_level", 2); nemo->param.set_derived_value("k", 5); nemo->get_calc()->param.set_derived_value("k", 5); + nemo->param.set_derived_value("localize", "canon"); + nemo->get_calc()->param.set_derived_value("localize", "canon"); + nemo->param.set_derived_values(nemo->molecule(),nemo->get_calc()->aobasis,parser); + nemo->get_calc()->param.set_derived_values(nemo->molecule(),nemo->get_calc()->aobasis,parser); CC2 cc2(world, parser, nemo); std::shared_ptr calc = nemo->get_calc(); @@ -86,6 +91,8 @@ int main(int argc, char **argv) { cc2.parameters.print("cc2","end"); print("\n"); calc->param.print("dft","end"); + print("\n"); + cc2.tdhf->get_parameters().print("response","end"); } double hf_energy = nemo->value(); if (world.rank() == 0) diff --git a/src/madness/chem/CC2.cc b/src/madness/chem/CC2.cc index b643ae69f10..609706d0952 100644 --- a/src/madness/chem/CC2.cc +++ b/src/madness/chem/CC2.cc @@ -38,7 +38,7 @@ CC2::solve() { double mp2_energy, cc2_energy; - bool need_tdhf=(ctype==CT_TDHF or ctype==CT_LRCC2 or ctype==CT_CISPD or ctype==CT_ADC2 or ctype==CT_LRCCS); + bool need_tdhf=parameters.response(); bool need_mp2=(ctype==CT_MP2 or ctype==CT_CISPD or ctype==CT_ADC2); bool need_cc2=(ctype==CT_LRCC2 or ctype==CT_CC2); diff --git a/src/madness/chem/CC2.h b/src/madness/chem/CC2.h index 8c6643e5d1b..f656fdda59c 100644 --- a/src/madness/chem/CC2.h +++ b/src/madness/chem/CC2.h @@ -59,7 +59,6 @@ class CC2 : public OptimizationTargetInterface, public QCPropertyInterface { parameters.sanity_check(world); tdhf.reset(new TDHF(world,parser,nemo)); - tdhf->get_parameters().print("response","end"); } diff --git a/src/madness/chem/CCPotentials.h b/src/madness/chem/CCPotentials.h index a70efcc0f43..6258aaf535f 100644 --- a/src/madness/chem/CCPotentials.h +++ b/src/madness/chem/CCPotentials.h @@ -795,9 +795,9 @@ class CCPotentials { // update the intermediates void update_intermediates(const CC_vecfunction& t) { g12.update_elements(mo_bra_, t); - g12.sanity(); +// g12.sanity(); f12.update_elements(mo_bra_, t); - f12.sanity(); +// f12.sanity(); } /// clear stored potentials diff --git a/src/madness/chem/CCStructures.cc b/src/madness/chem/CCStructures.cc index f7a1c2333f7..0ba3e24d52b 100644 --- a/src/madness/chem/CCStructures.cc +++ b/src/madness/chem/CCStructures.cc @@ -200,6 +200,8 @@ CCIntermediatePotentials::insert(const vector_real_function_3d& potential, const void CCParameters::set_derived_values() { if (not kain()) set_derived_value("kain_subspace",std::size_t(0)); + if (response()==true) set_derived_value("excitations",std::vector({0})); + // set all parameters that were not explicitly given set_derived_value("tight_thresh_6d",thresh_6D()*0.1); set_derived_value("thresh_3d",thresh_6D()*0.01); diff --git a/src/madness/chem/CCStructures.h b/src/madness/chem/CCStructures.h index 35c43f6bc86..db318d932f9 100644 --- a/src/madness/chem/CCStructures.h +++ b/src/madness/chem/CCStructures.h @@ -312,6 +312,7 @@ struct CCParameters : public QCCalculationParametersBase { MADNESS_EXCEPTION("faulty CalcType", 1); } + bool response() const {return calc_type()==CT_ADC2 or calc_type()==CT_CISPD or calc_type()==CT_LRCC2 or calc_type()==CT_LRCCS;} double lo() const { return get("lo"); } double dmin() const { return get("dmin"); } diff --git a/src/madness/chem/TDHF.cc b/src/madness/chem/TDHF.cc index d79d4f20144..ddef2c567c0 100644 --- a/src/madness/chem/TDHF.cc +++ b/src/madness/chem/TDHF.cc @@ -77,15 +77,9 @@ void TDHF::initialize() { + std::to_string(parameters.thresh()) + " and Reference thresh=" + std::to_string(old_thresh) + ". Be careful, reference should be tight"); } - FunctionDefaults<3>::set_thresh(parameters.thresh()); - msg << "MRA Threshold is set to: " << FunctionDefaults<3>::get_thresh() - << " with k=" << FunctionDefaults<3>::get_k() << "\n"; - - symmetry_projector = get_nemo()->get_symmetry_projector(); // do not normalize the x vectors individually! symmetry_projector.set_lindep(1.e-2).set_orthonormalize_irreps(false).set_verbosity(0); - symmetry_projector.print_info(world); check_consistency(); } diff --git a/src/madness/chem/nemo.cc b/src/madness/chem/nemo.cc index 2c72ab2ab58..9544bcc5483 100644 --- a/src/madness/chem/nemo.cc +++ b/src/madness/chem/nemo.cc @@ -372,7 +372,7 @@ double Nemo::solve(const SCFProtocol& proto) { tensorT fock_offdiag=copy(fock); for (int i=0; i3) print("F max off-diagonal ",max_fock_offidag); // canonicalize the orbitals, rotate subspace and potentials tensorT overlap = matrix_inner(world, R2nemo, nemo, true);