40 #ifndef MADNESS_CHEM_SCF_H__INCLUDED
41 #define MADNESS_CHEM_SCF_H__INCLUDED
64 typedef std::vector<functionT>
vecfuncT;
79 const std::vector<int> & set,
80 const std::vector<int> & at_to_bf,
81 const std::vector<int> & at_nbf,
82 const double thresh = 1e-9,
83 const double thetamax = 0.5,
84 const bool randomize =
true,
85 const bool doprint =
false);
101 static double mask3(
const coordT& ruser) {
103 user_to_sim(ruser, rsim);
104 double x= rsim[0], y=rsim[1], z=rsim[2];
105 double lo = 0.0625, hi = 1.0-lo, result = 1.0;
109 result *=
mask1(x*rlo);
111 result *=
mask1((1.0-x)*rlo);
113 result *=
mask1(y*rlo);
115 result *=
mask1((1.0-y)*rlo);
117 result *=
mask1(z*rlo);
119 result *=
mask1((1.0-z)*rlo);
130 : molecule(molecule), aobasis(aobasis) {}
150 return aofunc(x[0], x[1], x[2]);
166 : molecule(molecule), atom(atom), axis(axis)
183 std::vector<coordT> specialpt;
186 : molecule(molecule), atom(atom), axis(axis) {}
214 double xi=1.0, yj=1.0, zk=1.0;
215 for (
int p=0; p<i; ++p) xi *= r[0];
216 for (
int p=0; p<j; ++p) yj *= r[1];
217 for (
int p=0; p<k; ++p) zk *= r[2];
231 double omega) : _omega(omega)
242 template <
typename T,
int NDIM>
246 lbcost(
double leaf_value=1.0,
double parent_value=0.0) : leaf_value(leaf_value), parent_value(parent_value) {}
248 if (key.
level() < 1) {
325 template <
typename Archive>
327 ar & charge & smear & econv & dconv & k & L & maxrotn & nvalpha & nvbeta
329 ar & plotlo & plothi & plotdens & plotcoul & localize & localize_pm
330 & restart & save & no_compute &no_orient & maxsub & orbitalshift & npt_plot & plot_cell &
aobasis;
331 ar & nalpha & nbeta & nmo_alpha & nmo_beta &
lo;
332 ar & core_type & derivatives & conv_only_dens &
dipole;
334 ar & gopt & gtol & gtest & gval & gprec & gmaxiter & algopt & tdksprop &
psp_calc;
351 , spin_restricted(true)
369 , conv_only_dens(false)
385 , nuclear_corrfac(
"none")
397 std::ifstream
f(filename.c_str());
407 else if (s ==
"charge") {
410 else if (s ==
"smear") {
413 else if (s ==
"econv") {
416 else if (s ==
"dconv") {
425 else if (s ==
"maxrotn") {
428 else if (s ==
"nvalpha") {
431 else if (s ==
"nvbeta") {
434 else if (s ==
"nopen") {
437 else if (s ==
"unrestricted") {
438 spin_restricted =
false;
440 else if (s ==
"restricted") {
441 spin_restricted =
true;
443 else if (s ==
"maxiter") {
446 else if (s ==
"nio") {
449 else if (s ==
"xc") {
451 f.getline(buf,
sizeof(buf));
454 else if (s ==
"protocol") {
457 protocol_data = std::vector<double>();
459 std::stringstream s(buf);
460 while (s >> d) protocol_data.push_back(d);
462 else if (s ==
"plotmos") {
465 else if (s ==
"plotdens") {
486 else if (s ==
"plotcoul") {
489 else if (s ==
"plotnpt") {
492 else if (s ==
"plotcell") {
496 else if (s ==
"aobasis") {
498 if (aobasis!=
"sto-3g" && aobasis!=
"sto-6g" && aobasis!=
"6-31g") {
499 std::cout <<
"moldft: unrecognized aobasis (sto-3g or sto-6g or 6-31g only): " << aobasis << std::endl;
503 else if (s ==
"canon") {
506 else if (s ==
"local") {
509 else if (s ==
"pm") {
512 else if (s ==
"boys") {
515 else if (s ==
"restart") {
518 else if (s ==
"save") {
522 if (tmp_save==
"true"){
525 else if (tmp_save==
"false"){
529 std::cout <<
"moldft: unrecognized value for save (true or false only): " << tmp_save << std::endl;
533 else if (s ==
"no_compute") {
536 else if (s ==
"no_orient") {
539 else if (s ==
"maxsub") {
541 if (maxsub <= 0) maxsub = 1;
542 if (maxsub > 20) maxsub = 20;
544 else if (s ==
"orbitalshift") {
547 else if (s ==
"core_type") {
550 else if (s ==
"derivatives") {
553 else if (s ==
"dipole") {
556 else if (s ==
"convonlydens") {
557 conv_only_dens =
true;
559 else if (s ==
"gopt") {
562 else if (s ==
"gtol") {
565 else if (s ==
"gtest") {
568 else if (s ==
"gval") {
571 else if (s ==
"gprec") {
574 else if (s ==
"gmaxiter") {
577 else if (s ==
"algopt") {
579 f.getline(buf,
sizeof(buf));
582 else if (s ==
"tdksprop") {
585 else if (s ==
"nuclear_corrfac") {
590 else if (s ==
"psp_calc") {
594 std::cout <<
"moldft: unrecognized input keyword " << s << std::endl;
597 if (nopen != 0) spin_restricted =
false;
603 int nelec = int(z - charge - n_core*2);
604 if (
fabs(nelec+charge+n_core*2-z) > 1e-6) {
605 error(
"non-integer number of electrons?", nelec+charge+n_core*2-z);
607 nalpha = (nelec +
nopen)/2;
608 nbeta = (nelec -
nopen)/2;
609 if (nalpha < 0)
error(
"negative number of alpha electrons?", nalpha);
610 if (nbeta < 0)
error(
"negative number of beta electrons?", nbeta);
611 if ((nalpha+nbeta) != nelec)
error(
"nalpha+nbeta != nelec", nalpha+nbeta);
613 nmo_beta = nbeta +
nvbeta;
614 if (nalpha != nbeta) spin_restricted =
false;
619 int nbf = aobasis.
nbf(molecule);
620 nmo_alpha =
std::min(nbf,nmo_alpha);
622 if (nalpha>nbf || nbeta>nbf)
error(
"too few basis functions?", nbf);
623 nvalpha = nmo_alpha -
nalpha;
624 nvbeta = nmo_beta -
nbeta;
653 #ifdef MADNESS_HAS_LIBXC
671 madness::print(
" Convergence criteria are density delta & BSH residual.");
676 if (plot_cell.size() > 0)
683 if (!localize_pm) loctype =
"boys";
747 std::vector< std::shared_ptr<real_derivative_3d> >
gradop;
754 SCF(
World & world,
const char *filename);
756 template<std::
size_t NDIM>
763 else if(thresh >= 0.9e-4)
765 else if(thresh >= 0.9e-6)
767 else if(thresh >= 0.9e-8)
792 coulop =
poperatorT(CoulombOperatorPtr(world, param.
lo, thresh));
793 gradop = gradient_operator<double,3>(world);
795 if(world.
rank() == 0){
796 print(
"\nSolving NDIM=",
NDIM,
" with thresh", thresh,
" k",
820 const tensorT& occ,
const int nmo)
const;
830 distmatT
localize_PM(
World & world,
const vecfuncT & mo,
const std::vector<int> & set,
831 const double thresh = 1e-9,
const double thetamax = 0.5,
832 const bool randomize =
true,
const bool doprint =
false)
const;
836 const tensorT &
energy =
tensorT(),
const std::vector<int> & set = std::vector<int>());
838 inline double DIP(
const tensorT & dip,
int i,
int j,
int k,
int l) {
839 return dip(i, j, 0) * dip(k, l, 0) + dip(i, j, 1) * dip(k, l, 1) + dip(i, j, 2) * dip(k, l, 2);
852 const tensorT & occ,
int atom,
int axis);
858 functionT
make_density(
World & world,
const tensorT & occ,
const vecfuncT & v)
const;
872 const vecfuncT &
psi,
const vecfuncT &
f)
const ;
880 return multiop_values<double, xc_potential, 3>(
xc_potential(xc, ispin, what), vf);
885 functionT vlda = multiop_values<double, xc_functional, 3>(
xc_functional(xc, ispin), vf);
890 const vecfuncT & amo,
const vecfuncT& vf,
const vecfuncT& delrho,
891 const functionT & vlocal,
double & exc,
double & enl,
int ispin);
897 void vector_stats(
const std::vector<double> & v,
double & rms,
898 double & maxabsval)
const;
901 const vecfuncT &
psi, vecfuncT & Vpsi,
double & err);
904 const vecfuncT & Vpsi,
const tensorT & occ,
905 double & ekinetic)
const;
910 return apply(*coulop, rho);
931 tensorT& fock, tensorT& evals,
const tensorT& occ,
932 const double thresh_degenerate)
const;
947 vecfuncT&
psi, vecfuncT& Vpsi, tensorT& evals,
948 const tensorT& occ,
const double thresh)
const;
951 void loadbal(
World & world, functionT & arho, functionT & brho, functionT & arho_old,
952 functionT & brho_old, subspaceT & subspace);
956 int lo,
int nfunc,
double trantol)
const;
959 int lo,
int nfunc,
double trantol)
const;
962 vecfuncT & Vpsia, vecfuncT & Vpsib,
963 tensorT & focka, tensorT & fockb,
964 subspaceT & subspace, tensorT & Q,
965 double & bsh_residual,
double & update_residual);
990 complex_functionT
APPLY(
const complex_operatorT* q1d,
const complex_functionT&
psi) {
991 complex_functionT r =
psi;
1010 cvecfuncT& camo, cvecfuncT& cbmo,
double t,
double time_step,
1026 mutable double coords_sum;
1038 double xsq = x.sumsq();
1039 if (xsq == coords_sum) {
1092 madness::Tensor<double>
gradient(
const Tensor<double>& x) {
bool is_leaf() const
Returns true if this does not have children.
Definition: funcimpl.h:202
distmatT localize_PM(World &world, const vecfuncT &mo, const std::vector< int > &set, const double thresh=1e-9, const double thetamax=0.5, const bool randomize=true, const bool doprint=false) const
compute the unitary localization matrix according to Pipek-Mezey
Definition: chem/SCF.cc:483
int gmaxiter
optimization maxiter
Definition: chem/SCF.h:313
bool conv_only_dens
If true remove bsh_residual from convergence criteria how ugly name is...
Definition: chem/SCF.h:299
std::shared_ptr< PotentialManager > potentialmanager
Definition: chem/SCF.h:714
void error(const char *msg)
Definition: world.cc:128
double operator()(const coordT &x) const
Definition: chem/SCF.h:149
Definition: chem/SCF.h:243
Definition: chem/SCF.h:158
Molecule molecule
Definition: chem/SCF.h:716
Definition: shared_ptr_bits.h:38
double make_dft_energy(World &world, const vecfuncT &vf, int ispin)
Definition: chem/SCF.h:883
vecfuncT apply_hf_exchange(World &world, const tensorT &occ, const vecfuncT &psi, const vecfuncT &f) const
apply the HF exchange on a set of orbitals
Definition: chem/SCF.cc:1067
A MADNESS functor to compute the cartesian moment x^i * y^j * z^k (i, j, k integer and >= 0) ...
Definition: chem/SCF.h:207
double operator()(const coordT &x) const
Definition: chem/SCF.h:132
tensorT make_fock_matrix(World &world, const vecfuncT &psi, const vecfuncT &Vpsi, const tensorT &occ, double &ekinetic) const
Definition: chem/SCF.cc:1435
double DIP(const tensorT &dip, int i, int j, int k, int l)
Definition: chem/SCF.h:838
Main include file for MADNESS and defines Function interface.
bool no_orient
If true the molecule coordinates will not be reoriented.
Definition: chem/SCF.h:289
FunctionDefaults holds default paramaters as static class members.
Definition: funcdefaults.h:175
int nbeta
Number of beta spin electrons.
Definition: chem/SCF.h:302
MomentFunctor(const std::vector< int > &x)
Definition: chem/SCF.h:212
double core_projector_derivative(World &world, const vecfuncT &mo, const tensorT &occ, int atom, int axis)
Definition: chem/SCF.cc:746
static void set_autorefine(bool value)
Sets the default adaptive autorefinement flag.
Definition: funcdefaults.h:295
AtomicBasisFunctor(const AtomicBasisFunction &aofunc)
Definition: chem/SCF.h:145
double get_eprec() const
Definition: chem/molecule.h:178
const int NDIM
Definition: tdse1.cc:44
MolecularEnergy(World &world, SCF &calc)
Definition: chem/SCF.h:1029
double econv
Energy convergence.
Definition: chem/SCF.h:271
std::vector< madness::Vector< double, 3 > > get_all_coords_vec() const
Definition: chem/molecule.cc:188
double do_step_restriction(World &world, const vecfuncT &mo, vecfuncT &mo_new, std::string spin) const
perform step restriction following the KAIN solver
Definition: chem/SCF.cc:1851
std::istream & position_stream(std::istream &f, const std::string &tag)
Definition: position_stream.cc:37
int plothi
Range of MOs to print (for both spins if polarized)
Definition: chem/SCF.h:282
MolecularGuessDensityFunctor(const Molecule &molecule, const AtomicBasisSet &aobasis)
Definition: chem/SCF.h:129
CorePotentialDerivativeFunctor(const Molecule &molecule, int atom, int axis)
Definition: chem/SCF.h:185
tensorT aeps
orbital energies for alpha and beta orbitals
Definition: chem/SCF.h:745
Function< T, 3 > operator()(const double t) const
Definition: chem/SCF.h:236
::std::string string
Definition: gtest-port.h:872
functionT make_coulomb_potential(const functionT &rho) const
make the Coulomb potential given the total density
Definition: chem/SCF.h:909
unsigned int maxsub
Size of iterative subspace ... set to 0 or 1 to disable.
Definition: chem/SCF.h:291
const mpreal cos(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2255
std::shared_ptr< GTHPseudopotential< double > > gthpseudopotential
Definition: chem/SCF.h:715
poperatorT coulop
Definition: chem/SCF.h:746
MomentFunctor(int i, int j, int k)
Definition: chem/SCF.h:211
double smallest_length_scale() const
Definition: chem/molecule.cc:315
void load_mos(World &world)
Definition: chem/SCF.cc:277
double parent_value
Definition: chem/SCF.h:245
vecfuncT compute_residual(World &world, tensorT &occ, tensorT &fock, const vecfuncT &psi, vecfuncT &Vpsi, double &err)
Definition: chem/SCF.cc:1379
Definition: chem/SCF.h:712
void orthonormalize(World &world, vecfuncT &amo_new) const
orthonormalize the vectors
Definition: chem/SCF.cc:1882
A MADNESS functor to compute either x, y, or z.
Definition: chem/SCF.h:194
Function< TENSOR_RESULT_TYPE(typename opT::opT, R), NDIM > apply_1d_realspace_push(const opT &op, const Function< R, NDIM > &f, int axis, bool fence=true)
Definition: mra.h:2032
Tensor< double > twoint(World &world, const vecfuncT &psi) const
Compute the two-electron integrals over the provided set of orbitals.
Definition: chem/SCF.cc:1471
Provides the common functionality/interface of all 1D convolutions.
Definition: convolution1d.h:247
tensorT diag_fock_matrix(World &world, tensorT &fock, vecfuncT &psi, vecfuncT &Vpsi, tensorT &evals, const tensorT &occ, const double thresh) const
diagonalize the fock matrix, taking care of degenerate states
Definition: chem/SCF.cc:1641
static void set_initial_level(int value)
Sets the default initial projection level.
Definition: funcdefaults.h:244
bool gopt
geometry optimizer
Definition: chem/SCF.h:308
std::vector< pairvecfuncT > subspaceT
Definition: chem/SCF.h:66
int maxiter
Maximum number of iterations.
Definition: chem/SCF.h:279
int nmo_beta
Number of beta spin molecular orbitals.
Definition: chem/SCF.h:304
std::vector< int > at_to_bf
Definition: chem/SCF.h:739
CalculationParameters()
Definition: chem/SCF.h:338
void vector_stats(const std::vector< double > &v, double &rms, double &maxabsval) const
Definition: chem/SCF.cc:1368
FunctionFactory< double, 3 > factoryT
Definition: chem/corepotential.cc:60
double gtol
geometry tolerance
Definition: chem/SCF.h:309
std::string xc_data
XC input line.
Definition: chem/SCF.h:306
NDIM & f
Definition: mra.h:2179
void initial_guess(World &world)
Definition: chem/SCF.cc:788
madness::Vector< double, 3 > get_coords() const
Definition: chem/molecule.h:71
std::shared_ptr< operatorT > poperatorT
Definition: chem/SCF.h:71
static void set_refine(bool value)
Sets the default adaptive refinement flag.
Definition: funcdefaults.h:283
Definition: chem/SCF.h:124
ProcessID size() const
Returns the number of processes in this world (same as MPI_Comm_size())
Definition: worldfwd.h:533
static const double & get_thresh()
Returns the default threshold.
Definition: funcdefaults.h:225
Defines interfaces for optimization and non-linear equation solvers.
vecfuncT core_projection(World &world, const vecfuncT &psi, const bool include_Bc=true)
Definition: chem/SCF.cc:708
Vector< double, 3 > coordT
Definition: chem/corepotential.cc:57
madness::Tensor< double > gradient(const Tensor< double > &x)
Should return the derivative of the function.
Definition: chem/SCF.h:1092
Class to compute terms of the potential.
Definition: chem/xcfunctional.h:282
double L
User coordinates box size.
Definition: chem/SCF.h:274
double value(const Tensor< double > &x)
Should return the value of the objective function.
Definition: chem/SCF.h:1037
void solve(World &world)
Definition: chem/SCF.cc:2072
void read_file(const std::string &filename)
Definition: chem/SCF.h:396
void set_all_coords(const madness::Tensor< double > &newcoords)
Definition: chem/molecule.cc:199
AtomicBasisSet aobasis
Definition: chem/SCF.h:719
vecfuncT amo
alpha and beta molecular orbitals
Definition: chem/SCF.h:729
std::vector< int > aset
Definition: chem/SCF.h:733
double gval
value precision
Definition: chem/SCF.h:311
Definition: chem/SCF.h:140
double operator()(const Key< NDIM > &key, const FunctionNode< T, NDIM > &node) const
Definition: chem/SCF.h:247
static void set_project_randomize(bool value)
Sets the random load balancing for projection flag.
Definition: funcdefaults.h:340
madness::Vector< double, 3 > get_coords_vec() const
Definition: chem/molecularbasis.h:385
Function< std::complex< double >, 3 > complex_functionT
Definition: chem/SCF.h:72
functionT mask
Definition: chem/SCF.h:726
std::shared_ptr< FunctionFunctorInterface< double, 3 > > functorT
Definition: chem/corepotential.cc:58
tensorT beps
Definition: chem/SCF.h:745
static const int vnucextra
Definition: chem/SCF.h:752
int natom() const
Definition: chem/molecule.h:148
Definition: chem/SCF.h:261
A generic functor to compute external potential for TDDFT.
Definition: chem/SCF.h:224
int nbf(const Molecule &molecule) const
Given a molecule count the number of basis functions.
Definition: chem/molecularbasis.h:498
static void set_truncate_mode(int value)
Sets the default truncation mode.
Definition: funcdefaults.h:270
vecfuncT ao
MRA projection of the minimal basis set.
Definition: chem/SCF.h:736
pcomplex_operatorT G
Definition: tdse1d.cc:168
lbcost(double leaf_value=1.0, double parent_value=0.0)
Definition: chem/SCF.h:246
std::vector< coordT > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: chem/SCF.h:136
#define max(a, b)
Definition: lda.h:53
bool no_compute
If true use orbitals on disk, set value to computed.
Definition: chem/SCF.h:288
functionT make_dft_potential(World &world, const vecfuncT &vf, int ispin, int what)
Definition: chem/SCF.h:878
int nvbeta
Number of beta virtuals to compute.
Definition: chem/SCF.h:277
void reconstruct(bool fence=true) const
Reconstructs the function, transforming into scaling function basis. Possible non-blocking comm...
Definition: mra.h:737
CalculationParameters param
Definition: chem/SCF.h:717
const int k
Definition: dielectric.cc:184
int nio
No. of io servers to use.
Definition: chem/SCF.h:280
functionT make_lda_potential(World &world, const functionT &arho)
Definition: chem/SCF.cc:1142
double dconv
Density convergence.
Definition: chem/SCF.h:272
bool tdksprop
time-dependent Kohn-Sham equation propagate
Definition: chem/SCF.h:315
Definition: chem/SCF.h:178
distmatT kinetic_energy_matrix(World &world, const vecfuncT &v) const
Definition: chem/SCF.cc:693
The interface to be provided by functions to be optimized.
Definition: solvers.h:176
DistributedMatrix< double > distributed_localize_PM(World &world, const vecfuncT &mo, const vecfuncT &ao, const std::vector< int > &set, const std::vector< int > &at_to_bf, const std::vector< int > &at_nbf, const double thresh=1e-9, const double thetamax=0.5, const bool randomize=true, const bool doprint=false)
Definition: chem/distpm.cc:269
Used to represent one basis function from a shell on a specific center.
Definition: chem/molecularbasis.h:335
double nuclear_attraction_potential_derivative(int atom, int axis, double x, double y, double z) const
Definition: chem/molecule.cc:602
tensorT dipole(World &world)
Definition: chem/SCF.cc:1335
T trace() const
Returns global value of int(f(x),x) ... global comm required.
Definition: mra.h:1034
double lo
Smallest length scale we need to resolve.
Definition: chem/SCF.h:305
void propagate(World &world, double omega, int step0)
Definition: chem/SCF.cc:1909
const mpreal min(const mpreal &x, const mpreal &y)
Definition: mpreal.h:2675
void make_nuclear_potential(World &world)
Definition: chem/SCF.cc:448
void iterate_trotter(World &world, Convolution1D< double_complex > *G, cvecfuncT &camo, cvecfuncT &cbmo, double t, double time_step, double thresh)
Definition: chem/SCF.cc:2004
int k
polynomial order
Definition: chem/SCF.h:273
double psi(const Vector< double, 3 > &r)
Definition: apps/ii/hatom_energy.cc:42
void gprint(World &world) const
Definition: chem/SCF.h:701
Function< double, 3 > functionT
Definition: chem/corepotential.cc:59
bool dipole
If true calculatio dipole moment.
Definition: chem/SCF.h:298
Level level() const
Definition: key.h:220
double operator()(const coordT &x) const
Definition: chem/SCF.h:199
std::vector< coordT > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: chem/SCF.h:153
void loadbal(World &world, functionT &arho, functionT &brho, functionT &arho_old, functionT &brho_old, subspaceT &subspace)
Definition: chem/SCF.cc:1667
double total_nuclear_charge() const
Definition: chem/molecule.cc:560
double operator()(const coordT &r) const
Definition: chem/SCF.h:213
std::vector< int > bset
Definition: chem/SCF.h:733
vector< functionT > vecfuncT
Definition: chem/corepotential.cc:61
tensorT aocc
occupation numbers for alpha and beta orbitals
Definition: chem/SCF.h:742
Tensor< double > tensorT
Definition: chem/distpm.cc:13
double operator()(const coordT &x) const
Definition: chem/SCF.h:169
std::string core_type
core potential type ("" or "mcp")
Definition: chem/SCF.h:296
std::vector< std::shared_ptr< real_derivative_3d > > gradop
Definition: chem/SCF.h:747
void save_mos(World &world)
Definition: chem/SCF.cc:260
void set_eprec(double value)
updates rcuts with given eprec
Definition: chem/molecule.cc:209
double vtol
Definition: chem/SCF.h:748
vecfuncT apply_potential(World &world, const tensorT &occ, const vecfuncT &amo, const vecfuncT &vf, const vecfuncT &delrho, const functionT &vlocal, double &exc, double &enl, int ispin)
Definition: chem/SCF.cc:1149
bool provides_gradient() const
Override this to return true if the derivative is implemented.
Definition: chem/SCF.h:1035
int nvalpha
Number of alpha virtuals to compute.
Definition: chem/SCF.h:276
void update_subspace(World &world, vecfuncT &Vpsia, vecfuncT &Vpsib, tensorT &focka, tensorT &fockb, subspaceT &subspace, tensorT &Q, double &bsh_residual, double &update_residual)
Definition: chem/SCF.cc:1715
void set_molecular_info(const Molecule &molecule, const AtomicBasisSet &aobasis, unsigned int n_core)
Definition: chem/SCF.h:601
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
SeparatedConvolution< double, 3 > operatorT
Definition: chem/SCF.h:70
double orbitalshift
scf orbital shift: shift the occ orbitals to lower energies
Definition: chem/SCF.h:292
DipoleFunctor(int axis)
Definition: chem/SCF.h:198
double core_potential_derivative(int atom, int axis, double x, double y, double z) const
Definition: chem/molecule.cc:687
SCF(World &world, const char *filename)
Definition: chem/SCF.cc:214
double eval_guess_density(const Molecule &molecule, double x, double y, double z) const
Evaluates the guess density.
Definition: chem/molecularbasis.h:520
std::pair< vecfuncT, vecfuncT > pairvecfuncT
Definition: chem/SCF.h:65
std::vector< complex_functionT > cvecfuncT
Definition: chem/SCF.h:73
double operator()(const coordT &r) const
Definition: chem/SCF.h:188
XCfunctional xc
Definition: chem/SCF.h:718
void broaden(const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), bool fence=true) const
Inplace broadens support in scaling function basis.
Definition: mra.h:779
void serialize(Archive &ar)
Definition: chem/SCF.h:326
static void set_thresh(double value)
Sets the default threshold.
Definition: funcdefaults.h:232
double bounding_cube() const
Returns the half width of the bounding cube.
Definition: chem/molecule.cc:550
double leaf_value
Definition: chem/SCF.h:244
FunctionNode holds the coefficients, etc., at each node of the 2^NDIM-tree.
Definition: derivative.h:58
void initial_load_bal(World &world)
Definition: chem/SCF.cc:987
Abstract base class interface required for functors used as input to Functions.
Definition: function_interface.h:58
double mask1(double x)
Definition: chem/SCF.h:87
ProcessID rank() const
Returns the process rank in this world (same as MPI_Comm_rank()))
Definition: worldfwd.h:526
void analyze_vectors(World &world, const vecfuncT &mo, const tensorT &occ=tensorT(), const tensorT &energy=tensorT(), const std::vector< int > &set=std::vector< int >())
Definition: chem/SCF.cc:497
Convolution1D< double_complex > complex_operatorT
Definition: chem/SCF.h:74
Definition: chem/molecule.h:83
complex_functionT APPLY(const complex_operatorT *q1d, const complex_functionT &psi)
Definition: chem/SCF.h:990
Definition: convolution1d.h:837
bool restart
If true restart from orbitals on disk.
Definition: chem/SCF.h:287
std::vector< int > at_nbf
Definition: chem/SCF.h:739
std::shared_ptr< WorldDCPmapInterface< Key< 3 > > > pmapT
Definition: chem/SCF.h:60
MolecularDerivativeFunctor(const Molecule &molecule, int atom, int axis)
Definition: chem/SCF.h:165
std::string aobasis
AO basis used for initial guess (6-31g or sto-3g)
Definition: chem/SCF.h:295
tensorT get_fock_transformation(World &world, const tensorT &overlap, tensorT &fock, tensorT &evals, const tensorT &occ, const double thresh_degenerate) const
compute the unitary transformation that diagonalizes the fock matrix
Definition: chem/SCF.cc:1536
static void set_apply_randomize(bool value)
Sets the random load balancing for integral operators flag.
Definition: funcdefaults.h:329
bool save
If true save orbitals to disk.
Definition: chem/SCF.h:290
std::vector< double > protocol_data
Calculation protocol.
Definition: chem/SCF.h:307
bool gtest
geometry tolerance
Definition: chem/SCF.h:310
static void set_cubic_cell(double lo, double hi)
Sets the user cell to be cubic with each dimension having range [lo,hi].
Definition: funcdefaults.h:384
VextCosFunctor(World &world, const FunctionFunctorInterface< T, 3 > *functor, double omega)
Definition: chem/SCF.h:228
void project(World &world)
Definition: chem/SCF.cc:427
functionT make_density(World &world, const tensorT &occ, const vecfuncT &v) const
Definition: chem/SCF.cc:999
double maxrotn
Step restriction used in autoshift algorithm.
Definition: chem/SCF.h:275
double smear
Smearing parameter.
Definition: chem/SCF.h:270
void sum_down(bool fence=true) const
Sums scaling coeffs down tree restoring state with coeffs only at leaves. Optional fence...
Definition: mra.h:746
std::vector< T > vector_factory(const T &v0)
Returns a std::vector initialized from the arguments.
Definition: vector_factory.h:50
tensorT matrix_exponential(const tensorT &A) const
Definition: chem/SCF.cc:1491
Class to compute the energy functional.
Definition: chem/xcfunctional.h:266
void print(const A &a)
Print a single item to std::cout terminating with new line.
Definition: print.h:122
Contracted Gaussian basis.
Definition: chem/molecularbasis.h:391
DistributedMatrix< double > distmatT
Definition: chem/SCF.h:68
int nmo_alpha
Number of alpha spin molecular orbitals.
Definition: chem/SCF.h:303
tensorT derivatives(World &world)
Definition: chem/SCF.cc:1255
#define MADNESS_EXCEPTION(msg, value)
Definition: worldexc.h:88
void project_ao_basis(World &world)
Definition: chem/SCF.cc:459
bool plotdens
If true print the density at convergence.
Definition: chem/SCF.h:283
bool localize
If true solve for localized orbitals.
Definition: chem/SCF.h:285
Definition: chem/SCF.h:1023
std::string nuclear_corrfac
nuclear correlation factor
Definition: chem/SCF.h:316
bool derivatives
If true calculate derivatives.
Definition: chem/SCF.h:297
tensorT bocc
Definition: chem/SCF.h:742
bool localize_pm
If true use PM for localization.
Definition: chem/SCF.h:286
int plotlo
Definition: chem/SCF.h:282
Simplified interface to XC functionals.
Definition: chem/xcfunctional.h:41
FunctionFactory implements the named-parameter idiom for Function.
Definition: funcimpl.h:70
bool psp_calc
pseudopotential calculation or all electron
Definition: chem/SCF.h:317
int npt_plot
No. of points to use in each dim for plots.
Definition: chem/SCF.h:293
const mpreal fabs(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2187
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
double charge
Total molecular charge.
Definition: chem/SCF.h:269
void set_protocol(World &world, double thresh)
Definition: chem/SCF.h:757
Function< T, NDIM > apply(const Derivative< T, NDIM > &D, const Function< T, NDIM > &f, bool fence=true)
Applies derivative operator to function (for syntactic equivalence to integral operator apply) ...
Definition: derivative.h:613
bool plotcoul
If true plot the total coulomb potential at convergence.
Definition: chem/SCF.h:284
tensorT plot_cell
lo hi in each dimension for plotting (default is all space)
Definition: chem/SCF.h:294
int nalpha
Number of alpha spin electrons.
Definition: chem/SCF.h:301
std::vector< int > group_orbital_sets(World &world, const tensorT &eps, const tensorT &occ, const int nmo) const
group orbitals into sets of similar orbital energies for localization
Definition: chem/SCF.cc:964
int nopen
Number of unpaired electrons = napha-nbeta.
Definition: chem/SCF.h:278
Key is the index for a node of the 2^NDIM-tree.
Definition: key.h:69
std::vector< coordT > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: chem/SCF.h:173
const Atom & get_atom(unsigned int i) const
Definition: chem/molecule.cc:223
static void set_k(int value)
Sets the default wavelet order.
Definition: funcdefaults.h:219
void rotate_subspace(World &world, const tensorT &U, subspaceT &subspace, int lo, int nfunc, double trantol) const
Definition: chem/SCF.cc:1695
std::string algopt
algorithm used for optimization
Definition: chem/SCF.h:314
double gprec
gradient precision
Definition: chem/SCF.h:312
void do_plots(World &world)
Definition: chem/SCF.cc:380
std::vector< poperatorT > make_bsh_operators(World &world, const tensorT &evals)
Definition: chem/SCF.cc:1040
void print(World &world) const
Definition: chem/SCF.h:637
double current_energy
Definition: chem/SCF.h:749
bool spin_restricted
True if spin restricted.
Definition: chem/SCF.h:281
vecfuncT bmo
Definition: chem/SCF.h:729