MADNESS  version 0.9
tdhf_CIS.h
Go to the documentation of this file.
1 /*
2  This file is part of MADNESS.
3 
4  Copyright (C) 2007,2010 Oak Ridge National Laboratory
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20  For more information please contact:
21 
22  Robert J. Harrison
23  Oak Ridge National Laboratory
24  One Bethel Valley Road
25  P.O. Box 2008, MS-6367
26 
27  email: harrisonrj@ornl.gov
28  tel: 865-241-3937
29  fax: 865-572-0680
30 
31  $Id$
32 */
33 /* * tdhfCIS.h
34  *
35  * Created on: May 5, 2014
36  * Author: kottmanj
37  */
38 
55 #ifndef TDHFCIS_H_
56 #define TDHFCIS_H_
57 
58 #include <chem/projector.h>
59 //#include <examples/mp2.h>
60 
61 #include<examples/nonlinsol.h>
62 #include<chem/SCF.h>
63 #include <madness/mra/operator.h>
64 #include <madness/mra/mra.h>
65 #include <madness/mra/vmra.h>
66 #include <madness/mra/lbdeux.h>
67 #include <madness/misc/ran.h>
68 
69 
70 
71 
72 using namespace madness;
73 
74 
75 typedef std::vector<Function<double,3> > vecfuncT;
76 
78 // This is not used anymore, but maybe will be useful later
79 struct gauss_function : public FunctionFunctorInterface<double,3> {
80 
82 
83 public:
84  gauss_function(double molecule_box) : sigma(molecule_box){}
85 
86 private:
87  real_function_3d function;
88  double sigma;
89 
90 
91 public:
92  double operator()(const coord_3d &r)const {
93  double r2=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];
94  double prefactor = 1.0/(sqrt(2.0*constants::pi)*sigma);
95  return prefactor*exp(-r2/(2.0*sigma*sigma));
96  }
97 };
98 
100 // Not used anymore but maybe useful later
101 struct noise : public FunctionFunctorInterface<double,3> {
102 
104 
105 public:
106  noise(double size){noise(size,1.0);}
107  noise(double size,double width) {
108  Random random(wall_time()*1.e8);
109  x=size*(random.get()-random.get());
110  y=size*(random.get()-random.get());
111  z=size*(random.get()-random.get());
112  prefactor= x*y*z/(fabs(x*y*z));
113  sigma=width;
114  // print("Noise constructor x,y,z,pre,sigma are: ",x,y,z,prefactor,sigma);
115  }
116 
117 
118 private:
120  double x,y,z;
121  double sigma;
122  double prefactor;
123 
124 public:
125  double operator()(const coord_3d &r) const{
126  double r2 = (r[0]-x)*(r[0]-x)+(r[1]-y)*(r[1]-y)+(r[2]-z)*(r[2]-z);
127  return prefactor*exp(-r2/(2.0*sigma*sigma));
128  }
129 
130 };
131 
132 
134 struct root {
135  root(World& world) : world(world), omega(0.0),expv(0.0),converged(false),err(10.0),delta(10.0),iter(0) {}
136  root(World& world,vecfuncT& x, double omega) :world(world), x(x), omega(omega),converged(false),err(10.0),delta(10.0),iter(0) {}
137  root(World& world, const vecfuncT& x1) : world(world), x(x1),converged(false),err(10.0),delta(10.0),iter(1){}
138  root(const root& other) : world(other.world), x(other.x),
139  omega(other.omega),expv(other.expv), converged(other.converged),
140  err(other.err),delta(other.delta),iter(other.iter),number(other.number){}
141 
142  // Constructor for the print routine to create a copy without the x functions
143  root(World &world,double omega,double expv, double delta, double error, bool converged,int iter, int number) : world(world),
144  omega(omega),expv(expv),converged(converged),err(error),delta(delta),iter(iter),number(number) {}
145 
148  double omega;
149  double expv; // expectation_value
150  bool converged;
151  double err;
152  double delta;
153  int iter;
154  int number;
155  //solverT solver; // Maybe later
156  std::vector<double> amplitudes_;
157 
158  // Operators needed by the nonlinear solver
159  root& operator=(const root& other) {
160  x=other.x;
161  // This is new, needed for sort function
162  // Not shure if this changes something when KAIN is used again
163  omega=other.omega;
164  expv=other.expv;
165  converged=other.converged;
166  err=other.err;
167  delta=other.delta;
168  amplitudes_=other.amplitudes_;
169  number=other.number;
170  iter=other.iter;
171  return *this;
172  }
173 
174  root operator-(const root& b) const {
175  return root(world,sub(world,x,b.x));
176  }
177 
178  root operator+=(const root& b) { // Operator+= necessary
179  x=add(world,x,b.x);
180  return *this;
181  }
182 
183  root operator*(double a) { // Scale by a constant necessary
184  scale(world,x,a);
185  return *this;
186  }
187  // An operator for the sort function
188  bool operator<(const root &other)const{
189  return (this->omega<other.omega);
190  }
191  bool operator>(const root &other)const{
192  return (this->omega>other.omega);
193  }
194 };
195 
196 
197 namespace madness {
198 
199 
200 
201 
203 class CIS {
204 
208 
209 private:
210  #define TRUE 1
211  #define FALSE 0
212 
213  static double rfunction(const coord_3d& r) {
214  return sqrt(r[0]*r[0] + r[1]*r[1] + r[2]*r[2]);
215  }
216 
217  static double rfunction2(const coord_3d& r) {
218  return sqrt(r[0]*r[0] + r[1]*r[1] + r[2]*r[2])+1.0;
219  }
220 
221  // r^2
222  static double monopole(const coord_3d &r){
223  return r[0]*r[0] + r[1]*r[1] + r[2]*r[2];
224  }
225 
226  static double x(const coord_3d &r){return r[0];}
227  static double x2(const coord_3d &r){return r[0]-0.7;}
228  static double x3(const coord_3d &r){return r[0]+0.7;}
229  static double y(const coord_3d &r){return r[1];}
230  static double z(const coord_3d &r){return r[2];}
231 
233  static double b1u(const coord_3d &r){return r[0]*(r[0]*r[0]-3*r[1]*r[1]);}
234  static double b2u(const coord_3d &r){return r[1]*(3*r[0]*r[0]-r[1]*r[1]);}
235  static double e1g1(const coord_3d &r){return r[0]*r[2];}
236  static double e1g2(const coord_3d &r){return r[1]*r[2];}
237  static double a2u(const coord_3d &r){return r[2];}
238  static double e2u1(const coord_3d &r){return r[2]*(r[0]*r[0]-r[1]*r[1]);}
239  static double e2u2(const coord_3d &r){return r[0]*r[1]*r[2];}
240 
241  // Random number Generator from Madness lib misc/ran.h
242  static double random_number(const coord_3d &r){
243  Random random;
244  return random.get();
245  }
246 
247 
248 
249  // For the sorting of the roots
250  static bool compare_roots(const root &a,const root &b){
251  return a.omega<b.omega;
252  }
253  static bool compare_roots_error(const root &a,const root &b){
254  return a.err<b.err;
255  }
256 
257 
258 public:
259 
261 
265  CIS(World& world, const SCF& calc, const std::string input)
266 : world(world),
267  calc_(calc),
268  guess_("physical"),
269  nroot_(8),
270  nfreeze_(0),
271  econv_(calc.param.econv),
272  dconv_(calc.param.econv),
273  guess_thresh_(1.e-4),
274  guess_econv_(0.001),
275  guess_dconv_(0.03),
276  guess_iter_(20),
277  guess_iter_fock_(5),
278  guess_roots_(8),
279  guess_mode_("all_orbitals"),
280  thresh_(dconv_*0.01),
281  bsh_eps_(1.e-6),
282  iter_max_(50),
283  exchange_("hf"),
284  print_grid_(false),
285  plot_(false),
286  fixed_point_(false),
287 
288  guess_save_(false),
289  guess_damp_(false),
290  guess_pull_(false),
291  guess_damp_iter_(6),
292  guess_damp_fock_(true),
293 
294  noise_(false),
295  noise_box_(get_calc().molecule.bounding_cube()),
296  noise_comp_(0.01),
297  noise_width_(3.5),
298  noise_gaussnumber_(25),
299  hf_(false),
300  triplet_(false),
301  read_and_save_koala_(false),
302  analyze_("false"),
303  guess_exf_("dipole"){
304 
305  size_t nmo = get_calc().amo.size();
306  guess_omega_=-0.9*get_calc().aeps(nmo-1);
307  omega_=std::vector<double>(9,100.0);
308  active_mo_ = nmo-nfreeze_;
309 
310  std::ifstream f(input.c_str());
311  position_stream(f, "CIS");
312  std::string s, tag;
313  while (std::getline(f,s)) {
314  std::istringstream ss(s);
315  ss >> tag;
316  if (tag == "end") break;
317  else if (tag == "guess") ss >> guess_;
318  else if (tag == "guess_preopt") ss >> preopt_;
319  else if (tag == "nroot") ss >> nroot_;
320  // dangerous right now else if (tag == "guess_roots") ss >> guess_roots_;
321  else if (tag == "guess_thresh") ss >> guess_thresh_;
322  else if (tag == "guess_econv") ss >> guess_econv_;
323  else if (tag == "guess_dconv") ss >> guess_dconv_;
324  else if (tag == "guess_iter") ss >> guess_iter_;
325  else if (tag == "guess_iter_fock") ss >> guess_iter_fock_;
326  else if (tag == "guess_roots") ss >> guess_roots_;
327  else if (tag == "guess_omega") ss >> guess_omega_;
328  else if (tag == "guess_mode") ss >> guess_mode_;
329  else if (tag == "thresh") ss >> thresh_;
330  else if (tag == "bsh_eps") ss >> bsh_eps_;
331  else if (tag == "iter_max") ss >> iter_max_;
332  else if (tag == "freeze") ss >> nfreeze_;
333  else if (tag == "econv") ss >> econv_;
334  else if (tag == "dconv") ss >> dconv_;
335  else if (tag == "fixed_point") fixed_point_=true;
336  else if (tag == "print_grid") print_grid_=true;
337  else if (tag == "plot") plot_=true;
338  else if (tag == "guess_save") guess_save_=true;
339  else if (tag == "guess_damp") guess_damp_=true;
340  else if (tag == "guess_pull") guess_pull_=true;
341  else if (tag == "guess_damp_iter") ss >> guess_damp_iter_;
342  else if (tag == "guess_damp_fock") guess_damp_fock_ = true;
343  else if (tag == "noise") noise_=true;
344  else if (tag == "noise_box") ss >> noise_box_;
345  else if (tag == "noise_comp") ss >> noise_comp_;
346  else if (tag == "noise_width") ss >> noise_width_;
347  else if (tag == "noise_gaussnumber") ss >> noise_gaussnumber_;
348  else if (tag == "hf") hf_=true;
349  else if (tag == "triplet") triplet_=true;
350  else if (tag == "koala_read_and_save") read_and_save_koala_=true;
351  else if (tag == "guess_exf") ss >> guess_exf_;
352  else if (tag == "omega0") ss >> omega_[0];
353  else if (tag == "omega1") ss >> omega_[1];
354  else if (tag == "omega2") ss >> omega_[2];
355  else if (tag == "omega3") ss >> omega_[3];
356  else if (tag == "omega4") ss >> omega_[4];
357  else if (tag == "omega5") ss >> omega_[5];
358  else if (tag == "omega6") ss >> omega_[6];
359  else if (tag == "omega7") ss >> omega_[7];
360  else if (tag == "omega8") ss >> omega_[8];
361  else if (tag == "active_mo") ss >> active_mo_;
362  else if (tag == "active_mo") guess_mode_="active_space";
363  else if (tag == "analyze") analyze_=true;
364  else continue;
365  }
366 
367 
368 
369 
370 
371 
372  if (world.rank() == 0) {
373  madness::print("\n ======= CIS info =======\n");
374  if (nfreeze_==0) madness::print(" # frozen orbitals ","none");
375  if (nfreeze_>0) madness::print(" # frozen orbitals ",0, " to ",nfreeze_-1);
376  madness::print(" active orbitals ", nfreeze_," to ",get_calc().param.nalpha-1);
377 
378  madness::print(" guess from ", guess_);
379  madness::print(" threshold 3D ", FunctionDefaults<3>::get_thresh());
380  madness::print(" energy convergence ", econv_);
381  madness::print("max residual (dconv) ", dconv_);
382  madness::print(" number of roots ", nroot_);
383  madness::print(" omega ", omega_[0],omega_[1],omega_[2]);
384 
385  }
386 
387  lo=get_calc().param.lo;
388  }
389 
390 
392  const SCF& get_calc() const {return calc_;}
393 
394  // print information of root or root vector
395  void print_roots(const std::vector<root> &roots) const;
396  void print_roots(const std::vector<root> &roots,const int iter) const;
397  void print_root(const root &root) const;
398 
400  void sort_roots(std::vector<root> & roots,std::string criterium)const;
401 
402  // read and analyze roots
403  void Analyze();
404 
406  void solve();
407 
408  // Internal solver for parallel or sequential optimization
409  bool solve_internal_par(const std::string mode,std::vector<root> &roots,const int iter_max);
410 
412  std::vector<root>& roots();
413 
415  bool print_grid() const;
416 
417 private:
418 
420  World& world;
421 
423  const SCF& calc_;
424 
426  std::vector<root> roots_;
427 
429 
435  std::vector<vecfuncT> exchange_intermediate_;
436 
438  mutable real_function_3d coulomb_;
439 
440 
442  std::string guess_;
443 
445  std::string preopt_;
446 
448  int nroot_;
449 
451  int nfreeze_;
452 
454  double econv_;
455 
457  double dconv_;
458 
460  Tensor<double> guess_phases_;
461 
462  // Thresh for guess calculation
463  double guess_thresh_;
465  double guess_econv_;
466 
468  double guess_dconv_;
469 
471  int guess_iter_;
472  int guess_iter_fock_;
473 
475  int guess_roots_;
476 
478  double guess_omega_;
479 
481  std::string guess_mode_;
482 
484  double thresh_;
485 
487  double bsh_eps_;
488 
490  int iter_max_;
491 
493  std::vector<double> omega_;
494 
496  std::string exchange_;
497 
498 
500 
502  bool print_grid_;
503 
505  bool plot_;
506 
508  bool fixed_point_;
509 
511  bool guess_save_;
512 
514  // Not used anymore, but maybe again with DFT
515  bool guess_damp_;
516  bool guess_pull_;
517  int guess_damp_iter_;
518  bool guess_damp_fock_;
519 
523  bool noise_;
524  double noise_box_;
525  double noise_comp_;
526  double noise_width_;
527  double noise_gaussnumber_;
528 
530  bool hf_;
531 
533  // Calculating triplets does not work right now
534  bool triplet_;
535 
537  bool read_and_save_koala_;
538 
540  int active_mo_;
541 
542  // just read and alalyze the roots
543  bool analyze_;
544 
546  std::string guess_exf_;
547 
548  double lo;
549 
552  void initialize_roots(World &world,std::vector<root> &roots);
553 
555  void guess_MO(World &world,std::vector<root> &roots);
557  void guess_read(World &world,std::vector<root> &roots);
559  // you need to print out the grid before and then use koala
560  // 1. Madness tdhf calculation with keyword print_grid in CIS
561  // 2. Koala calculation using this grid
562  // 3. Madness tdhf calculation with keyword guess koala in CIS
563  void guess_koala(World &world,std::vector<root> &roots);
565  void guess_physical(World &world,std::vector<root> &roots);
566 
568  void guess_noise(World &world,std::vector<root> & roots);
570  void guess_aspace(World &world,std::vector<root> & roots);
572  void guess_forced(World &world,std::vector<root> & roots);
574  void guess_benzene_custom(World &world,std::vector<root> & roots);
575 
576  // Add noise to a vector of roots (noise are random gauss functions)
577  void add_noise(World & world,std::vector<root> &roots)const;
578 
579  std::vector<root> guess();
580 
582  std::vector<root> guess_big(const std::string exf);
583 
584  // Excitation functions for the guess (x,y,z,r,x^2,xy,xz ...)
585  std::vector<real_function_3d> excitation_functions(const std::string exf) const;
586 
588  bool orthogonalize_fock(World& world,std::vector<root> &roots) const;
589  bool orthogonalize_fock(World& world,std::vector<root> &roots,int iter) const;
590 
592 
599  template<typename solverT>
600  bool iterate_all_CIS_roots(World& world, std::vector<solverT>& solver,
601  std::vector<root>& roots,const std::string mode,const int iter_max) const;
602 
603  bool check_convergence(std::vector<root> &roots)const;
604 
606 
619  template<typename solverT>
620  double iterate_one_CIS_root(World& world, solverT& solver, root& thisroot,const std::string mode)const;
621 
622  template<typename solverT>
623  double iterate_one_CIS_root(World& world, solverT& solver, root& thisroot,const std::string mode,vecfuncT &Vphi)const;
624 
625  // Update the Gamma Potential
626  vecfuncT gamma_update(World &world, const root root)const;
627 
628 
630 
635  vecfuncT apply_gamma(const vecfuncT& x, const vecfuncT& act,
636  const Projector<double,3>& rho0) const ;
637 
641  vecfuncT apply_fock_potential(const vecfuncT& x) const;
642 
644  real_function_3d get_coulomb_potential() const;
646 
655  std::vector<vecfuncT> make_exchange_intermediate(const vecfuncT& active_mo,
656  const vecfuncT& amo) const;
657 
659  double expectation_value(World &world,const root &thisroot,const vecfuncT &Vx)const;
660 
662 
674  Tensor<double> make_perturbed_fock_matrix(const std::vector<root>& roots, const std::vector<vecfuncT> &V) const;
675  //const vecfuncT& act, const Projector<double,3>& rho0) const;
676 
678 
685  bool load_root(World& world, const int i, root& root) const;
686  bool load_root(World& world, const int i, root& root,const std::string filename_end) const;
687 
689 
695  void save_root(World& world, const int i, const root& root) const;
696  void save_root(World& world, const int i, const root& root, const std::string filename_end) const;
697 
699 
704  void normalize(World& world, root& x) const;
705 
706  // For the calculation of the guess energy
707  void orthonormalize_fock(World &world,std::vector<root> &roots)const;
708 
710  void orthonormalize_fock(World &world,std::vector<root> &roots, const std::vector<vecfuncT> &Vphi)const;
711 
713  void orthonormalize(World& world, std::vector<root>& roots) const;
714 
716  Tensor<double> overlap(const std::vector<root>& r1,
717  const std::vector<root>& r2) const;
718 
719 
721 
728  double oscillator_strength_length(const root& root) const;
729 
731 
738  double oscillator_strength_velocity(const root& root) const;
739 
741  void analyze(const std::vector<root>& roots) const;
742 
744  const vecfuncT active_mo() const;
745 
746 };
747 
748 }
749 
750 
751 
752 
753 #endif /* TDHFCIS_H_ */
double operator()(const coord_3d &r) const
Definition: tdhf_CIS.h:125
void error(const char *msg)
Definition: world.cc:128
The CIS class holds all machinery to compute excited state properties.
Definition: tdhf_CIS.h:203
Definition: shared_ptr_bits.h:38
const mpreal exp(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2234
const double pi
Mathematical constant pi.
Definition: constants.h:44
int iter
Definition: tdhf_CIS.h:153
Main include file for MADNESS and defines Function interface.
FunctionDefaults holds default paramaters as static class members.
Definition: funcdefaults.h:175
root operator+=(const root &b)
Definition: tdhf_CIS.h:178
Try to create noise using random gauss functions.
Definition: tdhf_CIS.h:101
root(World &world, const vecfuncT &x1)
Definition: tdhf_CIS.h:137
root & operator=(const root &other)
Definition: tdhf_CIS.h:159
std::istream & position_stream(std::istream &f, const std::string &tag)
Definition: position_stream.cc:37
bool solve_internal_par(const std::string mode, std::vector< root > &roots, const int iter_max)
Definition: tdhf_CIS.cc:205
void solve()
solve the CIS equations for n roots
Definition: tdhf_CIS.cc:161
const double sigma
Definition: dielectric.cc:187
tensorT aeps
orbital energies for alpha and beta orbitals
Definition: chem/SCF.h:745
::std::string string
Definition: gtest-port.h:872
root(World &world, vecfuncT &x, double omega)
Definition: tdhf_CIS.h:136
Definition: chem/SCF.h:712
root operator*(double a)
Definition: tdhf_CIS.h:183
std::shared_ptr< FunctionFunctorInterface< double, 3 > > functorT
Definition: tdhf_CIS.h:103
double V(const Vector< double, 3 > &r)
Definition: apps/ii/hatom_energy.cc:46
NDIM & f
Definition: mra.h:2179
bool converged
Definition: tdhf_CIS.h:150
POD holding excitation energy and response vector for a single excitation.
Definition: tdhf_CIS.h:134
Function< TENSOR_RESULT_TYPE(L, R), NDIM > add(const Function< L, NDIM > &left, const Function< R, NDIM > &right, bool fence=true)
Same as operator+ but with optional fence and no automatic compression.
Definition: mra.h:1734
vecfuncT x
Definition: tdhf_CIS.h:147
void print_root(const root &root) const
Definition: tdhf_CIS.cc:112
std::vector< double > amplitudes_
Definition: tdhf_CIS.h:156
root(const root &other)
Definition: tdhf_CIS.h:138
gauss_function(double molecule_box)
Definition: tdhf_CIS.h:84
vecfuncT amo
alpha and beta molecular orbitals
Definition: chem/SCF.h:729
double err
Definition: tdhf_CIS.h:151
int number
Definition: tdhf_CIS.h:154
bool print_grid() const
are we supposed to print the grid for an external guess
Definition: tdhf_CIS.cc:248
std::vector< root > & roots()
return the roots of the response equation
Definition: tdhf_CIS.cc:245
Implements most functionality of separated operators.
noise(double size, double width)
Definition: tdhf_CIS.h:107
double delta
Definition: tdhf_CIS.h:152
Defines operations on vectors of FunctionsThis file defines a number of operations on vectors of func...
void scale(World &world, std::vector< Function< T, NDIM > > &v, const std::vector< Q > &factors, bool fence=true)
Scales inplace a vector of functions by distinct values.
Definition: vmra.h:290
CalculationParameters param
Definition: chem/SCF.h:717
root(World &world)
Definition: tdhf_CIS.h:135
World & world
Definition: tdhf_CIS.h:146
Generalized version of NonlinearSolver not limited to a single madness function.
Definition: nonlinsol.h:174
Example implementation of Krylov-subspace nonlinear equation solver.
Gauss_function structure is needed to mimic noise.
Definition: tdhf_CIS.h:79
double lo
Smallest length scale we need to resolve.
Definition: chem/SCF.h:305
Function< TENSOR_RESULT_TYPE(L, R), NDIM > sub(const Function< L, NDIM > &left, const Function< R, NDIM > &right, bool fence=true)
Same as operator- but with optional fence and no automatic compression.
Definition: mra.h:1778
double operator()(const coord_3d &r) const
Definition: tdhf_CIS.h:92
FLOAT a(int j, FLOAT z)
Definition: y1.cc:86
noise(double size)
Definition: tdhf_CIS.h:106
void Analyze()
Read and analyze roots.
Definition: tdhf_CIS.cc:131
vector< functionT > vecfuncT
Definition: chem/corepotential.cc:61
root(World &world, double omega, double expv, double delta, double error, bool converged, int iter, int number)
Definition: tdhf_CIS.h:143
double expv
Definition: tdhf_CIS.h:149
std::shared_ptr< FunctionFunctorInterface< double, 3 > > functorT
Definition: tdhf_CIS.h:81
tensorT sqrt(const tensorT &s, double tol=1e-8)
Computes matrix square root (not used any more?)
Definition: DFcode/moldft.cc:446
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
void print_roots(const std::vector< root > &roots) const
Definition: tdhf_CIS.cc:97
const SCF & get_calc() const
return the HF reference
Definition: tdhf_CIS.h:392
InputParameters param
Definition: extra.cc:12
double omega
Definition: tdhf_CIS.h:148
bool operator>(const root &other) const
Definition: tdhf_CIS.h:191
void sort_roots(std::vector< root > &roots, std::string criterium) const
If roots[j] < roots[i] and i
Definition: tdhf_CIS.cc:122
Abstract base class interface required for functors used as input to Functions.
Definition: function_interface.h:58
ProcessID rank() const
Returns the process rank in this world (same as MPI_Comm_rank()))
Definition: worldfwd.h:526
const double delta
Definition: dielectric_external_field.cc:120
Implements (2nd generation) static load/data balancing for functions.
void print(const A &a)
Print a single item to std::cout terminating with new line.
Definition: print.h:122
CIS(World &world, const SCF &calc, const std::string input)
ctor
Definition: tdhf_CIS.h:265
bool operator<(const root &other) const
Definition: tdhf_CIS.h:188
const mpreal fabs(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2187
A random number generator (portable, vectorized, and thread-safe)
Definition: ran.h:72
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
FLOAT b(int j, FLOAT z)
Definition: y1.cc:79
double wall_time()
Returns the wall time in seconds relative to arbitrary origin.
Definition: world.cc:248
const mpreal root(const mpreal &v, unsigned long int k, mp_rnd_t rnd_mode)
Definition: mpreal.h:2180
root operator-(const root &b) const
Definition: tdhf_CIS.h:174
double get()
Definition: ran.h:90