37 #ifndef MADNESS_CHEM_SCFOPERATORS_H_
38 #define MADNESS_CHEM_SCFOPERATORS_H_
50 class NuclearCorrelationFactor;
55 typedef std::vector<real_function_3d>
vecfuncT;
57 template<
typename T, std::
size_t NDIM>
70 std::shared_ptr<MacroTaskQ>
taskq=0;
73 virtual std::string
info()
const = 0;
103 template<
typename T, std::
size_t NDIM>
108 using implT = std::shared_ptr<ExchangeImpl>;
133 std::string
info()
const {
return "K";}
168 return inner(bra, this->
operator()(ket));
178 World& world=vket[0].world();
187 template<
typename T, std::
size_t NDIM>
199 std::string
info()
const {
return "T";}
224 tensorT kinetic(vbra.size(),vket.size());
231 std::vector< std::shared_ptr<Derivative<T,NDIM> > >
gradop;
240 template<
typename T, std::
size_t NDIM>
252 std::string
info()
const {
return "D";}
272 const auto bra_equiv_ket = &vbra == &vket;
293 template<
typename T, std::
size_t NDIM>
305 std::string
info()
const {
return "D^2";}
322 return -2.0*t(vbra,vket);
327 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
gradop;
333 template<
typename T, std::
size_t NDIM>
340 typedef std::tuple<const Function<double,NDIM>&,
const std::vector<Function<T,NDIM>> &>
argtupleT;
342 using resultT = std::vector<Function<T,NDIM>>;
347 const std::string
policy)
const override {
360 std::size_t n = std::get<1>(argtuple).size();
361 resultT result = zero_functions_compressed<T,NDIM>(
world, n);
384 std::string
info()
const {
return "J";}
394 std::vector<Function<T,NDIM> > vket(1,ket);
412 const auto bra_equiv_ket = &vbra == &vket;
413 std::vector<Function<T,NDIM> > vJket;
414 for (std::size_t i=0; i<vket.size(); ++i) {
415 vJket.push_back(this->
operator()(vket[i]));
454 template<
typename T, std::
size_t NDIM>
468 std::string
info()
const {
return "Vnuc";}
471 std::vector<Function<T,NDIM> > vket(1,ket);
478 return inner(bra,this->
operator()(ket));
483 const auto bra_equiv_ket = &vbra == &vket;
484 std::vector<Function<T,NDIM> > vVket=this->
operator()(vket);
490 std::shared_ptr<NuclearCorrelationFactor>
ncf;
498 template<
typename T, std::
size_t NDIM>
508 std::string
info()
const {
return "Lz";}
512 std::vector<Function<T,NDIM> > vket(1,ket);
521 if (vket.size()==0)
return std::vector<complex_function_3d>(0);
534 std::vector<Function<T,NDIM> > delx=
apply(
world,Dx,vket,
false);
535 std::vector<Function<T,NDIM> > dely=
apply(
world,Dy,vket,
true);
537 std::vector<Function<T,NDIM> > result1=x*dely - y*delx;
538 std::vector<complex_function_3d> cresult1=convert<T,double_complex,NDIM>(
world,result1);
539 std::vector<complex_function_3d> result=
double_complex(0.0,-1.0)*cresult1;
544 return inner(bra,this->
operator()(ket));
549 const auto bra_equiv_ket = &vbra == &vket;
550 std::vector<complex_function_3d> vVket=this->
operator()(vket);
559 template<
typename T, std::
size_t NDIM>
571 std::string
info()
const {
return "DVnuc";}
574 std::vector<Function<T,NDIM>> vket(1,ket);
581 return inner(bra,this->
operator()(ket));
585 const auto bra_equiv_ket = &vbra == &vket;
586 std::vector<Function<T,NDIM>> vVket=this->
operator()(vket);
592 std::shared_ptr<NuclearCorrelationFactor>
ncf;
598 template<
typename T, std::
size_t NDIM>
629 const auto bra_equiv_ket = &vbra == &vket;
640 template<
typename T, std::
size_t NDIM>
651 std::string deriv=
"abgv");
667 std::string
info()
const {
return "Vxc";}
684 std::vector<Function<T,3> > vket(1,ket);
685 std::vector<Function<T,3> > vKket=this->
operator()(vket);
721 std::shared_ptr<XCfunctional>
xc;
739 std::shared_ptr<NuclearCorrelationFactor>
ncf;
781 template <
typename Archive>
797 template <
typename Archive>
804 template<
typename T, std::
size_t NDIM>
817 double number=std::get<0>(
op.second);
820 }
else if (number!=1.0) {
821 std::stringstream snumber;
822 snumber << std::fixed << std::setw(2) << number;
823 s+=
" "+snumber.str()+
" ";
857 std::vector<Function<T,NDIM>> result = zero_functions_compressed<T, NDIM>(
world, vket.
size());
859 result+=std::get<0>(
op.second) * (*std::get<1>(
op.second))(vket);
865 std::vector<Function<T,NDIM>> vbra(1,bra), vket(1,ket);
866 return (*
this)(vbra,vket)(0,0);
876 const bool symmetric)
const {
879 Tensor<T> tmp=std::get<0>(
op.second) * (*std::get<1>(
op.second))(vbra,vket);
893 typedef std::tuple<double,std::shared_ptr<SCFOperatorBase<T,NDIM> > >
valueT;
std::complex< double > double_complex
Definition: cfft.h:14
Definition: SCFOperators.h:344
partitionT do_partitioning(const std::size_t &vsize1, const std::size_t &vsize2, const std::string policy) const override
override this if you want your own partitioning
Definition: SCFOperators.h:346
Definition: SCFOperators.h:337
std::vector< Function< T, NDIM > > resultT
Definition: SCFOperators.h:342
MacroTaskCoulomb()
Definition: SCFOperators.h:353
resultT operator()(const Function< double, NDIM > &vcoul, const std::vector< Function< T, NDIM >> &arg) const
Definition: SCFOperators.h:365
resultT allocator(World &world, const argtupleT &argtuple) const
Definition: SCFOperators.h:359
std::tuple< const Function< double, NDIM > &, const std::vector< Function< T, NDIM > > & > argtupleT
Definition: SCFOperators.h:340
Definition: SCFOperators.h:334
Coulomb & set_taskq(std::shared_ptr< MacroTaskQ > taskq1)
Definition: SCFOperators.h:386
real_function_3d compute_density(const SCF *calc) const
Definition: SCFOperators.cc:204
Function< T, NDIM > compute_potential(const Function< T, NDIM > &density) const
given a density compute the Coulomb potential
Definition: SCFOperators.h:432
real_function_3d & potential()
setter for the Coulomb potential
Definition: SCFOperators.h:424
const real_function_3d & potential() const
getter for the Coulomb potential
Definition: SCFOperators.h:421
World & world
Definition: SCFOperators.h:447
Tensor< T > operator()(const std::vector< Function< T, NDIM > > &vbra, const std::vector< Function< T, NDIM > > &vket) const
Definition: SCFOperators.h:410
Coulomb(World &world)
default empty ctor
Definition: SCFOperators.h:371
Coulomb(World &world, const double lo, const double thresh=FunctionDefaults< 3 >::get_thresh())
default empty ctor
Definition: SCFOperators.h:374
std::string info() const
print some information about this operator
Definition: SCFOperators.h:384
std::vector< Function< T, NDIM > > operator()(const std::vector< Function< T, NDIM > > &vket) const
Definition: SCFOperators.h:398
Function< T, NDIM > operator()(const Function< T, NDIM > &ket) const
Definition: SCFOperators.h:393
std::shared_ptr< real_convolution_3d > poisson
Definition: SCFOperators.h:448
real_function_3d vcoul
the coulomb potential
Definition: SCFOperators.h:450
double lo
Definition: SCFOperators.h:449
void reset_poisson_operator_ptr(const double lo, const double econv)
Definition: SCFOperators.cc:199
T operator()(const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:406
derivative of the (regularized) nuclear potential wrt nuclear displacements
Definition: SCFOperators.h:560
World & world
Definition: SCFOperators.h:591
std::string info() const
print some information about this operator
Definition: SCFOperators.h:571
DNuclear(World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, const int iatom, const int iaxis)
Definition: SCFOperators.h:567
Function< T, NDIM > operator()(const Function< T, NDIM > &ket) const
Definition: SCFOperators.h:573
Tensor< T > operator()(const std::vector< Function< T, NDIM >> &vbra, const std::vector< Function< T, NDIM >> &vket) const
Definition: SCFOperators.h:584
DNuclear(World &world, const SCF *calc, const int iatom, const int iaxis)
Definition: SCFOperators.cc:292
T operator()(const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:580
std::shared_ptr< NuclearCorrelationFactor > ncf
Definition: SCFOperators.h:592
int iatom
index of the atom which is displaced
Definition: SCFOperators.h:593
int iaxis
x,y,z component of the atom
Definition: SCFOperators.h:594
Definition: SCFOperators.h:241
tensorT operator()(const vecfuncT &vbra, const vecfuncT &vket) const
compute the matrix <vbra | op | vket>
Definition: SCFOperators.h:271
functionT operator()(const functionT &ket) const
Definition: SCFOperators.h:254
int axis
Definition: SCFOperators.h:279
DerivativeOperator(World &world, const int axis1)
Definition: SCFOperators.h:248
T operator()(const functionT &bra, const functionT &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:265
std::string info() const
print some information about this operator
Definition: SCFOperators.h:252
Derivative< T, NDIM > gradop
Definition: SCFOperators.h:280
Tensor< T > tensorT
Definition: SCFOperators.h:244
Function< T, NDIM > functionT
Definition: SCFOperators.h:242
vecfuncT operator()(const vecfuncT &vket) const
apply this operator on the argument vector of functions
Definition: SCFOperators.h:259
World & world
Definition: SCFOperators.h:278
std::vector< functionT > vecfuncT
Definition: SCFOperators.h:243
Implements derivatives operators with variety of boundary conditions on simulation domain.
Definition: derivative.h:266
void set_bspline1()
Definition: derivative.h:612
Manages data associated with a row/column/block distributed array.
Definition: distributed_matrix.h:388
void copy_to_replicated(Tensor< T > &s) const
Copy from the distributed (m,n) matrix into the replicated matrix (collective call)
Definition: distributed_matrix.h:528
Definition: exchangeoperator.h:17
Definition: SCFOperators.h:104
Function< T, NDIM > functionT
Definition: SCFOperators.h:109
Exchange & set_printlevel(const long &level)
Definition: SCFOperators.cc:727
Exchange(World &world, const double lo, const double thresh=FunctionDefaults< NDIM >::get_thresh())
default ctor
Definition: SCFOperators.cc:676
Function< T, NDIM > operator()(const Function< T, NDIM > &ket) const
Definition: SCFOperators.h:150
T operator()(const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
compute the matrix element <bra | K | ket>
Definition: SCFOperators.h:167
Algorithm
Definition: SCFOperators.h:116
@ multiworld_efficient
Definition: SCFOperators.h:117
@ small_memory
Definition: SCFOperators.h:117
@ large_memory
Definition: SCFOperators.h:117
Tensor< T > tensorT
Definition: SCFOperators.h:111
bool is_symmetric() const
Definition: SCFOperators.cc:710
Exchange & set_symmetric(const bool flag)
Definition: SCFOperators.cc:715
implT impl
Definition: SCFOperators.h:113
std::shared_ptr< ExchangeImpl > implT
Definition: SCFOperators.h:108
Exchange & set_algorithm(const Algorithm &alg)
Definition: SCFOperators.cc:721
Exchange & set_bra_and_ket(const vecfuncT &bra, const vecfuncT &ket)
Definition: SCFOperators.cc:699
std::vector< functionT > vecfuncT
Definition: SCFOperators.h:110
vecfuncT operator()(const vecfuncT &vket) const
apply the exchange operator on a vector of functions
Tensor< T > operator()(const vecfuncT &vbra, const vecfuncT &vket) const
compute the matrix < vbra | K | vket >
Definition: SCFOperators.h:176
std::string info() const
print some information about this operator
Definition: SCFOperators.h:133
Exchange & set_taskq(std::shared_ptr< MacroTaskQ > taskq1)
Definition: SCFOperators.h:143
Computes matrix representation of the Fock operator.
Definition: SCFOperators.h:805
Function< T, NDIM > operator()(const Function< T, NDIM > &ket) const
Definition: SCFOperators.h:848
int remove_operator(std::string name)
remove operator, returns 0 if no operator was found
Definition: SCFOperators.h:844
Fock(World &world)
Definition: SCFOperators.h:807
World & world
the world
Definition: SCFOperators.h:890
void add_operator(std::string name, std::shared_ptr< SCFOperatorBase< T, NDIM >> new_op)
add an operator with default prefactor 1.0
Definition: SCFOperators.h:834
Fock(World &world, const OEP *nemo)
Fock(World &world, const NemoBase *nemo)
void add_operator(std::string name, std::tuple< double, std::shared_ptr< SCFOperatorBase< T, NDIM >>> new_op)
add an operator with custom prefactor (e.g. -1.0 for the exchange, supposedly)
Definition: SCFOperators.h:839
Tensor< T > operator()(const std::vector< Function< T, NDIM >> &vbra, const std::vector< Function< T, NDIM >> &vket) const
compute the Fock matrix by summing up all contributions
Definition: SCFOperators.h:870
std::vector< Function< T, NDIM > > operator()(const std::vector< Function< T, NDIM >> &vket) const
Definition: SCFOperators.h:854
Fock(World &world, const Nemo *nemo)
std::map< std::string, valueT > operators
all the Fock operator contribution
Definition: SCFOperators.h:896
T operator()(const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:864
std::tuple< double, std::shared_ptr< SCFOperatorBase< T, NDIM > > > valueT
type defining Fock operator contribution including prefactor
Definition: SCFOperators.h:893
Tensor< T > operator()(const std::vector< Function< T, NDIM >> &vbra, const std::vector< Function< T, NDIM >> &vket, const bool symmetric) const
compute the Fock matrix by summing up all contributions
Definition: SCFOperators.h:875
std::string info() const
pretty print what this is actually computing
Definition: SCFOperators.h:814
FunctionDefaults holds default paramaters as static class members.
Definition: funcdefaults.h:204
A multiresolution adaptive numerical function.
Definition: mra.h:122
Key is the index for a node of the 2^NDIM-tree.
Definition: key.h:66
Definition: SCFOperators.h:188
Tensor< T > tensorT
Definition: SCFOperators.h:192
std::vector< std::shared_ptr< Derivative< T, NDIM > > > gradop
Definition: SCFOperators.h:231
tensorT operator()(const vecfuncT &vbra, const vecfuncT &vket) const
compute the matrix <vbra | op | vket>
Definition: SCFOperators.h:217
World & world
Definition: SCFOperators.h:230
Kinetic(World &world)
Definition: SCFOperators.h:195
std::vector< functionT > vecfuncT
Definition: SCFOperators.h:191
Function< T, NDIM > functionT
Definition: SCFOperators.h:190
std::string info() const
print some information about this operator
Definition: SCFOperators.h:199
distmatT kinetic_energy_matrix(World &world, const vecfuncT &v) const
Definition: SCFOperators.cc:51
DistributedMatrix< T > distmatT
Definition: SCFOperators.h:189
vecfuncT operator()(const vecfuncT &vket) const
apply this operator on the argument vector of functions
Definition: SCFOperators.h:206
T operator()(const functionT &bra, const functionT &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:211
functionT operator()(const functionT &ket) const
Definition: SCFOperators.h:201
the Laplacian operator: \sum_i \nabla^2_i
Definition: SCFOperators.h:294
T operator()(const functionT &bra, const functionT &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:314
double eps
Definition: SCFOperators.h:328
Tensor< T > tensorT
Definition: SCFOperators.h:297
functionT operator()(const functionT &ket) const
Definition: SCFOperators.h:307
Function< T, NDIM > functionT
Definition: SCFOperators.h:295
std::string info() const
print some information about this operator
Definition: SCFOperators.h:305
tensorT operator()(const vecfuncT &vbra, const vecfuncT &vket) const
compute the matrix <vbra | op | vket>
Definition: SCFOperators.h:320
std::vector< functionT > vecfuncT
Definition: SCFOperators.h:296
vecfuncT operator()(const vecfuncT &vket) const
apply this operator on the argument vector of functions
Laplacian(World &world, const double e=0.0)
Definition: SCFOperators.h:301
std::vector< std::shared_ptr< Derivative< T, NDIM > > > gradop
Definition: SCFOperators.h:327
World & world
Definition: SCFOperators.h:326
Definition: SCFOperators.h:599
std::string info() const
print some information about this operator
Definition: SCFOperators.h:605
Function< T, NDIM > operator()(const Function< T, NDIM > &ket) const
Definition: SCFOperators.h:615
T operator()(const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:623
void set_info(const std::string new_info)
Definition: SCFOperators.h:607
std::vector< Function< T, NDIM > > operator()(const std::vector< Function< T, NDIM > > &vket) const
Definition: SCFOperators.h:619
Function< T, NDIM > potential
Definition: SCFOperators.h:636
LocalPotentialOperator(World &world)
Definition: SCFOperators.h:601
World & world
Definition: SCFOperators.h:634
std::string info_str
Definition: SCFOperators.h:635
Tensor< T > operator()(const std::vector< Function< T, NDIM > > &vbra, const std::vector< Function< T, NDIM > > &vket) const
Definition: SCFOperators.h:627
LocalPotentialOperator(World &world, const std::string info, const Function< T, NDIM > potential)
Definition: SCFOperators.h:602
void set_potential(const Function< T, NDIM > &new_potential)
Definition: SCFOperators.h:611
the z component of the angular momentum
Definition: SCFOperators.h:499
T operator()(const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:543
Lz(World &world, bool use_bspline_derivative=true)
Definition: SCFOperators.h:506
World & world
Definition: SCFOperators.h:501
std::string info() const
print some information about this operator
Definition: SCFOperators.h:508
Tensor< T > operator()(const std::vector< Function< T, NDIM > > &vbra, const std::vector< Function< T, NDIM > > &vket) const
Definition: SCFOperators.h:547
Function< T, NDIM > operator()(const Function< T, NDIM > &ket) const
Definition: SCFOperators.h:511
std::vector< Function< T, NDIM > > operator()(const std::vector< Function< T, NDIM > > &vket) const
Definition: SCFOperators.h:516
bool use_bsplines
Definition: SCFOperators.h:504
Definition: macrotaskq.h:716
std::shared_ptr< MacroTaskPartitioner > partitioner
Definition: macrotaskq.h:720
partition one (two) vectors into 1D (2D) batches.
Definition: macrotaskpartitioner.h:190
std::string policy
how to partition the batches
Definition: macrotaskpartitioner.h:198
std::list< std::pair< Batch, double > > partitionT
Definition: macrotaskpartitioner.h:194
friend class Batch
Definition: macrotaskpartitioner.h:191
Definition: macrotaskq.h:463
Definition: molecule.h:124
The Nemo class.
Definition: nemo.h:326
Definition: SCFOperators.h:455
T operator()(const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:477
Tensor< T > operator()(const std::vector< Function< T, NDIM > > &vbra, const std::vector< Function< T, NDIM > > &vket) const
Definition: SCFOperators.h:481
std::string info() const
print some information about this operator
Definition: SCFOperators.h:468
Nuclear(World &world, const SCF *calc)
Definition: SCFOperators.cc:243
Function< T, NDIM > operator()(const Function< T, NDIM > &ket) const
Definition: SCFOperators.h:470
World & world
Definition: SCFOperators.h:489
Nuclear(World &world, std::shared_ptr< NuclearCorrelationFactor > ncf)
Definition: SCFOperators.h:465
std::shared_ptr< NuclearCorrelationFactor > ncf
Definition: SCFOperators.h:490
Definition: SCFOperators.h:58
std::vector< functionT > vecfuncT
Definition: SCFOperators.h:62
Tensor< T > tensorT
Definition: SCFOperators.h:63
virtual std::string info() const =0
print some information about this operator
std::shared_ptr< MacroTaskQ > taskq
Definition: SCFOperators.h:70
Function< T, NDIM > functionT
Definition: SCFOperators.h:61
SCFOperatorBase(std::shared_ptr< MacroTaskQ > taskq)
Definition: SCFOperators.h:66
virtual ~SCFOperatorBase()
Definition: SCFOperators.h:68
virtual tensorT operator()(const vecfuncT &vbra, const vecfuncT &vket) const =0
compute the matrix <vbra | op | vket>
SCFOperatorBase()=default
virtual vecfuncT operator()(const vecfuncT &vket) const =0
apply this operator on the argument vector of functions
virtual functionT operator()(const functionT &ket) const =0
virtual T operator()(const functionT &bra, const functionT &ket) const =0
compute the matrix element <bra | op | ket>
A tensor is a multidimension array.
Definition: tensor.h:317
Tensor< T > & unaryop(opT &op)
Inplace apply a unary function to each element of the tensor.
Definition: tensor.h:1792
void fence(bool debug=false)
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition: worldgop.cc:161
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
ProcessID size() const
Returns the number of processes in this World (same as MPI_Comm_size()).
Definition: world.h:328
WorldGopInterface & gop
Global operations.
Definition: world.h:205
operator class for the handling of DFT exchange-correlation functionals
Definition: SCFOperators.h:641
XCOperator(World &world)
default ctor without information about the XC functional
Definition: SCFOperators.h:645
vecfuncT xc_args
functions that are need for the computation of the XC operator
Definition: SCFOperators.h:747
bool is_initialized() const
check if the intermediates are initialized
Definition: SCFOperators.h:765
double compute_xc_energy() const
compute the xc energy using the precomputed intermediates vf and delrho
Definition: SCFOperators.cc:445
std::string info() const
print some information about this operator
Definition: SCFOperators.h:667
real_function_3d make_xc_potential() const
return the local xc potential
Definition: SCFOperators.cc:461
void prep_xc_args_response(const real_function_3d &dens_pt, vecfuncT &xc_args, vecfuncT &ddens_pt) const
compute the intermediates for the XC functionals
Definition: SCFOperators.cc:625
T operator()(const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
compute the matrix element <bra | op | ket>
Definition: SCFOperators.h:689
std::vector< Function< T, NDIM > > operator()(const std::vector< Function< T, NDIM > > &vket) const
apply the xc potential on a set of orbitals
Definition: SCFOperators.cc:438
XCOperator & set_extra_truncation(const double &fac)
Definition: SCFOperators.h:669
std::string dft_deriv
which derivative operator to use
Definition: SCFOperators.h:717
std::shared_ptr< NuclearCorrelationFactor > ncf
the nuclear correlation factor, if it exists, for computing derivatives for GGA
Definition: SCFOperators.h:739
Function< T, NDIM > operator()(const Function< T, NDIM > &ket) const
apply the xc potential on an orbitals
Definition: SCFOperators.h:683
void set_ispin(const int i) const
set the spin state this operator is acting on
Definition: SCFOperators.h:677
double extra_truncation
additional truncation for the densities in the XC kernel
Definition: SCFOperators.h:736
Tensor< T > operator()(const std::vector< Function< T, NDIM >> &vbra, const std::vector< Function< T, NDIM >> &vket) const
Definition: SCFOperators.h:693
std::shared_ptr< XCfunctional > xc
interface to the actual XC functionals
Definition: SCFOperators.h:721
vecfuncT prep_xc_args(const real_function_3d &arho, const real_function_3d &brho) const
compute the intermediates for the XC functionals
Definition: SCFOperators.cc:575
World & world
the world
Definition: SCFOperators.h:714
real_function_3d apply_xc_kernel(const real_function_3d &density, const vecfuncT grad_dens_pt=vecfuncT()) const
construct the xc kernel and apply it directly on the (response) density
Definition: SCFOperators.cc:536
int ispin
the XC functionals depend on the spin of the orbitals they act on
Definition: SCFOperators.h:728
int nbeta
number of beta orbitals
Definition: SCFOperators.h:725
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition: derivatives.cc:72
static double lo
Definition: dirac-hatom.cc:23
auto T(World &world, response_space &f) -> response_space
Definition: global_functions.cc:34
Tensor< typename Tensor< T >::scalar_type > arg(const Tensor< T > &t)
Return a new tensor holding the argument of each element of t (complex types only)
Definition: tensor.h:2502
static const double v
Definition: hatom_sf_dirac.cc:20
Tensor< double > op(const Tensor< double > &x)
Definition: kain.cc:508
#define max(a, b)
Definition: lda.h:51
Declares the macrotaskq and MacroTaskBase classes.
General header file for using MADNESS.
#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:190
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition: madness_exception.h:119
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
response_space apply(World &world, std::vector< std::vector< std::shared_ptr< real_convolution_3d >>> &op, response_space &f)
Definition: basic_operators.cc:39
void truncate(World &world, response_space &v, double tol, bool fence)
Definition: basic_operators.cc:30
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
static const Slice _(0,-1, 1)
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
double inner(response_space &a, response_space &b)
Definition: response_functions.h:442
vector< functionT > vecfuncT
Definition: corepotential.cc:58
std::string name(const FuncType &type, const int ex=-1)
Definition: ccpairfunction.h:28
void matrix_inner(DistributedMatrix< T > &A, const std::vector< Function< T, NDIM > > &f, const std::vector< Function< T, NDIM > > &g, bool sym=false)
Definition: distpm.cc:46
const std::vector< Function< T, NDIM > > & reconstruct(const std::vector< Function< T, NDIM > > &v)
reconstruct a vector of functions
Definition: vmra.h:156
static const double thresh
Definition: rk.cc:45
Definition: SCFOperators.h:788
double operator()(const double &val)
Definition: SCFOperators.h:789
simple structure to take the pointwise exponential of a function, shifted by +14
Definition: SCFOperators.h:786
void serialize(Archive &ar)
Definition: SCFOperators.h:798
double resultT
Definition: SCFOperators.h:787
Tensor< double > operator()(const Key< 3 > &key, const Tensor< double > &val) const
Definition: SCFOperators.h:791
Definition: SCFOperators.h:772
double operator()(const double &val)
Definition: SCFOperators.h:773
simple structure to take the pointwise logarithm of a function, shifted by +14
Definition: SCFOperators.h:770
void serialize(Archive &ar)
Definition: SCFOperators.h:782
Tensor< double > operator()(const Key< 3 > &key, const Tensor< double > &val) const
Definition: SCFOperators.h:775
double resultT
Definition: SCFOperators.h:771
Definition: dirac-hatom.cc:108
int task(int i)
Definition: test_runtime.cpp:4
void e()
Definition: test_sig.cc:75
static Molecule molecule
Definition: testperiodicdft.cc:38