|
MADNESS 0.10.1
|
#include <madness/mra/mra.h>#include <madness/chem/ccpairfunction.h>#include <madness/chem/correlationfactor.h>#include <madness/chem/electronic_correlation_factor.h>#include <madness/chem/CCStructures.h>#include <madness/chem/CCPotentials.h>#include <madness/chem/projector.h>#include <madness/world/test_utilities.h>#include <random>
Classes | |
| struct | data< T, NDIM > |
Functions | |
| int | main (int argc, char **argv) |
| template<typename T , std::size_t NDIM> | |
| int | test_apply (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_consolidate (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_consolidate_vs_direct (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| detect that consolidate() is not equivalent to direct addition (operator+) | |
| template<typename T , std::size_t NDIM> | |
| int | test_constructor (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_inner (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meters) |
| template<typename T , std::size_t NDIM> | |
| int | test_load_store (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_multiply (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meters) |
| template<typename T , std::size_t NDIM> | |
| int | test_multiply_with_f12 (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meters) |
| template<typename T , std::size_t NDIM> | |
| int | test_norm (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_operator_apply (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_partial_inner_3d (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_partial_inner_6d (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_projector (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_scalar_multiplication (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_swap_particles (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meters) |
| template<typename T , std::size_t NDIM> | |
| int | test_transformations (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| template<typename T , std::size_t NDIM> | |
| int | test_tt2d_summation (World &world, std::shared_ptr< NuclearCorrelationFactor > ncf, data< T, NDIM > &data, const CCParameters ¶meter) |
| minimal detector for the loss of precision of low-rank (TT_2D) summation | |
Variables | |
| bool | longtest =false |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
functionality
References madness::create_nuclear_correlation_factor(), e(), madness::WorldGopInterface::fence(), madness::finalize(), madness::World::gop, madness::initialize(), k, madness::commandlineparser::key_exists(), madness::nonlinear_vector_solver(), madness::print(), madness::Molecule::print(), madness::commandlineparser::print_map(), madness::FunctionDefaults< NDIM >::set_cubic_cell(), madness::FunctionDefaults< NDIM >::set_k(), madness::commandlineparser::set_keyval(), madness::FunctionDefaults< NDIM >::set_tensor_type(), madness::FunctionDefaults< NDIM >::set_thresh(), madness::startup(), thresh, madness::TT_2D, and madness::commandlineparser::value().
| int test_apply | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
f12: exp(-r_1^2 - 2 r_2^2) f23: exp(-r_1^2 - 2 r_2^2) + exp(-2 r_1^2 - 3 r_2^2) p1: pure, corresponds to f12 p2: dec, corresponds to f23 p3: op_dec, corresponds to f23 p4: pure, corresponds to f23 p5: op_pure, corresponds to f23
References madness::test_output::end(), madness::f, f1, f2, f3, data< T, NDIM >::get_ccpairfunctions(), data< T, NDIM >::get_functions(), madness::inner(), NDIM, madness::nonlinear_vector_solver(), op(), madness::OT_F12, p(), madness::print(), and madness::r2().
| int test_consolidate | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
f12: exp(-r_1^2 - 2 r_2^2) f23: exp(-r_1^2 - 2 r_2^2) + exp(-2 r_1^2 - 3 r_2^2) p1: pure, corresponds to f12 p2: dec, corresponds to f23 p3: op_dec, corresponds to f23 p4: pure, corresponds to f23 p5: op_pure, corresponds to f23
References c, madness::test_output::checkpoint(), madness::test_output::end(), data< T, NDIM >::get_ccpairfunctions(), madness::inner(), madness::is_collected(), m, NDIM, madness::nonlinear_vector_solver(), p(), madness::print(), and madness::r2().
| int test_consolidate_vs_direct | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
detect that consolidate() is not equivalent to direct addition (operator+)
consolidate() merges same-type pure terms with transform_reconstructed (see collect_same_types), whereas direct addition uses operator+ (gaxpy_oop_reconstructed). For TT_2D these are different reconstructed-summation algorithms and diverge above threshold. The existing test_consolidate only compares via inner(.,{p1}), which projects onto p1 and hides the error; here we compare in FULL function space.
References madness::test_output::checkpoint(), compare(), madness::copy(), madness::test_output::end(), madness::f, madness::FunctionDefaults< NDIM >::get_k(), madness::FunctionDefaults< NDIM >::get_tensor_type(), madness::FunctionDefaults< NDIM >::get_thresh(), k, k0, NDIM, madness::nonlinear_vector_solver(), madness::norm2(), madness::print(), madness::r2(), madness::World::rank(), madness::FunctionDefaults< NDIM >::set_k(), madness::FunctionDefaults< NDIM >::set_tensor_type(), madness::FunctionDefaults< NDIM >::set_thresh(), thresh, madness::TT_2D, madness::TT_FULL, and madness::vec().
| int test_constructor | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
References a, a1, b, madness::test_output::checkpoint(), madness::CCPairFunction< T, NDIM >::component, madness::copy(), madness::test_output::end(), madness::f, f1, f2, f3, data< T, NDIM >::get_functions(), madness::CCPairFunction< T, NDIM >::is_decomposed(), madness::CCPairFunction< T, NDIM >::is_op_decomposed(), madness::CCPairFunction< T, NDIM >::is_pure(), MADNESS_CHECK, NDIM, madness::nonlinear_vector_solver(), op(), madness::OT_F12, p(), and madness::CCPairFunction< T, NDIM >::pure().
| int test_inner | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameters | ||
| ) |
f1: exp(-1.0 r^2) f2: exp(-2.0 r^2) f3: exp(-3.0 r^2) f4: exp(-4.0 r^2) f5: exp(-5.0 r^2) f: exp(-r_1^2 - 2 r_2^2) f23: exp(-r_1^2 - 2 r_2^2) + exp(-2 r_1^2 - 3 r_2^2)
p1: pure, corresponds to f12 p2: dec, corresponds to f23 p3: op_dec, corresponds to f23 p4: pure, corresponds to f23 p5: op_pure, corresponds to f23
results
References a, madness::apply(), b, madness::test_output::checkpoint(), madness::dot(), madness::test_output::end(), madness::f, f1, data< T, NDIM >::f12_op, f2, f3, madness::CCParameters::gamma(), data< T, NDIM >::get_ccpairfunctions(), data< T, NDIM >::get_functions(), madness::FunctionDefaults< NDIM >::get_thresh(), madness::inner(), madness::CCParameters::lo(), madness::matrix_inner(), NDIM, madness::nonlinear_vector_solver(), madness::print(), thresh, and madness::CCParameters::thresh_bsh_3D().
| int test_load_store | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
| int test_multiply | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameters | ||
| ) |
References madness::test_output::checkpoint(), madness::test_output::end(), madness::f, f1, f2, f3, data< T, NDIM >::get_ccpairfunctions(), data< T, NDIM >::get_functions(), madness::FunctionDefaults< NDIM >::get_thresh(), madness::inner(), madness::multiply(), NDIM, madness::nonlinear_vector_solver(), p(), and thresh.
| int test_multiply_with_f12 | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameters | ||
| ) |
| int test_norm | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
| int test_operator_apply | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
| int test_partial_inner_3d | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
References a, aa, b, madness::test_output::checkpoint(), madness::copy(), madness::test_output::end(), madness::f, f1, f2, f3, data< T, NDIM >::get_functions(), madness::FunctionDefaults< NDIM >::get_thresh(), madness::inner(), NDIM, madness::nonlinear_vector_solver(), norm(), madness::OT_F12, madness::print(), and thresh.
| int test_partial_inner_6d | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
References a, b, madness::test_output::checkpoint(), madness::test_output::end(), madness::f, f1, f2, f3, data< T, NDIM >::get_ccpairfunctions(), data< T, NDIM >::get_functions(), madness::FunctionDefaults< NDIM >::get_thresh(), madness::inner(), longtest, NDIM, madness::nonlinear_vector_solver(), madness::OT_F12, madness::print(), and madness::r2().
| int test_projector | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
References a, aa, b, madness::test_output::checkpoint(), madness::copy(), madness::test_output::end(), madness::f, f1, f2, f3, data< T, NDIM >::get_functions(), madness::FunctionDefaults< NDIM >::get_thresh(), madness::inner(), madness::matrix_inner(), NDIM, madness::nonlinear_vector_solver(), madness::OT_F12, p(), madness::print(), Q(), madness::StrongOrthogonalityProjector< T, NDIM >::set_spaces(), and thresh.
| int test_scalar_multiplication | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
References a, b, madness::test_output::checkpoint(), madness::copy(), madness::test_output::end(), madness::f, f1, f2, f3, madness::CCPairFunction< T, NDIM >::get_a(), madness::CCPairFunction< T, NDIM >::get_b(), data< T, NDIM >::get_functions(), madness::FunctionDefaults< NDIM >::get_thresh(), madness::inner(), NDIM, madness::nonlinear_vector_solver(), madness::norm2(), p(), and madness::print().
| int test_swap_particles | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameters | ||
| ) |
References a, std::abs(), b, madness::test_output::checkpoint(), madness::copy(), madness::test_output::end(), madness::f, f1, f2, f3, madness::CCPairFunction< T, NDIM >::get_function(), data< T, NDIM >::get_functions(), madness::inner(), madness::matrix_inner(), NDIM, madness::nonlinear_vector_solver(), madness::norm2(), one(), p(), madness::print(), R2, and madness::CCPairFunction< T, NDIM >::swap_particles().
| int test_transformations | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
References madness::test_output::checkpoint(), madness::copy(), diff(), madness::test_output::end(), f1, f2, f3, data< T, NDIM >::get_functions(), madness::inner(), madness::CCPairFunction< T, NDIM >::is_convertible_to_pure_no_op(), madness::CCPairFunction< T, NDIM >::is_op_pure(), madness::CCPairFunction< T, NDIM >::is_pure(), madness::CCPairFunction< T, NDIM >::is_pure_no_op(), NDIM, madness::nonlinear_vector_solver(), madness::OT_F12, and madness::OT_G12.
| int test_tt2d_summation | ( | World & | world, |
| std::shared_ptr< NuclearCorrelationFactor > | ncf, | ||
| data< T, NDIM > & | data, | ||
| const CCParameters & | parameter | ||
| ) |
minimal detector for the loss of precision of low-rank (TT_2D) summation
Adds a smooth and a cuspy function whose analytic sum is known, and compares the numerically summed function against the analytic truth, once for TT_FULL and once for TT_2D. TT_FULL reaches the requested threshold (its scaling-function arithmetic is exact up to spatial truncation); TT_2D does not, because every low-rank add re-truncates the SVD spectrum of a cuspy (slowly decaying) function. The failing TT_2D checkpoint IS the detection.
Uses its own tight regime (k=8, thresh=1e-8) so the ~30x gap is unambiguous and deterministic; the previous k/thresh/tensor_type are restored on exit.
References madness::test_output::checkpoint(), madness::test_output::end(), exact, madness::f, madness::g, madness::FunctionDefaults< NDIM >::get_k(), madness::FunctionDefaults< NDIM >::get_tensor_type(), madness::FunctionDefaults< NDIM >::get_thresh(), k, k0, NDIM, madness::nonlinear_vector_solver(), madness::r2(), madness::World::rank(), madness::FunctionDefaults< NDIM >::set_k(), madness::FunctionDefaults< NDIM >::set_tensor_type(), madness::FunctionDefaults< NDIM >::set_thresh(), sum, thresh, madness::TT_2D, and madness::TT_FULL.
| bool longtest =false |
Referenced by main(), and test_partial_inner_6d().