|
MADNESS 0.10.1
|
A multiresolution adaptive numerical function. More...
#include <mra.h>


Classes | |
| struct | autorefine_square_op |
| struct | SimpleUnaryOpWrapper |
Public Types | |
| typedef Vector< double, NDIM > | coordT |
| Type of vector holding coordinates. | |
| typedef FunctionFactory< T, NDIM > | factoryT |
| typedef FunctionImpl< T, NDIM > | implT |
| typedef FunctionNode< T, NDIM > | nodeT |
| typedef T | typeT |
Public Member Functions | |
| Function () | |
| Default constructor makes uninitialized function. No communication. | |
| Function (const factoryT &factory) | |
| Constructor from FunctionFactory provides named parameter idiom. Possible non-blocking communication. | |
| Function (const Function< T, NDIM > &f) | |
| Copy constructor is shallow. No communication, works in either basis. | |
| ~Function () | |
| Destruction of any underlying implementation is deferred to next global fence. | |
| Function< T, NDIM > & | abs (bool fence=true) |
| Returns *this for chaining. | |
| Function< T, NDIM > & | abs_square (bool fence=true) |
| Returns *this for chaining. | |
| Function< T, NDIM > & | add_scalar (T t, bool fence=true) |
| Inplace add scalar. No communication except for optional fence. | |
| bool | autorefine () const |
| Returns value of autorefine flag. No communication. | |
| void | broaden (const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), bool fence=true) const |
| Inplace broadens support in scaling function basis. | |
| void | change_tensor_type (const TensorArgs &targs, bool fence=true) |
| change the tensor type of the coefficients in the FunctionNode | |
| const Function< T, NDIM > & | change_tree_state (const TreeState finalstate, bool fence=true) const |
| changes tree state to given state | |
| g | change_tree_state (operating_state, false) |
| change_tree_state (operating_state, false) | |
| double | check_symmetry () const |
| check symmetry of a function by computing the 2nd derivative | |
| Function< T, NDIM > & | chop_at_level (const int n, const bool fence=true) |
| remove all nodes with level higher than n | |
| void | clear (bool fence=true) |
| Clears the function as if constructed uninitialized. Optional fence. | |
| const Function< T, NDIM > & | compress (bool fence=true) const |
| Compresses the function, transforming into wavelet basis. Possible non-blocking comm. | |
| Function< T, NDIM > | conj (bool fence=true) |
| Inplace complex conjugate. No communication except for optional fence. | |
| if | constexpr (std::is_same_v< R, T >) |
| if | constexpr (std::is_same_v< T, R >) |
| Level | depthpt (const coordT &xuser) const |
| Function< T, NDIM/2 > | dirac_convolution (const bool fence=true) const |
| void | distribute (std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > newmap) const |
| distribute this function according to newmap | |
| template<size_t LDIM, size_t KDIM> | |
| void | do_hartree_product (const std::vector< std::shared_ptr< FunctionImpl< T, LDIM > > > left, const std::vector< std::shared_ptr< FunctionImpl< T, KDIM > > > right) |
| perform the hartree product of f*g, invoked by result | |
| template<size_t LDIM, size_t KDIM, typename opT> | |
| void | do_hartree_product (const std::vector< std::shared_ptr< FunctionImpl< T, LDIM > > > left, const std::vector< std::shared_ptr< FunctionImpl< T, KDIM > > > right, const opT *op) |
| perform the hartree product of f*g, invoked by result | |
| template<typename funcT> | |
| double | err (const funcT &func) const |
| Returns an estimate of the difference ||this-func|| ... global sum performed. | |
| template<typename funcT> | |
| double | errsq_local (const funcT &func) const |
| Returns an estimate of the difference ||this-func||^2 from local data. | |
| Future< T > | eval (const coordT &xuser) const |
| Evaluates the function at a point in user coordinates. Possible non-blocking comm. | |
| Tensor< T > | eval_cube (const Tensor< double > &cell, const std::vector< long > &npt, bool eval_refine=false) const |
| Evaluates a cube/slice of points (probably for plotting) ... collective but no fence necessary. | |
| std::vector< std::pair< bool, T > > | eval_local_only (const std::vector< coordT > &xuser, Level maxlevel) const |
| void | eval_local_only (const std::vector< coordT > &xuser, Level maxlevel, std::vector< std::pair< bool, T > > &results) const |
| Batched eval_local_only writing into a caller-provided buffer. | |
| std::pair< bool, T > | eval_local_only (const Vector< double, NDIM > &xuser, Level maxlevel) const |
| Evaluate function only if point is local returning (true,value); otherwise return (false,0.0). | |
| Future< Level > | evaldepthpt (const coordT &xuser) const |
| Future< long > | evalR (const coordT &xuser) const |
| Evaluates the function rank at a point in user coordinates. Possible non-blocking comm. | |
| impl world gop | fence () |
| impl world gop | fence () |
| impl world gop | fence () |
| Function< T, NDIM > & | fill_cuspy_tree (const bool fence=true) |
| Special refinement on 6D boxes where the electrons come close (meet). | |
| template<typename opT> | |
| Function< T, NDIM > & | fill_cuspy_tree (const opT &op, const bool fence=true) |
| template<typename opT> | |
| Function< T, NDIM > & | fill_nuclear_cuspy_tree (const opT &op, const size_t particle, const bool fence=true) |
| Function< T, NDIM > & | fill_nuclear_cuspy_tree (const size_t particle, const bool fence=true) |
| Special refinement on 6D boxes for the nuclear potentials (regularized with cusp, non-regularized with singularity). | |
| Function< T, NDIM > & | fill_tree (bool fence=true) |
| With this being an on-demand function, fill the MRA tree according to different criteria. | |
| template<typename R> | |
| Function< T, NDIM > & | fill_tree (const Function< R, NDIM > &g, bool fence=true) |
| With this being an on-demand function, fill the MRA tree according to different criteria. | |
| template<typename opT> | |
| Function< T, NDIM > & | fill_tree (const opT &op, bool fence=true) |
| With this being an on-demand function, fill the MRA tree according to different criteria. | |
| return impl dot_local * | g ()) |
| return impl inner_local * | g ()) |
| template<typename Q, typename R> | |
| Function< T, NDIM > & | gaxpy (const T &alpha, const Function< Q, NDIM > &other, const R &beta, bool fence=true) |
| Inplace, general bi-linear operation in wavelet basis. No communication except for optional fence. | |
| template<typename L> | |
| void | gaxpy_ext (const Function< L, NDIM > &left, T(*f)(const coordT &), T alpha, T beta, double tol, bool fence=true) const |
| template<typename L, typename R> | |
| Function< T, NDIM > & | gaxpy_oop (T alpha, const Function< L, NDIM > &left, T beta, const Function< R, NDIM > &right, bool fence) |
| This is replaced with alpha*left + beta*right ... private. | |
| const std::shared_ptr< FunctionImpl< T, NDIM > > & | get_impl () const |
| Returns a shared-pointer to the implementation. | |
| const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > & | get_pmap () const |
| Returns a shared pointer to the process map. | |
| if (not g.is_initialized()) return 0.0 | |
| if (not this->is_initialized()) return 0.0 | |
| if (VERIFY_TREE) g.verify_tree() | |
| if (VERIFY_TREE) g.verify_tree() | |
| if (VERIFY_TREE) g.verify_tree() | |
| if (VERIFY_TREE) verify_tree() | |
| if (VERIFY_TREE) verify_tree() | |
| if (VERIFY_TREE) verify_tree() | |
| if (VERIFY_TREE) verify_tree() | |
| bool | impl_initialized () const |
| T | inner_adaptive (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine=true) const |
| T | inner_ext (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine=true, const bool keep_redundant=false) const |
| T | inner_ext_local (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine=true, const bool keep_redundant=false) const |
| bool | is_compressed () const |
| Returns true if compressed, false otherwise. No communication. | |
| bool | is_initialized () const |
| Returns true if the function is initialized. | |
| bool | is_nonstandard () const |
| Returns true if nonstandard-compressed, false otherwise. No communication. | |
| bool | is_on_demand () const |
| bool | is_reconstructed () const |
| Returns true if reconstructed, false otherwise. No communication. | |
| bool | is_redundant () const |
| Returns true if redundant, false otherwise. No communication. | |
| bool | is_redundant_after_merge () const |
| Returns true if redundant_after_merge, false otherwise. No communication. | |
| int | k () const |
| Returns the number of multiwavelets (k). No communication. | |
| template<typename Archive> | |
| void | load (World &world, Archive &ar) |
| Replaces this function with one loaded from an archive using the default processor map. | |
| MADNESS_ASSERT (func) | |
| MADNESS_ASSERT (g.is_compressed()) | |
| MADNESS_ASSERT (is_compressed()) | |
| MADNESS_CHECK_THROW (compressed or redundant,"functions must be compressed or redundant in inner") | |
| void | make_nonstandard (bool keepleaves, bool fence=true) const |
| Compresses the function retaining scaling function coeffs. Possible non-blocking comm. | |
| void | make_redundant (bool fence=true) const |
| Converts the function to redundant form, i.e. sum coefficients on all levels. | |
| func | make_redundant (true) |
| Function< T, NDIM > & | map_and_mirror (const Function< T, NDIM > &f, const std::vector< long > &map, const std::vector< long > &mirror, bool fence) |
| This is replaced with mirror(map(f)) ... private. | |
| Function< T, NDIM > & | mapdim (const Function< T, NDIM > &f, const std::vector< long > &map, bool fence) |
| This is replaced with mapdim(f) ... private. | |
| std::size_t | max_depth () const |
| Returns the maximum depth of the function tree ... collective global sum. | |
| std::size_t | max_local_depth () const |
| Returns the maximum local depth of the function tree ... no communications. | |
| std::size_t | max_nodes () const |
| Returns the max number of nodes on a processor. | |
| std::size_t | min_nodes () const |
| Returns the min number of nodes on a processor. | |
| Function< T, NDIM > & | mirror (const Function< T, NDIM > &f, const std::vector< long > &mirrormap, bool fence) |
| This is replaced with mirror(f) ... private. | |
| template<typename L, typename R> | |
| void | mul_on_demand (const Function< L, NDIM > &f, const Function< R, NDIM > &g, bool fence=true) |
Same as operator* but with optional fence and no automatic reconstruction. | |
| template<typename opT> | |
| void | multi_to_multi_op_values (const opT &op, const std::vector< Function< T, NDIM > > &vin, std::vector< Function< T, NDIM > > &vout, const bool fence=true) |
| apply op on the input vector yielding an output vector of functions | |
| template<typename opT> | |
| Function< T, NDIM > & | multiop_values (const opT &op, const std::vector< Function< T, NDIM > > &vf) |
| This is replaced with op(vector of functions) ... private. | |
| double | norm2 () const |
| Returns the 2-norm of the function ... global sum ... works in either basis. | |
| double | norm2sq_local () const |
| Returns the square of the norm of the local function ... no communication. | |
| void | norm_tree (bool fence=true) const |
| Initializes information about the function norm at all length scales. | |
| T | operator() (const coordT &xuser) const |
| Evaluates the function at a point in user coordinates. Collective operation. | |
| T | operator() (double x, double y=0, double z=0, double xx=0, double yy=0, double zz=0) const |
| Evaluates the function at a point in user coordinates. Collective operation. | |
| template<typename Q> | |
| IsSupported< TensorTypeData< Q >, Function< T, NDIM > >::type & | operator*= (const Q q) |
| Inplace scaling by a constant. | |
| template<typename Q> | |
| Function< T, NDIM > & | operator+= (const Function< Q, NDIM > &other) |
| Inplace addition of functions in the wavelet basis. | |
| template<typename Q> | |
| Function< T, NDIM > & | operator-= (const Function< Q, NDIM > &other) |
| Inplace subtraction of functions in the wavelet basis. | |
| Function< T, NDIM > & | operator= (const Function< T, NDIM > &f) |
| Assignment is shallow. No communication, works in either basis. | |
| void | print_info () const |
| Print a summary of the load balancing info. | |
| void | print_size (const std::string name) const |
| print some info about this | |
| void | print_tree (std::ostream &os=std::cout) const |
| Process 0 prints a summary of all nodes in the tree (collective). | |
| void | print_tree_graphviz (std::ostream &os=std::cout) const |
| Process 0 prints a graphviz-formatted output of all nodes in the tree (collective). | |
| void | print_tree_json (std::ostream &os=std::cout) const |
| template<typename R, size_t LDIM> | |
| Function< TENSOR_RESULT_TYPE(T, R), NDIM-LDIM > | project_out (const Function< R, LDIM > &g, const int dim) const |
| project this on the low-dim function g: h(x) = <f(x,y) | g(y)> | |
| this | reconstruct () |
| const Function< T, NDIM > & | reconstruct (bool fence=true) const |
| Reconstructs the function, transforming into scaling function basis. Possible non-blocking comm. | |
| Function< T, NDIM > & | reduce_rank (const double thresh=0.0, const bool fence=true) |
| reduce the rank of the coefficient tensors | |
| const Function< T, NDIM > & | refine (bool fence=true) const |
| Inplace autorefines the function using same test as for squaring. | |
| template<typename opT> | |
| void | refine_general (const opT &op, bool fence=true) const |
| Inplace autorefines the function. Optional fence. Possible non-blocking comm. | |
| void | replicate (bool fence=true) const |
| void | replicate (const DistributionType type, bool fence=true) const |
| func | replicate_low_dim_functions (true) |
| void | replicate_on_hosts (bool fence=true) const |
| template<typename Q> | |
| Function< T, NDIM > & | scale (const Q q, bool fence=true) |
| Inplace, scale the function by a constant. No communication except for optional fence. | |
| void | set_autorefine (bool value, bool fence=true) |
| Sets the value of the autorefine flag. Optional global fence. | |
| void | set_functor (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > functor) |
| Replace the current functor with the provided new one. | |
| template<typename R> | |
| void | set_impl (const Function< R, NDIM > &f, bool zero=true) |
| Replace current FunctionImpl with a new one using the same parameters & map as f. | |
| void | set_impl (const std::shared_ptr< FunctionImpl< T, NDIM > > &impl) |
| Replace current FunctionImpl with provided new one. | |
| void | set_thresh (double value, bool fence=true) |
| Sets the value of the truncation threshold. Optional global fence. | |
| void | set_truncate_mode (int value) |
| std::size_t | size () const |
| Returns the number of coefficients in the function ... collective global sum. | |
| std::size_t | size_local () const |
| Return the number of coefficients in the function on this processor. | |
| Function< T, NDIM > & | square (bool fence=true) |
| Inplace squaring of function ... global comm only if not reconstructed. | |
| void | standard (bool fence=true) |
| Converts the function standard compressed form. Possible non-blocking comm. | |
| template<typename Archive> | |
| void | store (Archive &ar) const |
| Stores the function to an archive. | |
| impl world gop | sum (local) |
| impl world gop | sum (local) |
| void | sum_down (bool fence=true) const |
| Sums scaling coeffs down tree restoring state with coeffs only at leaves. Optional fence. Possible non-blocking comm. | |
| template<typename R> | |
| TENSOR_RESULT_TYPE (T, R) dot_local(const Function< R | |
| Returns local part of dot product ... throws if both not compressed. | |
| template<typename R> | |
| TENSOR_RESULT_TYPE (T, R) inner(const Function< R | |
| Returns the inner product. | |
| template<typename R> | |
| TENSOR_RESULT_TYPE (T, R) inner_local(const Function< R | |
| Returns local part of inner product ... throws if both not compressed. | |
| template<typename R> | |
| TENSOR_RESULT_TYPE (T, R) inner_on_demand(const Function< R | |
| Returns the inner product for one on-demand function. | |
| TENSOR_RESULT_TYPE (T, R) local | |
| TENSOR_RESULT_TYPE (T, R) local | |
| double | thresh () const |
| Returns value of truncation threshold. No communication. | |
| T | trace () const |
Returns global value of int(f(x),x) ... global comm required. | |
| T | trace_local () const |
Returns local contribution to int(f(x),x) ... no communication. | |
| std::size_t | tree_size () const |
| Returns the number of nodes in the function tree ... collective global sum. | |
| Function< T, NDIM > & | truncate (double tol=0.0, bool fence=true) |
| Truncate the function with optional fence. Compresses with fence if not compressed. | |
| template<typename Q, typename opT> | |
| Function< typename opT::resultT, NDIM > & | unary_op_coeffs (const Function< Q, NDIM > &func, const opT &op, bool fence) |
| This is replaced with left*right ... private. | |
| template<typename opT> | |
| void | unaryop (const opT &op, bool fence=true) |
| Inplace unary operation on function values. | |
| void | unaryop (T(*f)(T)) |
| Inplace unary operation on function values. | |
| template<typename opT> | |
| void | unaryop_coeff (const opT &op, bool fence=true) |
| Unary operation applied inplace to the coefficients. | |
| template<typename opT> | |
| void | unaryop_node (const opT &op, bool fence=true) |
| Unary operation applied inplace to the nodes. | |
| void | verify () const |
| Asserts that the function is initialized. | |
| void | verify_tree () const |
| Verifies the tree data structure ... global sync implied. | |
| template<typename L, typename R> | |
| void | vmulXX (const Function< L, NDIM > &left, const std::vector< Function< R, NDIM > > &right, std::vector< Function< T, NDIM > > &result, double tol, bool fence) |
| Multiplication of function * vector of functions using recursive algorithm of mulxx. | |
| template<typename R, typename Q> | |
| void | vtransform (const std::vector< Function< R, NDIM > > &v, const Tensor< Q > &c, std::vector< Function< T, NDIM > > &vresult, double tol, bool fence=true) |
| sparse transformation of a vector of functions ... private | |
| World & | world () const |
| Returns the world. | |
Static Public Member Functions | |
| static void | doconj (const Key< NDIM >, Tensor< T > &t) |
| template<typename Q, std::size_t D> | |
| static std::vector< std::shared_ptr< FunctionImpl< Q, D > > > | vimpl (const std::vector< Function< Q, D > > &v) |
| Returns vector of FunctionImpl pointers corresponding to vector of functions. | |
Public Attributes | |
| bool | compressed =is_compressed() and g.is_compressed() |
| NDIM &g | const |
| auto | func =dynamic_cast<CompositeFunctorInterface<T,NDIM,LDIM>* >(g.get_impl()->get_functor().get()) |
| constexpr std::size_t | LDIM =std::max(NDIM/2,std::size_t(1)) |
| return | local |
| TreeState | operating_state =get_impl()->get_tensor_type()==TT_FULL ? compressed : redundant |
| bool | redundant =is_redundant() and g.is_redundant() |
Static Public Attributes | |
| static constexpr std::size_t | dimT =NDIM |
Private Attributes | |
| std::shared_ptr< FunctionImpl< T, NDIM > > | impl |
Friends | |
| template<typename R, std::size_t MDIM> | |
| void | swap (Function< R, MDIM > &f1, Function< R, MDIM > &f2) |
| implements swap algorithm | |
A multiresolution adaptive numerical function.
check if objT is a std::vector of Function<T,NDIM> forward declaration of Function usage: is_madness_function_vector<objT>::value
| typedef Vector<double,NDIM> madness::Function< T, NDIM >::coordT |
Type of vector holding coordinates.
| typedef FunctionFactory<T,NDIM> madness::Function< T, NDIM >::factoryT |
| typedef FunctionImpl<T,NDIM> madness::Function< T, NDIM >::implT |
| typedef FunctionNode<T,NDIM> madness::Function< T, NDIM >::nodeT |
| typedef T madness::Function< T, NDIM >::typeT |
|
inline |
Default constructor makes uninitialized function. No communication.
An uninitialized function can only be assigned to. Any other operation will throw.
Referenced by madness::hartree_product().
|
inline |
Constructor from FunctionFactory provides named parameter idiom. Possible non-blocking communication.
|
inline |
Copy constructor is shallow. No communication, works in either basis.
|
inline |
Destruction of any underlying implementation is deferred to next global fence.
|
inline |
Returns *this for chaining.
Referenced by madness::abs().
|
inline |
Returns *this for chaining.
Referenced by madness::abs_square().
|
inline |
Inplace add scalar. No communication except for optional fence.
Referenced by cplxfunc2(), propagate(), realfunc2(), and test_add().
|
inline |
Returns value of autorefine flag. No communication.
Referenced by madness::smooth< T, NDIM >::make_sigma().
|
inline |
Inplace broadens support in scaling function basis.
N.B. with fence=false the per-node norm reset is skipped: norm_tree keeps the -1.0 broadened marker and dnorm_tree its previous value, so broadening cannot be repeated until the norms are recomputed.
Referenced by APPLY(), APPLY(), and chin_chen().
|
inline |
change the tensor type of the coefficients in the FunctionNode
| [in] | targs | target tensor arguments (threshold and full/low rank) |
|
inline |
changes tree state to given state
Since reconstruction/compression do not discard information we define them as const ... "logical constness" not "bitwise constness".
| [in] | finalstate | The final state of the tree |
| [in] | fence | Fence after the operation (might not be respected!!!) |
Referenced by madness::apply(), madness::MP2::apply_exchange_vector(), madness::Function< double, 3 >::check_symmetry(), madness::Function< double, 3 >::chop_at_level(), madness::composite_inner_apply(), madness::Function< double, 3 >::compress(), madness::hartree_product(), madness::Function< double, 3 >::inner_ext(), madness::Function< double, 3 >::inner_ext_local(), madness::innerXX(), madness::Function< double, 3 >::make_nonstandard(), madness::Function< double, 3 >::make_redundant(), madness::detail::make_term_inputs_reconstructed(), madness::detail::make_term_inputs_redundant(), madness::Function< double, 3 >::operator+=(), madness::Function< double, 3 >::project_out(), madness::Function< double, 3 >::reconstruct(), run_tests(), madness::Function< double, 3 >::standard(), and test_Vphi_ij_u().
| g madness::Function< T, NDIM >::change_tree_state | ( | operating_state | , |
| false | ) |
| madness::Function< T, NDIM >::change_tree_state | ( | operating_state | , |
| false | ) |
|
inline |
check symmetry of a function by computing the 2nd derivative
|
inline |
remove all nodes with level higher than n
|
inline |
Clears the function as if constructed uninitialized. Optional fence.
Any underlying data will not be freed until the next global fence.
Referenced by madness::apply(), energy(), energy(), madness::MP2::guess_mp1_3(), madness::SCF::initial_guess_ao_eigenvectors(), main(), Calculation::make_reference(), Calculation::make_Upsi(), propagate(), madness::SCF::solve(), SVPESolver::solve(), madness::SCF::solve_virtuals(), test_bsh(), and test_math().
|
inline |
Compresses the function, transforming into wavelet basis. Possible non-blocking comm.
By default fence=true meaning that this operation completes before returning, otherwise if fence=false it returns without fencing and the user must invoke world.gop.fence() to assure global completion before using the function for other purposes.
Noop if already compressed or if not initialized.
Since reconstruction/compression do not discard information we define them as const ... "logical constness" not "bitwise constness".
Referenced by RealFuncLinearOp::action(), madness::NuclearCorrelationFactor::apply_U(), madness::Solver< T, NDIM >::compute_rho(), energy(), energy(), main(), madness::SCF::make_density(), madness::SCF::make_density(), MiniDFT::make_density(), madness::GTHPseudopotential< Q >::make_pseudo_potential(), Calculation::make_reference(), moments(), madness::operator+(), madness::operator-(), madness::Function< double, 3 >::operator-=(), propagate(), q_c(), realfunc2(), and test_add().
|
inline |
Inplace complex conjugate. No communication except for optional fence.
Returns this for chaining. Works in either basis.
Referenced by madness::conj().
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
Throws if function is not initialized.
This function mimics operator() by going through the tree looking for the depth of the tree at the point. It blocks until the result is available and then broadcasts the result to everyone. Therefore, if you are evaluating many points in parallel it is vastly less efficient than calling evaldepthpt directly, saving the futures, and then forcing all of the results.
|
inline |
Referenced by madness::CCConvolutionOperator< T, NDIM >::operator()().
|
inline |
distribute this function according to newmap
Referenced by test_replicate().
|
inline |
perform the hartree product of f*g, invoked by result
|
inline |
perform the hartree product of f*g, invoked by result
Referenced by madness::hartree_product(), and madness::hartree_product().
|
inlinestatic |
Referenced by madness::Function< double, 3 >::conj().
|
inline |
Returns an estimate of the difference ||this-func|| ... global sum performed.
If the function is compressed, it is reconstructed first. For efficient use especially with many functions, reconstruct them all first, and use errsq_local instead so you can perform a global sum on all at the same time.
| [in] | func | Templated interface to the a user specified function |
Referenced by main(), run_tests(), test_add(), test_bsh(), test_coulomb(), test_diff(), test_math(), test_op(), test_opdir(), test_sum_down(), test_Vphi_ij_u(), and testgradG().
|
inline |
Returns an estimate of the difference ||this-func||^2 from local data.
No communication is performed. If the function is not reconstructed, it throws an exception. To get the global value either do a global sum of the local values or call errsq
| [in] | func | Templated interface to the a user specified function |
|
inline |
Evaluates the function at a point in user coordinates. Possible non-blocking comm.
Only the invoking process will receive the result via the future though other processes may be involved in the evaluation.
Throws if function is not initialized.
Referenced by madness::Function< double, 3 >::operator()(), and test_apply_push_1d().
|
inline |
Evaluates a cube/slice of points (probably for plotting) ... collective but no fence necessary.
All processes receive the entire result (which is a rather severe limit on the size of the cube that is possible). Set eval_refine=true to return the refinment levels of the given function.
|
inline |
Batched eval_local_only returning a fresh vector (see the output-parameter overload above for semantics).
|
inline |
Batched eval_local_only writing into a caller-provided buffer.
Resizes results to xuser.size() (reusing its capacity) and stores one (local?,value) pair per input point, in input order: (true,value) if the point is owned locally, otherwise (false,0.0). Consecutive points that fall in the same leaf box share that box's descent and coefficient fetch (last-box memoization), so spatially coherent point streams (quadrature grids) amortise the per-point tree descent. Results are bit-for-bit identical to calling the single-point eval_local_only on each point. No communications, and no per-call heap allocation once results has capacity.
maxlevel is the maximum depth to search down to — the max local depth can be computed with max_local_depth();
|
inline |
Evaluate function only if point is local returning (true,value); otherwise return (false,0.0).
maxlevel is the maximum depth to search down to — the max local depth can be computed with max_local_depth();
Referenced by madness::Function< double, 3 >::eval_local_only().
|
inline |
Only the invoking process will receive the result via the future though other processes may be involved in the evaluation.
Throws if function is not initialized.
This function is a minimally-modified version of eval()
Referenced by madness::Function< double, 3 >::depthpt().
|
inline |
Evaluates the function rank at a point in user coordinates. Possible non-blocking comm.
Only the invoking process will receive the result via the future though other processes may be involved in the evaluation.
Throws if function is not initialized.
| impl world gop madness::Function< T, NDIM >::fence | ( | ) |
| impl world gop madness::Function< T, NDIM >::fence | ( | ) |
| impl world gop madness::Function< T, NDIM >::fence | ( | ) |
Referenced by madness::abs(), madness::abs_square(), madness::abssq(), madness::add(), madness::apply(), madness::apply_1d_realspace_push(), madness::apply_only(), madness::binary_op(), madness::change_tree_state(), madness::composite_product(), madness::composite_product(), madness::conj(), madness::convert(), madness::copy(), madness::copy(), madness::copy(), madness::gaxpy(), madness::gaxpy_oop(), madness::gaxpy_oop_reconstructed(), madness::imag(), madness::map_and_mirror(), madness::mapdim(), madness::mirror(), madness::mul(), madness::mul(), madness::mul(), madness::mul_sparse(), madness::project(), madness::real(), madness::sub(), test_replication_policy(), madness::unary_op(), madness::unary_op_coeffs(), and madness::vmulXX().
|
inline |
Special refinement on 6D boxes where the electrons come close (meet).
|
inline |
Special refinement on 6D boxes where the electrons come close (meet)
| [in] | op | the convolution operator for screening |
Referenced by madness::CCPotentials::apply_Kfxy(), madness::CCPotentials::apply_transformed_Ue(), madness::CCPairFunction< T, NDIM >::convert_to_pure_no_op_inplace(), madness::MP2::make_Uphi0(), test_diagnose_GQKffK(), and test_vector_composite().
|
inline |
Special refinement on 6D boxes for the nuclear potentials (regularized with cusp, non-regularized with singularity)
| [in] | op | the convolution operator for screening |
Referenced by madness::CCPotentials::fock_residue_6d(), and madness::CCPotentials::fock_residue_6d_macrotask().
|
inline |
Special refinement on 6D boxes for the nuclear potentials (regularized with cusp, non-regularized with singularity).
|
inline |
With this being an on-demand function, fill the MRA tree according to different criteria.
|
inline |
With this being an on-demand function, fill the MRA tree according to different criteria.
| [in] | g | the function after which the MRA structure is modeled (any basis works) |
Referenced by apply_U_mix(), apply_U_ncf(), compute_energy(), compute_energy(), compute_R2f2_psi(), madness::CCPairFunction< T, NDIM >::convert_to_pure_no_op_inplace(), madness::CCPotentials::make_6D_pair(), madness::MP2::make_fKphi0(), madness::MP2::make_KffKphi0(), madness::MP2::multiply_with_0th_order_Hamiltonian(), madness::CCPairFunction< T, NDIM >::op_pure_to_pure(), reconstruct_psi(), run_tests(), madness::CCPotentials::test(), test_adaptive_tree(), test_compress(), test_multiply(), test_recursive_application(), test_U_el(), and test_vector_composite().
|
inline |
With this being an on-demand function, fill the MRA tree according to different criteria.
| [in] | op | the convolution operator for screening |
| return impl dot_local * madness::Function< T, NDIM >::g | ( | ) |
| return impl inner_local * madness::Function< T, NDIM >::g | ( | ) |
|
inline |
Inplace, general bi-linear operation in wavelet basis. No communication except for optional fence.
If the functions are not in the wavelet basis an exception is thrown since this routine is intended to be fast and unexpected compression is assumed to be a performance bug.
Returns this for chaining, can be in states compressed of redundant_after_merge.
this and other may have different distributions and may even live in different worlds
this <– this*alpha + other*beta
Referenced by madness::Solver< T, NDIM >::compute_rho(), madness::MolecularEnergy::energy_and_gradient(), madness::FunctionSpace< T, NDIM >::gaxpy(), madness::gaxpy(), madness::MolecularEnergy::gradient(), main(), madness::Nemo::make_density(), madness::SCF::make_density(), madness::SCF::make_density(), MiniDFT::make_density(), Calculation::make_reference(), moments(), madness::Function< double, 3 >::operator+=(), madness::Function< double, 3 >::operator-=(), MiniDFT::orthogonalize(), orthogonalize(), propagate(), q_c(), madness::sum(), and madness::NonlinearSolverND< 3 >::update().
|
inline |
This is replaced with alpha*left + beta*right ... private.
Referenced by madness::add(), and madness::sub().
|
inline |
Returns a shared-pointer to the implementation.
Referenced by madness::apply(), madness::apply(), madness::apply_1d_realspace_push(), madness::MP2::apply_exchange_vector(), madness::binary_op(), madness::composite_inner(), madness::composite_inner(), madness::composite_inner_apply(), madness::composite_product(), madness::composite_product(), madness::Function< double, 3 >::constexpr(), madness::convert(), madness::copy(), madness::copy(), madness::Function< double, 3 >::dirac_convolution(), madness::Function< double, 3 >::fill_cuspy_tree(), madness::Function< double, 3 >::fill_cuspy_tree(), madness::Function< double, 3 >::fill_nuclear_cuspy_tree(), madness::Function< double, 3 >::fill_nuclear_cuspy_tree(), madness::Function< double, 3 >::fill_tree(), madness::Function< double, 3 >::fill_tree(), madness::Function< double, 3 >::gaxpy(), madness::Function< double, 3 >::gaxpy_ext(), madness::Function< double, 3 >::gaxpy_oop(), madness::gaxpy_oop_reconstructed(), madness::hartree_product(), madness::hartree_product(), main(), madness::detail::make_term_impl(), madness::mul_sparse(), madness::multiply(), nodes_with_moved_marker(), nodes_with_unscaled_norms(), madness::DerivativeBase< T, NDIM >::operator()(), madness::operator+(), madness::Function< double, 3 >::operator+=(), madness::Function< double, 3 >::operator-=(), madness::project(), madness::Function< double, 3 >::project_out(), run_tests(), solve(), madness::symmetrize(), test_copy_function_from_other_world(), test_copy_function_from_other_world_through_cloud(), test_pointer_to_funcimpl(), test_replication_policy(), test_scale_inplace_norms(), test_scaled_redundant_operand(), test_sum_down(), test_Vphi_ij_u(), madness::unary_op(), madness::Function< double, 3 >::vimpl(), and madness::Function< double, 3 >::vmulXX().
|
inline |
Returns a shared pointer to the process map.
Referenced by madness::Function< double, 3 >::gaxpy_oop(), and test_replicate().
| madness::Function< T, NDIM >::if | ( | not g. | is_initialized() | ) |
| madness::Function< T, NDIM >::if | ( | not this-> | is_initialized() | ) |
| madness::Function< T, NDIM >::if | ( | VERIFY_TREE | ) |
| madness::Function< T, NDIM >::if | ( | VERIFY_TREE | ) |
| madness::Function< T, NDIM >::if | ( | VERIFY_TREE | ) |
| madness::Function< T, NDIM >::if | ( | VERIFY_TREE | ) |
| madness::Function< T, NDIM >::if | ( | VERIFY_TREE | ) |
| madness::Function< T, NDIM >::if | ( | VERIFY_TREE | ) |
| madness::Function< T, NDIM >::if | ( | VERIFY_TREE | ) |
|
inline |
|
inline |
Return the inner product with external function ... requires communication. If you are going to be doing a bunch of inner_ext calls, set keep_redundant to true and then manually undo_redundant when you are finished.
| [in] | f | Reference to FunctionFunctorInterface. This is the externally provided function |
| [in] | leaf_refine | boolean switch to turn on/off refinement past leaf nodes |
|
inline |
Return the inner product with external function ... requires communication. If you are going to be doing a bunch of inner_ext calls, set keep_redundant to true and then manually undo_redundant when you are finished.
| [in] | f | Reference to FunctionFunctorInterface. This is the externally provided function |
| [in] | leaf_refine | boolean switch to turn on/off refinement past leaf nodes |
| [in] | keep_redundant | boolean switch to turn on/off undo_redundant |
Referenced by main().
|
inline |
Return the local part of inner product with external function ... no communication. If you are going to be doing a bunch of inner_ext calls, set keep_redundant to true and then manually undo_redundant when you are finished.
| [in] | f | Pointer to function of type T that take coordT arguments. This is the externally provided function |
| [in] | leaf_refine | boolean switch to turn on/off refinement past leaf nodes |
| [in] | keep_redundant | boolean switch to turn on/off undo_redundant |
|
inline |
Returns true if compressed, false otherwise. No communication.
If the function is not initialized, returns false.
Referenced by madness::Function< double, 3 >::gaxpy_oop(), madness::operator+(), madness::operator-(), and test_add().
|
inline |
Returns true if the function is initialized.
Referenced by madness::change_tree_state(), madness::composite_inner(), madness::composite_inner(), madness::composite_inner_apply(), madness::MP2::guess_mp1_3(), madness::innerXX(), madness::CCPairBuilder::make_bare_pair_from_file(), madness::TDHF::make_perturbed_fock_matrix(), madness::detail::make_term_impl(), madness::detail::make_term_inputs_reconstructed(), madness::detail::make_term_inputs_redundant(), madness::Function< double, 3 >::multi_to_multi_op_values(), madness::Function< double, 3 >::multiop_values(), madness::CCPairFunction< T, NDIM >::project_out(), test_meta_gga(), and madness::CC2::update_constant_part_cispd().
|
inline |
Returns true if nonstandard-compressed, false otherwise. No communication.
If the function is not initialized, returns false.
|
inline |
Referenced by madness::composite_inner(), madness::composite_inner(), madness::Function< double, 3 >::constexpr(), madness::Function< double, 3 >::fill_cuspy_tree(), madness::Function< double, 3 >::fill_cuspy_tree(), madness::Function< double, 3 >::fill_nuclear_cuspy_tree(), madness::Function< double, 3 >::fill_nuclear_cuspy_tree(), madness::Function< double, 3 >::fill_tree(), madness::Function< double, 3 >::fill_tree(), madness::Function< double, 3 >::fill_tree(), madness::Function< double, 3 >::norm2(), madness::operator*(), madness::Function< double, 3 >::TENSOR_RESULT_TYPE(), and madness::Function< double, 3 >::trace().
|
inline |
Returns true if reconstructed, false otherwise. No communication.
If the function is not initialized, returns false.
Referenced by madness::Function< double, 3 >::abs(), madness::Function< double, 3 >::abs_square(), madness::binary_op(), madness::Function< double, 3 >::depthpt(), madness::Function< double, 3 >::dirac_convolution(), madness::Function< double, 3 >::err(), madness::Function< double, 3 >::errsq_local(), madness::Function< double, 3 >::eval(), madness::Function< double, 3 >::eval_local_only(), madness::Function< double, 3 >::eval_local_only(), madness::Function< double, 3 >::evaldepthpt(), madness::Function< double, 3 >::evalR(), madness::Function< double, 3 >::gaxpy_ext(), madness::gaxpy_oop_reconstructed(), madness::Function< double, 3 >::norm_tree(), madness::Function< double, 3 >::operator()(), madness::operator*(), madness::Function< double, 3 >::refine_general(), and madness::Function< double, 3 >::square().
|
inline |
Returns true if redundant, false otherwise. No communication.
If the function is not initialized, returns false.
|
inline |
Returns true if redundant_after_merge, false otherwise. No communication.
If the function is not initialized, returns false.
|
inline |
Returns the number of multiwavelets (k). No communication.
Referenced by madness::Function< double, 3 >::dirac_convolution(), dostuff(), madness::hartree_product(), madness::hartree_product(), madness::Function< double, 3 >::load(), load_function(), main(), and madness::Function< double, 3 >::store().
|
inline |
Replaces this function with one loaded from an archive using the default processor map.
Archive can be sequential or parallel.
The & operator for serializing will only work with parallel archives.
| madness::Function< T, NDIM >::MADNESS_ASSERT | ( | func | ) |
| madness::Function< T, NDIM >::MADNESS_ASSERT | ( | g. | is_compressed() | ) |
| madness::Function< T, NDIM >::MADNESS_ASSERT | ( | is_compressed() | ) |
| madness::Function< T, NDIM >::MADNESS_CHECK_THROW | ( | compressed or | redundant, |
| "functions must be compressed or redundant in inner" | ) |
|
inline |
Compresses the function retaining scaling function coeffs. Possible non-blocking comm.
By default fence=true meaning that this operation completes before returning, otherwise if fence=false it returns without fencing and the user must invoke world.gop.fence() to assure global completion before using the function for other purposes.
Noop if already compressed or if not initialized.
Referenced by madness::apply(), and madness::hartree_product().
|
inline |
Converts the function to redundant form, i.e. sum coefficients on all levels.
By default fence=true meaning that this operation completes before returning, otherwise if fence=false it returns without fencing and the user must invoke world.gop.fence() to assure global completion before using the function for other purposes.
Since the transformation does not discard information we define this as const ... "logical constness" not "bitwise constness".
Note redundant form stores sum coefficients at every level, so it is larger than reconstructed form; a caller that keeps the function alive may want to convert back.
| func madness::Function< T, NDIM >::make_redundant | ( | true | ) |
|
inline |
This is replaced with mirror(map(f)) ... private.
first map then mirror! mirror is similar to mapdim, but maps from x to -x, y to -y, and so on Example: mirror a 3d function on the xy plane: mirror={1,1,-1} Example: c4 rotation of a 3d function around the z axis: x->y, y->-x, z->z: map(1,0,2); mirror(-1,1,1)
| [in] | map | array holding dimensions |
| [in] | mirror | array of -1 and 1, corresponding to mirror or not |
Referenced by madness::map_and_mirror().
|
inline |
This is replaced with mapdim(f) ... private.
Referenced by madness::mapdim(), madness::swap_particles(), and madness::symmetrize().
|
inline |
Returns the maximum depth of the function tree ... collective global sum.
Referenced by testNavierStokes().
|
inline |
Returns the maximum local depth of the function tree ... no communications.
This is the value to pass as maxlevel to eval_local_only: it bounds the descent to the deepest leaf actually held on this rank. Passing a larger bound (e.g. Level::max()) only makes a missing/remote point descend through empty levels doing owner() checks that never match – pure overhead.
|
inline |
Returns the max number of nodes on a processor.
Referenced by test_gaussian_num_coeffs().
|
inline |
Returns the min number of nodes on a processor.
|
inline |
This is replaced with mirror(f) ... private.
similar to mapdim, but maps from x to -x, y to -y, and so on Example: mirror a 3d function on the xy plane: mirror={1,1,-1}
| [in] | mirror | array of -1 and 1, corresponding to mirror or not |
Referenced by madness::mirror().
|
inline |
Same as operator* but with optional fence and no automatic reconstruction.
f or g are on-demand functions
|
inline |
apply op on the input vector yielding an output vector of functions
(*this) is just a dummy Function to be able to call internal methods in FuncImpl
| [in] | op | the operator working on vin |
| [in] | vin | vector of input Functions |
| [out] | vout | vector of output Functions vout = op(vin) |
Referenced by madness::multi_to_multi_op_values().
|
inline |
This is replaced with op(vector of functions) ... private.
Referenced by madness::multiop_values().
|
inline |
Returns the 2-norm of the function ... global sum ... works in either basis.
Works in any state whose coefficients norm2sq_local() can sum, which includes the redundant and nonstandard-with-leaves trees left behind by mul_sparse() and friends; the remaining states are reconstructed first. See comments for err() w.r.t. applying to many functions.
Throws if the function is on-demand: it carries no coefficients, so its norm is not defined until it is materialized.
N.B. that reconstruction is a mutation – it discards the interior coefficients – so this (logically const) method fences before it changes state: any task still reading those coefficients, e.g. a mul_sparse() invoked with fence=false, must be done with them before they are removed.
The branch is taken on the tree state, which is replicated, so all ranks take the same branch and the global ops stay collective.
Referenced by madness::XCOperator< T, NDIM >::XCOperator(), madness::XCOperator< T, NDIM >::XCOperator(), madness::Solver< T, NDIM >::apply_hf_exchange(), madness::CCPotentials::apply_Vreg(), GygiPot::cavitation_energy(), check(), check_operator_multiplications_3d(), madness::Znemo::compute_current_density(), compute_energy(), compute_energy(), madness::Function< double, 3 >::constexpr(), converge(), converge(), converge2s(), GygiPot::dfree_drho(), doit(), GygiPot::ESP(), madness::CCPotentials::fock_residue_6d(), madness::MP2::increment(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate_excite(), iterate_excite(), iterate_ground(), iterate_ground(), madness::CC2::iterate_pair(), madness::CCPotentials::iterate_pair_macrotask(), main(), madness::CCPotentials::make_constant_part_cispd(), madness::CCPotentials::make_constant_part_cispd_Qt(), madness::EigSolver< T, NDIM >::multi_solve(), MiniDFT::orthogonalize(), orthogonalize(), SurfaceMoleculeInteraction::perturbed_molecular_pot(), Calculation::project_potential_basis(), run(), madness::OEP::selftest(), simple_example(), madness::EigSolver< T, NDIM >::solve(), madness::MP2::solve_residual_equations(), test(), test_adaptive_tree(), test_add(), test_combined_operators(), madness::CCPotentials::test_compare_pairs(), madness::Znemo::test_compute_current_density(), test_consolidate_vs_direct(), test_converged_function(), test_conversion(), test_convolution(), test_copy_function_from_other_world(), test_copy_function_from_other_world_through_cloud(), test_coulomb(), test_diagnose_GQKffK(), test_diagnose_GQUe(), test_exchange(), test_gconv(), test_hf_be(), test_integration(), test_invrsq_operator(), test_kinetic(), test_lowrank_function(), madness::Diamagnetic_potential_factor::test_lz_commutator(), test_meta_gga(), test_no_halo_no_allocation(), test_op(), test_opdir(), test_pointer_to_funcimpl(), test_recursive_application(), test_recursive_apply(), test_replication_policy(), test_rot(), test_sum_down_files(), test_U_el(), test_vector_composite(), and testNavierStokes().
|
inline |
Returns the square of the norm of the local function ... no communication.
Works in any state that holds its coefficients once, cf. FunctionImpl::has_summable_coefficients()
|
inline |
Initializes information about the function norm at all length scales.
|
inline |
Evaluates the function at a point in user coordinates. Collective operation.
Throws if function is not initialized.
This function calls eval, blocks until the result is available and then broadcasts the result to everyone. Therefore, if you are evaluating many points in parallel it is vastly less efficient than calling eval directly, saving the futures, and then forcing all of the results.
|
inline |
Evaluates the function at a point in user coordinates. Collective operation.
See "operator()(const coordT& xuser)" for more info
|
inline |
Inplace scaling by a constant.
Using operator notation forces a global fence after every operation
|
inline |
Inplace addition of functions in the wavelet basis.
Using operator notation forces a global fence after every operation. Functions don't need to be compressed, it's the caller's responsibility to choose an appropriate state with performance, usually compressed for 3d, reconstructed for 6d)
|
inline |
Inplace subtraction of functions in the wavelet basis.
Using operator notation forces a global fence after every operation
|
inline |
Assignment is shallow. No communication, works in either basis.
|
inline |
Print a summary of the load balancing info.
This is serial and VERY expensive
|
inline |
print some info about this
Referenced by madness::apply(), madness::CCPotentials::apply_exchange_commutator(), madness::CCPotentials::apply_Vreg(), madness::Zcis::compute_potentials(), madness::CCPotentials::fock_residue_6d(), madness::CCPotentials::fock_residue_6d_macrotask(), madness::MP2::guess_mp1_3(), madness::MP2::increment(), iterate(), madness::Zcis::iterate(), madness::CC2::iterate_pair(), madness::CCPotentials::iterate_pair_macrotask(), load_function(), main(), madness::CCPotentials::make_constant_part_cispd(), madness::CCPotentials::make_constant_part_cispd_Qt(), madness::CCPotentials::make_constant_part_macrotask(), madness::MP2::make_KffKphi0(), madness::MP2::make_Uphi0(), madness::MP2::multiply_with_0th_order_Hamiltonian(), save_function(), madness::MP2::solve_residual_equations(), madness::CCPotentials::test(), test_adaptive_tree(), madness::CCPotentials::test_compare_pairs(), test_compress(), test_exchange(), test_multiply(), test_spherical_box(), test_tight_diffuse(), and test_truncation().
|
inline |
Process 0 prints a summary of all nodes in the tree (collective).
Referenced by main().
|
inline |
Process 0 prints a graphviz-formatted output of all nodes in the tree (collective).
|
inline |
same as print_tree() but produces JSON-formatted string
|
inline |
project this on the low-dim function g: h(x) = <f(x,y) | g(y)>
| [in] | g | low-dim function |
| [in] | dim | over which dimensions to be integrated: 0..LDIM-1 or LDIM..NDIM-1 |
Referenced by madness::MP2::guess_mp1_3(), madness::DiagnosticMatrix< T, NDIM >::project_xy(), madness::CCPotentials::test(), and test_partial_inner().
| this madness::Function< T, NDIM >::reconstruct | ( | ) |
Referenced by madness::Function< double, 3 >::abs(), madness::Function< double, 3 >::abs_square(), madness::apply(), madness::Function< double, 3 >::broaden(), madness::Function< double, 3 >::depthpt(), madness::Function< double, 3 >::dirac_convolution(), madness::Function< double, 3 >::err(), madness::Function< double, 3 >::eval_cube(), madness::Function< double, 3 >::inner_adaptive(), madness::Function< double, 3 >::norm2(), madness::Function< double, 3 >::norm_tree(), madness::Function< double, 3 >::operator()(), madness::Function< double, 3 >::operator-=(), madness::Function< double, 3 >::refine_general(), madness::Function< double, 3 >::square(), madness::Function< double, 3 >::trace(), and madness::Function< double, 3 >::unaryop().
|
inline |
Reconstructs the function, transforming into scaling function basis. Possible non-blocking comm.
By default fence=true meaning that this operation completes before returning, otherwise if fence=false it returns without fencing and the user must invoke world.gop.fence() to assure global completion before using the function for other purposes.
Noop if already reconstructed or if not initialized.
Since reconstruction/compression do not discard information we define them as const ... "logical constness" not "bitwise constness".
Referenced by APPLY(), APPLY(), madness::apply(), madness::apply_1d_realspace_push(), apply_potential(), madness::binary_op(), Calculation::calc_optimal_coeffs(), chin_chen(), madness::SCF::do_plots(), dostuff(), madness::Function< double, 3 >::gaxpy_ext(), madness::Solver< T, NDIM >::initial_guess(), madness::SCF::initial_guess_ao_eigenvectors(), main(), madness::smooth< T, NDIM >::make_density_mask(), madness::SCF::make_lda_potential(), madness::smooth< T, NDIM >::make_mask(), madness::PotentialManager::make_nuclear_potential(), Calculation::make_reference(), Calculation::make_Upsi(), madness::operator*(), madness::operator+(), madness::operator-(), madness::Function< double, 3 >::operator-=(), madness::XCOperator< T, NDIM >::prep_xc_args(), madness::project(), propagate(), solve(), test_add(), test_coulomb(), test_he_potential(), test_hf_be(), test_hf_he(), test_inner(), test_periodic(), test_periodic1(), test_periodic2(), test_periodic_bsh(), test_sum_down(), test_sum_down_files(), test_xc2(), testbsh(), testPeriodicCoulomb3d(), and madness::CCConvolutionOperator< T, NDIM >::update_elements().
|
inline |
reduce the rank of the coefficient tensors
Referenced by madness::CCPotentials::apply_exchange_commutator(), madness::ExchangeCommutator::apply_KffK_6d(), madness::ExchangeCommutator::apply_KffK_lowrank_three_range(), madness::CCPotentials::apply_Kfxy(), apply_U_ncf(), madness::CCPotentials::fock_residue_6d(), madness::CCPotentials::fock_residue_6d_macrotask(), madness::MP2::guess_mp1_3(), madness::CC2::iterate_pair(), madness::CCPotentials::iterate_pair_macrotask(), madness::CCPotentials::make_6D_pair(), madness::CCPotentials::make_constant_part_cispd_Qt(), madness::CCPotentials::make_constant_part_macrotask(), madness::MP2::make_KffKphi0(), madness::MP2::multiply_with_0th_order_Hamiltonian(), and madness::CCPotentials::test().
|
inline |
Inplace autorefines the function using same test as for squaring.
return this for chaining
Referenced by madness::Nemo::gradient(), and madness::smooth< T, NDIM >::smooth_density_from_orbitals().
|
inline |
Inplace autorefines the function. Optional fence. Possible non-blocking comm.
Referenced by madness::Function< double, 3 >::refine().
|
inline |
Replicates this function on every rank.
Every rank owns every coefficient node, so rank-local operations such as eval_local_only work on every rank. Global reductions count the data more than once. Queued tasks must not change the coefficients until the call returns.
|
inline |
Replicates this function according to its distribution type.
RankReplicated gives every rank every coefficient node. NodeReplicated gives one copy per host, and the lowest rank on that host owns it. The two methods below give the ownership rules and the limits of each policy. NodeReplicated requires fence=true.
Referenced by test_replicate().
| func madness::Function< T, NDIM >::replicate_low_dim_functions | ( | true | ) |
|
inline |
Replicates this function once per host.
The lowest rank on each host owns all coefficient nodes. Other ranks route ordinary container access, such as find, to that rank. eval_local_only does no communication, so it returns false on those ranks. Global reductions count one copy per host. If every rank needs local coefficient access, replicate() is the correct policy. fence must be true.
|
inline |
Inplace, scale the function by a constant. No communication except for optional fence.
Works in either basis. Returns reference to this for chaining.
Referenced by DirichletCondIntOp::action(), WSTFunctional::apply_xc(), madness::DFT< T, NDIM >::calculate_tot_xc_energy(), madness::Coulomb< T, NDIM >::compute_density(), madness::Coulomb< T, NDIM >::compute_potential(), madness::Zcis::compute_potentials(), madness::Diamagnetic_potential_factor::compute_R_times_T_commutator_scalar_term_numerically(), madness::Solver< T, NDIM >::compute_rho_slow(), converge(), converge(), converge2s(), madness::PotentialManager::core_projection(), madness::SCF::do_plots(), doit(), MiniDFT::doit(), madness::Nemo::get_coulomb_potential(), madness::Nemo::gradient(), madness::MP2::increment(), madness::Solver< T, NDIM >::initial_guess(), madness::SCF::initial_guess_ao_eigenvectors(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), madness::Zcis::iterate(), iterate_excite(), iterate_excite(), iterate_ground(), iterate_ground(), iterate_xy(), iterate_xy(), main(), madness::CCPotentials::make_constant_part_cispd_Qt(), make_density(), DF::make_fermi_potential(), SurfaceMoleculeInteraction::make_surfcharge(), madness::XCFunctionalLDA< T, NDIM >::op_r(), madness::Function< double, 3 >::operator*=(), MiniDFT::orthogonalize(), orthogonalize(), run(), madness::EigSolver< T, NDIM >::solve(), madness::SCF::solve(), madness::MP2::solve_coupled_equations(), madness::MP2::solve_residual_equations(), squaremod(), test_adaptive_tree(), test_add(), madness::Znemo::test_compute_current_density(), test_diagnose_GQKffK(), test_diagnose_GQUe(), test_he_potential(), test_hf_be(), test_invrsq_operator(), test_kinetic(), test_meta_gga(), test_modified(), test_recursive_application(), test_scale_inplace_norms(), and test_scale_preserves_broaden_marker().
|
inline |
Sets the value of the autorefine flag. Optional global fence.
A fence is required to ensure consistent global state.
|
inline |
Replace the current functor with the provided new one.
presumably the new functor will be a CompositeFunctor, which will change the behavior of the function: multiply the functor with the function
|
inline |
Replace current FunctionImpl with a new one using the same parameters & map as f.
If zero is true the function is initialized to zero, otherwise it is empty
|
inline |
Replace current FunctionImpl with provided new one.
Referenced by madness::composite_product(), madness::composite_product(), madness::convert(), madness::copy(), madness::copy(), madness::gaxpy_oop_reconstructed(), madness::multi_to_multi_op_values(), madness::multiop_values(), madness::multiply(), madness::DerivativeBase< T, NDIM >::operator()(), madness::MacroTask< taskT >::MacroTaskInternal::pointer2WorldObject(), test_pointer_to_funcimpl(), test_Vphi_ij_u(), and madness::unary_op().
|
inline |
Sets the value of the truncation threshold. Optional global fence.
A fence is required to ensure consistent global state.
Referenced by madness::CCPotentials::apply_exchange_commutator(), madness::CCPotentials::apply_transformed_Ue(), madness::MP2::guess_mp1_3(), madness::NuclearCorrelationFactor::initialize(), madness::CCPotentials::make_constant_part_macrotask(), madness::PotentialManager::make_nuclear_potential(), and madness::MP2::make_Uphi0().
|
inline |
Sets the truncate_mode (-2,-1,0,1,2,3,4) on this Function's impl. No fence is issued — truncate_mode is a local per-impl integer with no global state.
|
inline |
Returns the number of coefficients in the function ... collective global sum.
Referenced by madness::hartree_product(), madness::Function< double, 3 >::load(), main(), run(), solve(), trotter(), trotter(), and trotter().
|
inline |
Return the number of coefficients in the function on this processor.
|
inline |
Inplace squaring of function ... global comm only if not reconstructed.
Returns *this for chaining.
Referenced by main(), and madness::square().
|
inline |
Converts the function standard compressed form. Possible non-blocking comm.
By default fence=true meaning that this operation completes before returning, otherwise if fence=false it returns without fencing and the user must invoke world.gop.fence() to assure global completion before using the function for other purposes.
Must be already compressed.
Referenced by madness::apply(), and madness::hartree_product().
|
inline |
Stores the function to an archive.
Archive can be sequential or parallel.
The & operator for serializing will only work with parallel archives.
| impl world gop madness::Function< T, NDIM >::sum | ( | local | ) |
| impl world gop madness::Function< T, NDIM >::sum | ( | local | ) |
|
inline |
Sums scaling coeffs down tree restoring state with coeffs only at leaves. Optional fence. Possible non-blocking comm.
Referenced by APPLY(), APPLY(), APPLY(), chin_chen(), test_apply_push_1d(), test_qm(), test_sum_down(), and trotter().
| madness::Function< T, NDIM >::TENSOR_RESULT_TYPE | ( | T | , |
| R | ) const |
Returns local part of dot product ... throws if both not compressed.
| madness::Function< T, NDIM >::TENSOR_RESULT_TYPE | ( | T | , |
| R | ) const |
Returns the inner product.
Not efficient for computing multiple inner products
| [in] | g | Function, optionally on-demand |
| madness::Function< T, NDIM >::TENSOR_RESULT_TYPE | ( | T | , |
| R | ) const |
Returns local part of inner product ... throws if both not compressed.
| madness::Function< T, NDIM >::TENSOR_RESULT_TYPE | ( | T | , |
| R | ) const |
Returns the inner product for one on-demand function.
It does work, but it might not give you the precision you expect. The assumption is that the function g returns proper sum coefficients on the MRA tree of this. This might not be the case if g is constructed with an implicit multiplication, e.g. result = <this|g>, with g = 1/r12 | gg>
| [in] | g | on-demand function |
| madness::Function< T, NDIM >::TENSOR_RESULT_TYPE | ( | T | , |
| R | ) |
| madness::Function< T, NDIM >::TENSOR_RESULT_TYPE | ( | T | , |
| R | ) |
|
inline |
Returns value of truncation threshold. No communication.
Referenced by dostuff(), madness::MP2::increment(), load_function(), main(), and test_Vphi_ij_u().
|
inline |
Returns global value of int(f(x),x) ... global comm required.
Works in any state whose coefficients trace_local() can sum; the remaining states are reconstructed first. For efficient use especially with many functions, reconstruct them all first and use trace_local instead, so you can perform a global sum on all at the same time.
Throws if the function is on-demand, and fences before reconstructing; see norm2() for both, including why the branch stays collective.
Referenced by madness::TDHF::analyze(), madness::Solver< T, NDIM >::apply_potential(), madness::DFT< T, NDIM >::calculate_tot_xc_energy(), madness::guessfactory::compute_centroid(), madness::OEP::compute_delta_rho(), madness::Solver< T, NDIM >::compute_rho_slow(), madness::XCOperator< T, NDIM >::compute_xc_energy(), MiniDFT::doit(), madness::Solver< T, NDIM >::initial_guess(), madness::SCF::initial_guess_ao_eigenvectors(), DF::iterate(), madness::Zcis::iterate(), main(), madness::SCF::make_dft_energy(), make_dft_energy(), DF::make_fermi_potential(), madness::Solver< T, NDIM >::make_nuclear_charge_density_impl(), moments(), SVPESolver::solve(), test_apply_push_1d(), test_gaussian_num_coeffs(), test_gconv(), test_he_potential(), test_hf_be(), test_hydro(), and test_nuclear_potential().
|
inline |
Returns local contribution to int(f(x),x) ... no communication.
In the wavelet basis this is just the coefficient of the first scaling function which is a constant. In the scaling function basis we must add up contributions from each box.
|
inline |
Returns the number of nodes in the function tree ... collective global sum.
Referenced by main(), solve(), test_conversion(), test_sum_down_files(), and test_Vphi_ij_u().
|
inline |
Truncate the function with optional fence. Compresses with fence if not compressed.
If the truncation threshold is less than or equal to zero the default value specified when the function was created is used. If the function is not initialized, it just returns.
Returns this for chaining.
| [in] | tol | Tolerance for truncating the coefficients. Default 0.0 means use the implementation's member value thresh instead. |
| [in] | fence | Do fence |
Referenced by DirichletCondIntOp::action(), RealFuncLinearOp::action(), madness::CCPotentials::apply_exchange_commutator(), madness::Solver< T, NDIM >::apply_hf_exchange3(), madness::Solver< T, NDIM >::apply_hf_exchange4(), madness::ExchangeCommutator::apply_KffK_6d(), madness::ExchangeCommutator::apply_KffK_lowrank_three_range(), madness::CCPotentials::apply_Kfxy(), apply_potential(), madness::SCF::apply_potential(), madness::NuclearCorrelationFactor::apply_U(), madness::PseudoNuclearCorrelationFactor::apply_U(), apply_U_ncf(), WSTFunctional::apply_xc(), madness::XCOperator< T, NDIM >::apply_xc_kernel(), applyexpLt(), applyN(), Calculation::calc_optimal_coeffs(), madness::HartreeFock< T, NDIM >::calculate_coulomb_energy(), chin_chen(), chin_chen(), chin_chen(), madness::Coulomb< T, NDIM >::compute_density(), madness::Znemo::compute_density(), madness::Zcis::compute_potentials(), madness::Diamagnetic_potential_factor::compute_R_times_T_commutator_scalar_term_numerically(), madness::EigSolver< T, NDIM >::compute_rho(), madness::Solver< T, NDIM >::compute_rho(), madness::Solver< T, NDIM >::compute_rho_slow(), madness::Znemo::compute_spin_density(), madness::Diamagnetic_potential_factor::compute_U2(), converge(), converge(), converge2s(), madness::CCPairFunction< T, NDIM >::convert_to_pure_no_op_inplace(), cplxfunc1(), cplxfunc2(), madness::SCF::do_plots(), doit(), madness::CCPotentials::fock_residue_6d(), madness::CCPotentials::fock_residue_6d_macrotask(), madness::MP2::guess_mp1_3(), madness::MP2::increment(), madness::SCF::initial_guess_ao_eigenvectors(), DF::iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate_excite(), iterate_excite(), iterate_ground(), iterate_ground(), madness::CC2::iterate_pair(), madness::CCPotentials::iterate_pair_macrotask(), iterate_xy(), iterate_xy(), madness::MP2::J(), madness::MP2::K(), main(), madness::CCPotentials::make_6D_pair(), madness::CCPotentials::make_constant_part_cispd_Qt(), madness::CCPotentials::make_constant_part_macrotask(), madness::SCF::make_density(), make_density(), madness::MP2::make_fKphi0(), madness::MP2::make_KffKphi0(), madness::CCPotentials::make_pair_gs(), Calculation::make_reference(), Calculation::make_Upsi(), madness::XCOperator< T, NDIM >::make_xc_potential_impl(), madness::MP2::multiply_with_0th_order_Hamiltonian(), madness::HartreeFockExchangeOp< T, NDIM >::op_o(), madness::StrongOrthogonalityProjector< T, NDIM >::operator()(), Calculation::project_potential_basis(), propagate(), q_c(), realfunc1(), realfunc2(), madness::XCOperator< T, NDIM >::set_tau(), madness::EigSolver< T, NDIM >::solve(), madness::SCF::solve(), SVPESolver::solve(), madness::MP2::solve_coupled_equations(), DF::solve_occupied(), madness::MP2::solve_residual_equations(), madness::SCF::solve_virtuals(), madness::CCPotentials::test(), test(), test_diagnose_GQKffK(), test_gconv(), test_he_potential(), test_hf_he(), test_hydro(), test_modified(), test_multiply(), test_XCOperator_matrix(), testbsh(), testPeriodicCoulomb3d(), trotter(), trotter(), trotter(), trotter(), and madness::NonlinearSolverND< 3 >::update().
|
inline |
This is replaced with left*right ... private.
Referenced by madness::imag(), madness::real(), and madness::unary_op_coeffs().
|
inline |
Inplace unary operation on function values.
|
inline |
Inplace unary operation on function values.
Referenced by madness::Solver< T, NDIM >::apply_potential(), madness::DFT< T, NDIM >::calculate_tot_xc_energy(), cplxfunc2(), main(), madness::smooth< T, NDIM >::make_explog(), madness::SCF::make_lda_potential(), madness::Solver< T, NDIM >::make_lda_potential(), make_potential(), SurfaceMoleculeInteraction::make_surfcharge(), multiply_by_V(), madness::smooth< T, NDIM >::munge_density(), madness::XCFunctionalLDA< T, NDIM >::op_r(), GygiPot::ratio_rho(), realfunc2(), residual(), GygiPot::rho_beta_one(), madness::smooth< T, NDIM >::smooth_density(), test_xc2(), and madness::Function< double, 3 >::unaryop().
|
inline |
Unary operation applied inplace to the coefficients.
Referenced by madness::Function< double, 3 >::conj().
|
inline |
Unary operation applied inplace to the nodes.
|
inline |
Asserts that the function is initialized.
Referenced by madness::Function< double, 3 >::add_scalar(), madness::Function< double, 3 >::broaden(), madness::Function< double, 3 >::chop_at_level(), madness::Function< double, 3 >::depthpt(), madness::Function< double, 3 >::distribute(), madness::Function< double, 3 >::err(), madness::Function< double, 3 >::errsq_local(), madness::Function< double, 3 >::eval(), madness::Function< double, 3 >::eval_cube(), madness::Function< double, 3 >::eval_local_only(), madness::Function< double, 3 >::eval_local_only(), madness::Function< double, 3 >::evaldepthpt(), madness::Function< double, 3 >::evalR(), madness::Function< double, 3 >::gaxpy(), madness::Function< double, 3 >::gaxpy_oop(), madness::Function< double, 3 >::get_impl(), madness::Function< double, 3 >::get_pmap(), madness::Function< double, 3 >::k(), madness::mul_sparse(), madness::Function< double, 3 >::norm2(), madness::Function< double, 3 >::norm2sq_local(), madness::Function< double, 3 >::norm_tree(), madness::Function< double, 3 >::operator()(), madness::Function< double, 3 >::project_out(), madness::Function< double, 3 >::reduce_rank(), madness::Function< double, 3 >::refine_general(), madness::Function< double, 3 >::replicate(), madness::Function< double, 3 >::replicate(), madness::Function< double, 3 >::replicate_on_hosts(), madness::Function< double, 3 >::scale(), madness::Function< double, 3 >::set_autorefine(), madness::Function< double, 3 >::set_thresh(), madness::Function< double, 3 >::set_truncate_mode(), madness::Function< double, 3 >::store(), madness::Function< double, 3 >::sum_down(), madness::Function< double, 3 >::truncate(), madness::Function< double, 3 >::unaryop(), madness::Function< double, 3 >::unaryop_coeff(), madness::Function< double, 3 >::unaryop_node(), and madness::Function< double, 3 >::world().
|
inline |
Verifies the tree data structure ... global sync implied.
Referenced by madness::Function< double, 3 >::abs(), madness::Function< double, 3 >::abs_square(), madness::Function< double, 3 >::add_scalar(), madness::apply(), madness::apply_1d_realspace_push(), madness::Function< double, 3 >::change_tree_state(), madness::Function< double, 3 >::check_symmetry(), madness::copy(), madness::Function< double, 3 >::err(), madness::Function< double, 3 >::gaxpy_oop(), iterate(), madness::Function< double, 3 >::multi_to_multi_op_values(), madness::Function< double, 3 >::multiop_values(), madness::Function< double, 3 >::norm2(), madness::Function< double, 3 >::norm_tree(), madness::operator+(), madness::Function< double, 3 >::operator+=(), madness::Function< double, 3 >::operator-=(), madness::Function< double, 3 >::scale(), madness::Function< double, 3 >::square(), madness::Function< double, 3 >::sum_down(), test_bsh(), test_coulomb(), test_op(), madness::Function< double, 3 >::trace(), madness::Function< double, 3 >::trace_local(), and madness::Function< double, 3 >::truncate().
|
inlinestatic |
Returns vector of FunctionImpl pointers corresponding to vector of functions.
Referenced by madness::Function< double, 3 >::vtransform().
|
inline |
Multiplication of function * vector of functions using recursive algorithm of mulxx.
|
inline |
sparse transformation of a vector of functions ... private
|
inline |
Returns the world.
Referenced by madness::apply(), madness::apply(), apply_potential(), madness::change_tree_state(), madness::Function< double, 3 >::check_symmetry(), chin_chen(), chin_chen(), madness::composite_inner(), madness::composite_inner(), madness::composite_product(), madness::composite_product(), madness::copy(), madness::Function< double, 3 >::dirac_convolution(), GygiPot::grad_rho(), madness::hartree_product(), madness::hartree_product(), madness::innerXX(), madness::Function< double, 3 >::multiop_values(), madness::multiply(), madness::XCOperator< T, NDIM >::prep_xc_args(), madness::XCOperator< T, NDIM >::prep_xc_args_response(), madness::project(), madness::Function< double, 3 >::project_out(), madness::Function< double, 3 >::set_impl(), test_copy_function_from_other_world(), madness::Function< double, 3 >::vmulXX(), and madness::CCPair::world().
|
friend |
implements swap algorithm
| bool madness::Function< T, NDIM >::compressed =is_compressed() and g.is_compressed() |
| NDIM &g madness::Function< T, NDIM >::const |
|
staticconstexpr |
| auto madness::Function< T, NDIM >::func =dynamic_cast<CompositeFunctorInterface<T,NDIM,LDIM>* >(g.get_impl()->get_functor().get()) |
|
private |
|
constexpr |
Referenced by madness::inner(), madness::inner(), madness::inner(), madness::innerXX(), madness::multiply(), and madness::swap_particles().
| return madness::Function< T, NDIM >::local |
| TreeState madness::Function< T, NDIM >::operating_state =get_impl()->get_tensor_type()==TT_FULL ? compressed : redundant |
Referenced by madness::operator+().
| bool madness::Function< T, NDIM >::redundant =is_redundant() and g.is_redundant() |