|
MADNESS 0.10.1
|
A simple example of projecting and using MADNESS functions. More...

Functions | |
| double | gaussian (const coord_3d &r) |
| C++ function for projecting the Gaussian test function. | |
| int | main (int argc, char **argv) |
| Main function. Project the function and compute the integrals. | |
A simple example of projecting and using MADNESS functions.
This example projects a simple Gaussian function,
![\[ g(\vec{x}) = e^{-|\vec{x}|^2}, \]](form_171.png)
into the MADNESS adaptive basis and computes several integrals:
![\[
\int \mathrm{d}^3 \vec{x} \; g(\vec{x}) = \pi^{3/2} \doteq 5.5683279,
\]](form_172.png)
![\[
\left( \int \mathrm{d}^3 \vec{x} \; g(\vec{x})^2 \right)^{1/2} = (\pi/2)^{3/4} \doteq 1.403104,
\]](form_173.png)
![\[
\int \mathrm{d}^3 \vec{x} \; g(\vec{x}) \int \mathrm{d}^3 \vec{y} \; |\vec{x}-\vec{y}|^{-1} g(\vec{y}) = \pi^{5/2} 2^{1/2} \doteq 24.739429.
\]](form_174.png)
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Main function. Project the function and compute the integrals.
| [in] | argc | The number of command-line arguments. |
| [in] | argv | The command-line arguments. |
References SafeMPI::COMM_WORLD, madness::CoulombOperator(), e(), madness::finalize(), madness::g, madness::initialize(), madness::inner(), op(), madness::print(), madness::FunctionDefaults< NDIM >::set_cubic_cell(), madness::startup(), and madness::Function< T, NDIM >::truncate().