Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fbischoff committed Jul 19, 2023
1 parent b4a6851 commit 2a14224
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
7 changes: 7 additions & 0 deletions src/apps/cc2/cc2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ int main(int argc, char **argv) {

std::shared_ptr<Nemo> 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<std::string>("localize", "canon");
nemo->get_calc()->param.set_derived_value<std::string>("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<SCF> calc = nemo->get_calc();
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/madness/chem/CC2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion src/madness/chem/CC2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");

}

Expand Down
4 changes: 2 additions & 2 deletions src/madness/chem/CCPotentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/madness/chem/CCStructures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::size_t>({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);
Expand Down
1 change: 1 addition & 0 deletions src/madness/chem/CCStructures.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>("lo"); }

double dmin() const { return get<double>("dmin"); }
Expand Down
6 changes: 0 additions & 6 deletions src/madness/chem/TDHF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

}
Expand Down
2 changes: 1 addition & 1 deletion src/madness/chem/nemo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ double Nemo::solve(const SCFProtocol& proto) {
tensorT fock_offdiag=copy(fock);
for (int i=0; i<fock.dim(0); ++i) fock_offdiag(i,i)=0.0;
double max_fock_offidag=fock_offdiag.absmax();
if (world.rank()==0) print("F max off-diagonal ",max_fock_offidag);
if (world.rank()==0 and param.print_level()>3) print("F max off-diagonal ",max_fock_offidag);

// canonicalize the orbitals, rotate subspace and potentials
tensorT overlap = matrix_inner(world, R2nemo, nemo, true);
Expand Down

0 comments on commit 2a14224

Please sign in to comment.