Skip to content

Commit 2a14224

Browse files
committed
minor changes
1 parent b4a6851 commit 2a14224

File tree

8 files changed

+14
-11
lines changed

8 files changed

+14
-11
lines changed

src/apps/cc2/cc2.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ int main(int argc, char **argv) {
7676

7777
std::shared_ptr<Nemo> nemo(new Nemo(world, parser));
7878
nemo->param.set_derived_value("print_level", 2);
79+
nemo->get_calc()->param.set_derived_value("print_level", 2);
7980
nemo->param.set_derived_value("k", 5);
8081
nemo->get_calc()->param.set_derived_value("k", 5);
82+
nemo->param.set_derived_value<std::string>("localize", "canon");
83+
nemo->get_calc()->param.set_derived_value<std::string>("localize", "canon");
84+
nemo->param.set_derived_values(nemo->molecule(),nemo->get_calc()->aobasis,parser);
85+
nemo->get_calc()->param.set_derived_values(nemo->molecule(),nemo->get_calc()->aobasis,parser);
8186
CC2 cc2(world, parser, nemo);
8287

8388
std::shared_ptr<SCF> calc = nemo->get_calc();
@@ -86,6 +91,8 @@ int main(int argc, char **argv) {
8691
cc2.parameters.print("cc2","end");
8792
print("\n");
8893
calc->param.print("dft","end");
94+
print("\n");
95+
cc2.tdhf->get_parameters().print("response","end");
8996
}
9097
double hf_energy = nemo->value();
9198
if (world.rank() == 0)

src/madness/chem/CC2.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CC2::solve() {
3838

3939
double mp2_energy, cc2_energy;
4040

41-
bool need_tdhf=(ctype==CT_TDHF or ctype==CT_LRCC2 or ctype==CT_CISPD or ctype==CT_ADC2 or ctype==CT_LRCCS);
41+
bool need_tdhf=parameters.response();
4242
bool need_mp2=(ctype==CT_MP2 or ctype==CT_CISPD or ctype==CT_ADC2);
4343
bool need_cc2=(ctype==CT_LRCC2 or ctype==CT_CC2);
4444

src/madness/chem/CC2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class CC2 : public OptimizationTargetInterface, public QCPropertyInterface {
5959
parameters.sanity_check(world);
6060

6161
tdhf.reset(new TDHF(world,parser,nemo));
62-
tdhf->get_parameters().print("response","end");
6362

6463
}
6564

src/madness/chem/CCPotentials.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,9 @@ class CCPotentials {
795795
// update the intermediates
796796
void update_intermediates(const CC_vecfunction& t) {
797797
g12.update_elements(mo_bra_, t);
798-
g12.sanity();
798+
// g12.sanity();
799799
f12.update_elements(mo_bra_, t);
800-
f12.sanity();
800+
// f12.sanity();
801801
}
802802

803803
/// clear stored potentials

src/madness/chem/CCStructures.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ CCIntermediatePotentials::insert(const vector_real_function_3d& potential, const
200200
void CCParameters::set_derived_values() {
201201
if (not kain()) set_derived_value("kain_subspace",std::size_t(0));
202202

203+
if (response()==true) set_derived_value("excitations",std::vector<std::size_t>({0}));
204+
203205
// set all parameters that were not explicitly given
204206
set_derived_value("tight_thresh_6d",thresh_6D()*0.1);
205207
set_derived_value("thresh_3d",thresh_6D()*0.01);

src/madness/chem/CCStructures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ struct CCParameters : public QCCalculationParametersBase {
312312
MADNESS_EXCEPTION("faulty CalcType", 1);
313313
}
314314

315+
bool response() const {return calc_type()==CT_ADC2 or calc_type()==CT_CISPD or calc_type()==CT_LRCC2 or calc_type()==CT_LRCCS;}
315316
double lo() const { return get<double>("lo"); }
316317

317318
double dmin() const { return get<double>("dmin"); }

src/madness/chem/TDHF.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,9 @@ void TDHF::initialize() {
7777
+ std::to_string(parameters.thresh()) + " and Reference thresh=" + std::to_string(old_thresh)
7878
+ ". Be careful, reference should be tight");
7979
}
80-
FunctionDefaults<3>::set_thresh(parameters.thresh());
81-
msg << "MRA Threshold is set to: " << FunctionDefaults<3>::get_thresh()
82-
<< " with k=" << FunctionDefaults<3>::get_k() << "\n";
83-
84-
8580
symmetry_projector = get_nemo()->get_symmetry_projector();
8681
// do not normalize the x vectors individually!
8782
symmetry_projector.set_lindep(1.e-2).set_orthonormalize_irreps(false).set_verbosity(0);
88-
symmetry_projector.print_info(world);
8983
check_consistency();
9084

9185
}

src/madness/chem/nemo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ double Nemo::solve(const SCFProtocol& proto) {
372372
tensorT fock_offdiag=copy(fock);
373373
for (int i=0; i<fock.dim(0); ++i) fock_offdiag(i,i)=0.0;
374374
double max_fock_offidag=fock_offdiag.absmax();
375-
if (world.rank()==0) print("F max off-diagonal ",max_fock_offidag);
375+
if (world.rank()==0 and param.print_level()>3) print("F max off-diagonal ",max_fock_offidag);
376376

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

0 commit comments

Comments
 (0)