MADNESS 0.10.1
Classes | Functions | Variables
test_SCFOperators.cc File Reference
#include <madness.h>
#include <madness/chem/SCFOperators.h>
#include <madness/chem/SCF.h>
#include <madness/chem/nemo.h>
#include <madness/chem/correlationfactor.h>
#include <madness/chem/write_test_input.h>
#include <typeinfo>
Include dependency graph for test_SCFOperators.cc:

Classes

class  GaussianGuess< T, NDIM >
 an N-dimensional real-valued Gaussian function More...
 
struct  refpotfunctor
 reference potential for the Poisson solver of a Gaussian More...
 

Functions

bool check_err (double err, double thresh, std::string msg)
 
int dnuclear_anchor_test (World &world)
 
template<typename T >
int exchange_anchor_test (World &world, Exchange< T, 3 > &K, const double thresh)
 anchor test for the exchange operator – partially hardwired
 
int main (int argc, char **argv)
 
int nuclear_anchor_test (World &world)
 
static double_complex p_minus (const coord_3d &xyz)
 complex function p-orbital with m_l=-1
 
static double_complex p_plus (const coord_3d &xyz)
 complex function p-orbital with m_l=1
 
bool similar (double val1, double val2, double thresh=1.e-6)
 
template<typename T , typename opT , std::size_t NDIM>
int test_asymmetric (World &world, const opT &op, double thresh)
 test if the operator return correct matrix elements if bra!=ket
 
template<typename T >
int test_coulomb (World &world)
 
int test_dnuclear (World &world)
 
template<typename T >
int test_exchange (World &world)
 
int test_fock (World &world)
 
template<typename T , typename opT , std::size_t NDIM>
int test_hermiticity (World &world, const opT &op, double thresh)
 test the hermiticity of the operator op and its translational invariance
 
template<typename T , std::size_t NDIM>
int test_kinetic (World &world)
 
int test_nemo (World &world)
 
int test_nuclear (World &world)
 
template<typename T >
int test_XCOperator (World &world)
 
int test_XCOperator_matrix (World &world)
 the xc Fock matrix: weak form vs divergence form, with and without an ncf
 

Variables

bool smalltest = false
 

Function Documentation

◆ check_err()

bool check_err ( double  err,
double  thresh,
std::string  msg 
)

◆ dnuclear_anchor_test()

int dnuclear_anchor_test ( World &  world)

◆ exchange_anchor_test()

template<typename T >
int exchange_anchor_test ( World &  world,
Exchange< T, 3 > &  K,
const double  thresh 
)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ nuclear_anchor_test()

int nuclear_anchor_test ( World &  world)

◆ p_minus()

static double_complex p_minus ( const coord_3d &  xyz)
static

complex function p-orbital with m_l=-1

References madness::Vector< T, N >::normf().

◆ p_plus()

static double_complex p_plus ( const coord_3d &  xyz)
static

complex function p-orbital with m_l=1

References madness::Vector< T, N >::normf().

◆ similar()

bool similar ( double  val1,
double  val2,
double  thresh = 1.e-6 
)

References thresh.

Referenced by test_read_restartaodata(), and test_XCOperator().

◆ test_asymmetric()

template<typename T , typename opT , std::size_t NDIM>
int test_asymmetric ( World &  world,
const opT &  op,
double  thresh 
)

test if the operator return correct matrix elements if bra!=ket

Parameters
[in]worldthe world
[in]opthe operator to be tested, must implement op(vecfuncT,vecfuncT)
[in]threshthe accuracy threshold
Returns
0 if test passes, 1 if test fails

References madness::_(), check_err(), madness::copy(), madness::FunctionFactory< T, NDIM >::functor(), NDIM, madness::Tensor< T >::normf(), op(), madness::print(), madness::BaseTensor::size(), thresh, and madness::FunctionFactory< T, NDIM >::truncate_on_project().

◆ test_coulomb()

template<typename T >
int test_coulomb ( World &  world)

◆ test_dnuclear()

int test_dnuclear ( World &  world)

◆ test_exchange()

template<typename T >
int test_exchange ( World &  world)

◆ test_fock()

int test_fock ( World &  world)

◆ test_hermiticity()

template<typename T , typename opT , std::size_t NDIM>
int test_hermiticity ( World &  world,
const opT &  op,
double  thresh 
)

test the hermiticity of the operator op and its translational invariance

Parameters
[in]worldthe world
[in]opthe operator to be tested, must implement op(vecfuncT,vecfuncT)
[in]threshthe accuracy threshold
Returns
0 if test passes, 1 if test fails

References madness::abs(), check_err(), madness::conj_transpose(), madness::copy(), madness::FunctionFactory< T, NDIM >::functor(), madness::Tensor< T >::normf(), op(), madness::print(), madness::BaseTensor::size(), thresh, and madness::FunctionFactory< T, NDIM >::truncate_on_project().

◆ test_kinetic()

template<typename T , std::size_t NDIM>
int test_kinetic ( World &  world)

◆ test_nemo()

int test_nemo ( World &  world)

◆ test_nuclear()

int test_nuclear ( World &  world)

◆ test_XCOperator()

template<typename T >
int test_XCOperator ( World &  world)

◆ test_XCOperator_matrix()

int test_XCOperator_matrix ( World &  world)

the xc Fock matrix: weak form vs divergence form, with and without an ncf

All four assemblies compute the same physical object, $ F_{ij} = \langle\psi_i|\hat v_{xc}|\psi_j\rangle $, so they must agree. That is a stronger statement than a hardwired reference number, which only pins the code to itself: here two structurally independent algorithms have to meet – the divergence form, whose multiplicative potential contains $ -\nabla\cdot\mathbf X $, and the weak form, which never forms that divergence at all – each evaluated on a different representation of the same orbitals, $\psi$ and the regularized $ F=\psi/R $.

The model is defined through $ F $ rather than $\psi$: smooth sums of Gaussians, from which $ \psi = RF $ inherits exactly the Kato cusp of the correlation factor at every nucleus. That is the paper's model density read backwards, and it lets the test avoid any division and never repeat the ncf's own formula.

References madness::XCOperator< T, NDIM >::allow_weak_form(), check_err(), madness::create_nuclear_correlation_factor(), write_test_input::filename(), g0(), g1(), madness::Molecule::get_atom(), madness::Atom::get_coords(), madness::FunctionDefaults< NDIM >::get_thresh(), madness::XCOperator< T, NDIM >::is_weak_form(), MADNESS_CHECK, madness::SCF::make_nuclear_potential(), madness::SCF::molecule, madness::mul(), madness::name(), madness::Molecule::natom(), madness::Tensor< T >::normf(), op(), param, madness::SCF::potentialmanager, madness::print(), psi(), R, R2, madness::World::rank(), madness::scale(), madness::FunctionDefaults< NDIM >::set_cubic_cell(), madness::FunctionDefaults< NDIM >::set_k(), madness::commandlineparser::set_keyval(), madness::FunctionDefaults< NDIM >::set_thresh(), madness::XCOperator< T, NDIM >::set_weak_gga(), thresh, madness::transpose(), madness::Function< T, NDIM >::truncate(), and madness::truncate().

Referenced by main().

Variable Documentation

◆ smalltest

bool smalltest = false