MADNESS 0.10.1
Classes | Functions | Variables
test_mul_sparse.cc File Reference
#include <madness/mra/mra.h>
#include <madness/mra/vmra.h>
#include <madness/world/test_utilities.h>
#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
Include dependency graph for test_mul_sparse.cc:

Classes

class  Gauss
 exp(-a |r-R|^2) More...
 
struct  operand_pair
 an operand pair plus the independently projected analytic product More...
 
class  Slater
 c * exp(-a |r|), cusped at the origin: this is what drives the tree deep More...
 

Functions

static std::string fmt_tol (double tol)
 
static long interior_nodes_with_coeffs (World &world, const Function< double, D > &f)
 
int main (int argc, char **argv)
 
static std::vector< operand_pairmake_pairs (World &world)
 
static Function< double, Dproject (World &world, const std::shared_ptr< FunctionFunctorInterface< double, D > > &functor)
 
int test_dot (World &world, std::vector< operand_pair > &pairs)
 T5: dot routes through the screened kernel; check it against the analytic sum.
 
int test_exact (World &world, std::vector< operand_pair > &pairs)
 T1: the exact path reproduces the analytic product.
 
int test_screening_accuracy (World &world, std::vector< operand_pair > &pairs)
 
int test_self_consistency (World &world, std::vector< operand_pair > &pairs)
 
int test_tree_state (World &world, std::vector< operand_pair > &pairs)
 T2: the result is a reconstructed tree, both scalar and vector entry points.
 

Variables

static const double C_MAX = 100.0
 err <= C_MAX*tol; measured max 34
 
static const std::size_t D = 3
 
static const double EXACT_FLOOR = 1.e-7
 
static const double P_MIN = 0.4
 err ~ tol^p; measured p = 0.58 .. 0.75
 
static const double THRESH_REF = 1.e-9
 projection threshold of the reference
 

Function Documentation

◆ fmt_tol()

static std::string fmt_tol ( double  tol)
static

◆ interior_nodes_with_coeffs()

static long interior_nodes_with_coeffs ( World world,
const Function< double, D > &  f 
)
static

number of nodes violating the reconstructed layout: coefficients live on the leaves only

References madness::f, madness::World::gop, madness::nonlinear_vector_solver(), and madness::WorldGopInterface::sum().

Referenced by test_tree_state().

◆ main()

int main ( int  argc,
char **  argv 
)

◆ make_pairs()

static std::vector< operand_pair > make_pairs ( World world)
static

coincident Gaussians, separated Gaussians (where the screening actually fires, as it does for distant localized orbitals), and a Slater cusp

References a, madness::nonlinear_vector_solver(), and madness::project().

Referenced by main().

◆ project()

static Function< double, D > project ( World world,
const std::shared_ptr< FunctionFunctorInterface< double, D > > &  functor 
)
static

◆ test_dot()

int test_dot ( World world,
std::vector< operand_pair > &  pairs 
)

◆ test_exact()

int test_exact ( World world,
std::vector< operand_pair > &  pairs 
)

◆ test_screening_accuracy()

int test_screening_accuracy ( World world,
std::vector< operand_pair > &  pairs 
)

T3: the screening error over a tol ladder, against the analytic product.

The bounds are measured, not derived: err ~ tol^p with p short of 1, and tree quantization (adjacent tol yielding the same tree) leaves err flat and inflates err/tol by up to a decade. Hence a loose C_MAX plus two tighter statements – err falls monotonically with tol, and its decay exponent does not collapse.

References C_MAX, madness::test_output::checkpoint(), madness::test_output::end(), madness::mul_sparse(), madness::nonlinear_vector_solver(), madness::norm2(), p(), P_MIN, q(), madness::World::rank(), and madness::test_output::set_do_print().

Referenced by main().

◆ test_self_consistency()

int test_self_consistency ( World world,
std::vector< operand_pair > &  pairs 
)

◆ test_tree_state()

int test_tree_state ( World world,
std::vector< operand_pair > &  pairs 
)

Variable Documentation

◆ C_MAX

const double C_MAX = 100.0
static

err <= C_MAX*tol; measured max 34

Bounds on the screening error over the tol ladder, all measured, see the header of test_screening_accuracy.

Referenced by test_dot(), test_screening_accuracy(), and test_self_consistency().

◆ D

const std::size_t D = 3
static

Referenced by Gauss::operator()().

◆ EXACT_FLOOR

const double EXACT_FLOOR = 1.e-7
static

Error floor of the exact path (tol=0): the product of two order-k polynomials is not representable at order k, and multiplication does not autorefine. Measured max 2.3e-8 over the pairs below.

Referenced by test_dot(), and test_exact().

◆ P_MIN

const double P_MIN = 0.4
static

err ~ tol^p; measured p = 0.58 .. 0.75

Referenced by test_screening_accuracy().

◆ THRESH_REF

const double THRESH_REF = 1.e-9
static

projection threshold of the reference

Referenced by main().