6#ifndef MADNESS_APPS_DFGUESSPARAMS_H_INCLUDED
7#define MADNESS_APPS_DFGUESSPARAMS_H_INCLUDED
43 if(world.
rank()==0)
print(
"\n Reading initial data from restarted DF calculation");
66 for(
int j=0; j < 4; j++){
75 std::vector<int> dummy2;
80 unsigned int version=0;
82 std::string localize_method;
91 input & localize_method;
94 input & temp_energies;
102 if (order < 1 or order > 30){
103 if(world.
rank() == 0)
print(
"\n ***PLEASE NOTE***\n Invalid wavelet order read from archive, setting to 8.\n This seems to happen when the default wavelet order is used in moldft.");
117 std::complex<double> myi(0,1);
125 Fcwf spindown(world);
140 spinup[0] = complexreader;
142 spinup[2] = (-myi) * Dz(complexreader);
143 spinup[2].
scale(0.5);
144 spinup[3] = (-myi) * (Dx(complexreader) + myi * Dy(complexreader));
145 spinup[3].
scale(0.5);
163 spinup[0] = complexreader;
165 spinup[2] = (-myi) * Dz(complexreader);
166 spinup[2].
scale(0.5);
167 spinup[3] = (-myi) * (Dx(complexreader) + myi * Dy(complexreader));
168 spinup[3].
scale(0.5);
171 spindown[1] = complexreader;
172 spindown[2] = (-myi) * (Dx(complexreader) - myi * Dy(complexreader));
173 spindown[2].
scale(0.5);
174 spindown[3] = (myi) * Dz(complexreader);
175 spindown[3].
scale(0.5);
197 Fcwf fcwfreader(world);
201 fcwfreader[0] = complexreader;
203 fcwfreader[2] = (-myi) * Dz(complexreader);
204 fcwfreader[2].
scale(0.5);
205 fcwfreader[3] = (-myi) * (Dx(complexreader) + myi * Dy(complexreader));
206 fcwfreader[3].
scale(0.5);
213 unsigned int num_betas=0;
217 input & beta_energies;
222 std::vector<int> dummy4;
226 for(
unsigned int i = 0; i < num_betas; i++){
230 fcwfreader[1] = complexreader;
231 fcwfreader[2] = (-myi) * (Dx(complexreader) - myi * Dy(complexreader));
232 fcwfreader[2].
scale(0.5);
233 fcwfreader[3] = (myi) * Dz(complexreader);
234 fcwfreader[3].
scale(0.5);
244 for(
unsigned int i = 0; i < num_betas; i++){
260 Fcwf fcwfreader(world);
264 if(world.
rank()==0)
print(
"swapping orbitals", i,
" and ", j);
295 if(world.
rank() != 0) {
296 std::ostream dev_null(
nullptr);
297 nwchem.
err = dev_null;
310 for(
unsigned int i=0; i < nwchem.
atoms.size(); i++){
313 x = nwchem.
atoms[i].position[0];
314 y = nwchem.
atoms[i].position[1];
315 z = nwchem.
atoms[i].position[2];
320 unsigned int numalpha(0), numbeta(0);
322 bool have_beta(
false);
362 if(world.
rank()==0)
print(
"num alpha",numalpha);
363 if(world.
rank()==0)
print(
"num beta",numbeta);
369 for(
unsigned int i=0; i < numalpha; i++){
375 for(
unsigned int i=0; i < numalpha; i++){
381 for(
unsigned int i=0; i < numalpha-1; i++){
392 for(
auto basis : slymer::cast_basis<slymer::GaussianFunction>(nwchem.
basis_set)) {
394 std::vector<coord_3d> centers;
396 r[0] = basis.get().center[0]; r[1] = basis.get().center[1]; r[2] = basis.get().center[2];
397 centers.push_back(r);
401 double norm2 = temp1[ii].norm2();
415 Fcwf spindown(world);
419 std::complex<double> myi(0,1);
420 for(
unsigned int i = 0; i < numalpha-1; i++){
422 spinup[0] = complexreader;
424 spinup[2] = (-myi) * Dz(complexreader);
425 spinup[2].
scale(0.5);
426 spinup[3] = (-myi) * (Dx(complexreader) + myi * Dy(complexreader));
427 spinup[3].
scale(0.5);
432 spindown[1] = complexreader;
433 spindown[2] = (-myi) * (Dx(complexreader) - myi * Dy(complexreader));
434 spindown[2].
scale(0.5);
435 spindown[3] = (myi) * Dz(complexreader);
436 spindown[3].
scale(0.5);
442 spinup[0] = complexreader;
444 spinup[2] = (-myi) * Dz(complexreader);
445 spinup[2].
scale(0.5);
446 spinup[3] = (-myi) * (Dx(complexreader) + myi * Dy(complexreader));
447 spinup[3].
scale(0.5);
452 spindown[1] = complexreader;
453 spindown[2] = (-myi) * (Dx(complexreader) - myi * Dy(complexreader));
454 spindown[2].
scale(0.5);
455 spindown[3] = (myi) * Dz(complexreader);
456 spindown[3].
scale(0.5);
double myyfunc(const madness::coord_3d &r)
Definition DF.cc:26
double myxfunc(const madness::coord_3d &r)
Definition DF.cc:21
double q(double t)
Definition DKops.h:18
double myyfunc(const madness::coord_3d &r)
Definition DF.cc:26
double myxfunc(const madness::coord_3d &r)
Definition DF.cc:21
Function< std::complex< double >, 3 > function_real2complex(const Function< double, 3 > &r)
Definition DF.cc:97
void scale(std::complex< double > a)
Definition fcwf.cc:144
void normalize()
Definition fcwf.cc:203
long size() const
Returns the number of elements in the tensor.
Definition basetensor.h:138
Implements derivatives operators with variety of boundary conditions on simulation domain.
Definition derivative.h:266
static void set_k(int value)
Sets the default wavelet order.
Definition funcdefaults.h:273
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:461
FunctionFactory implements the named-parameter idiom for Function.
Definition function_factory.h:86
FunctionFactory & functor(const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > &f)
Definition function_factory.h:141
Abstract base class interface required for functors used as input to Functions.
Definition function_interface.h:68
A multiresolution adaptive numerical function.
Definition mra.h:122
Definition molecule.h:124
void add_atom(double x, double y, double z, double q, int atn)
Definition molecule.cc:346
A tensor is a multidimension array.
Definition tensor.h:317
A parallel world class.
Definition world.h:132
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition world.h:318
const madness::Tensor< double > & MOs
Publically accessible alpha MO expansions coefficients. Column is the MO, row is the basis function.
Definition ESInterface.h:76
const madness::Tensor< double > & beta_occupancies
Publically accessible list of beta MO occupancies (in eV).
Definition ESInterface.h:80
const madness::Tensor< double > & beta_energies
Publically accessible list of beta MO energies (in eV).
Definition ESInterface.h:78
const madness::Tensor< double > & energies
Publically accessible list of alpha MO energies.
Definition ESInterface.h:75
const Atoms & atoms
Publically accessible list of atoms.
Definition ESInterface.h:73
const BasisSet & basis_set
Publicly accessible basis set.
Definition ESInterface.h:72
std::reference_wrapper< std::ostream > err
Output stream for messages.
Definition ESInterface.h:70
const madness::Tensor< double > & occupancies
Publically accessible list of alpha MO occupancies (in eV).
Definition ESInterface.h:77
Definition gaussian.h:376
Class for interfacing with NWChem (tested on version 6.6).
Definition NWChem.h:22
virtual void read(Properties::Properties props) override
Read the specified properties and store them in the member variables.
Definition NWChem.cc:26
#define MADNESS_CHECK(condition)
Check a condition — even in a release build the condition is always evaluated so it can have side eff...
Definition madness_exception.h:182
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
static const char * filename
Definition legendre.cc:96
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > transform(World &world, const std::vector< Function< T, NDIM > > &v, const Tensor< R > &c, bool fence=true)
Transforms a vector of functions according to new[i] = sum[j] old[j]*c[j,i].
Definition vmra.h:689
Function< std::complex< Q >, NDIM > function_real2complex(const Function< Q, NDIM > &r)
Definition complexfun.h:241
double norm2(World &world, const std::vector< Function< T, NDIM > > &v)
Computes the 2-norm of a vector of functions.
Definition vmra.h:851
std::vector< real_function_3d > vector_real_function_3d
Definition functypedefs.h:79
unsigned int symbol_to_atomic_number(const std::string &symbol)
Definition atomutil.cc:173
FunctionFactory< double, 3 > real_factory_3d
Definition functypedefs.h:93
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:225
FunctionFactory< double_complex, 3 > complex_factory_3d
Definition functypedefs.h:100
void normalize(World &world, std::vector< Function< T, NDIM > > &v, bool fence=true)
Normalizes a vector of functions — v[i] = v[i].scale(1.0/v[i].norm2())
Definition vmra.h:1671
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence.
Definition mra.h:2002
constexpr Properties Occupancies
MO occupancies.
Definition ESInterface.h:52
constexpr Properties MOs
The MO vector coefficients.
Definition ESInterface.h:51
constexpr Properties Energies
The MO energies.
Definition ESInterface.h:50
constexpr Properties Basis
The basis set.
Definition ESInterface.h:48
XCfunctional xc
Definition newsolver_lda.cc:53
Definition InitParameters.h:19
double Init_total_energy
Total energy of the nonrelativistic ground state.
Definition InitParameters.h:22
bool closed_shell
Definition InitParameters.h:24
int order
Order of polynomial used in input.
Definition InitParameters.h:29
std::string inFile
Name of input archive to read in.
Definition InitParameters.h:21
Molecule molecule
The molecule used in input calculation.
Definition InitParameters.h:30
unsigned int num_occupied
Number of orbitals.
Definition InitParameters.h:25
double L
Box size of input - Dirac Fock calcluation is in same box.
Definition InitParameters.h:28
void readnw(World &world, const std::string &filename, bool Krestricted)
Definition InitParameters.h:279
Tensor< double > occ
Occupancy of input orbitals.
Definition InitParameters.h:27
void read(World &world, const std::string &filename, bool restart, bool Krestricted)
Definition InitParameters.h:37
Tensor< double > energies
Energies of input orbitals.
Definition InitParameters.h:26
void print_params() const
Definition InitParameters.h:467
std::vector< Fcwf > orbitals
The occupied orbitals.
Definition InitParameters.h:31
InitParameters()
Definition InitParameters.h:34
bool spinrestricted
Indicates if input calc. was spin-restricted.
Definition InitParameters.h:23