MADNESS 0.10.1
madness::Projector< T, NDIM > Class Template Reference

simple projector class More...

#include <projector.h>

Inheritance diagram for madness::Projector< T, NDIM >:
Collaboration diagram for madness::Projector< T, NDIM >:

Public Member Functions

 Projector ()
 Projector (const funcT &bra, const funcT &ket)
 simple constructor with only one orbital to project
 Projector (const Function< T, NDIM > &mo)
 simple constructor with only one orbital to project
 Projector (const vecfuncT &bra, const vecfuncT &ket)
 constructor with a set of orbitals to project out
 Projector (const vecfuncT &p)
 constructor with a set of orbitals to project out
vecfuncT get_bra_vector () const
vecfuncT get_ket_vector () const
std::pair< std::vector< Function< T, NDIM > >, std::vector< Function< T, NDIM > > > get_vectors_for_outer_product (const Function< T, 2 *NDIM > &f) const
 apply the projection parts of the operator on a function f
template<typename argT>
auto operator() (const argT &argument) const -> typename std::enable_if< !std::is_same< argT, Function< T, 2 *NDIM > >::value, decltype(madness::apply(std::declval< const Projector< T, NDIM > & >(), std::declval< const argT & >())) >::type
funcT operator() (const funcT &f) const
 project f on p:
template<std::size_t KDIM>
std::enable_if< KDIM==2 *NDIM, Function< T, KDIM > >::type operator() (const Function< T, KDIM > &f, int particle1=-1) const
vecfuncT operator() (const vecfuncT &f) const
 project f on p:
void set_spaces (const vecfuncT &bra, const vecfuncT &ket)
void set_spaces (const vecfuncT &p)
virtual std::string type () const override
Public Member Functions inherited from madness::ProjectorBase
virtual ~ProjectorBase ()
virtual int get_particle () const
virtual void set_particle (const int p)

Private Types

typedef Function< T, NDIM > funcT
typedef std::vector< funcT > vecfuncT

Private Attributes

std::vector< Function< T, NDIM > > mo_bra_
 the dual space onto which the test functions will be projected: <bra|
std::vector< Function< T, NDIM > > mo_ket_
 the space onto which the test functions will be projected: |ket>

Additional Inherited Members

Protected Attributes inherited from madness::ProjectorBase
int particle =-1
 a projector might work only on a subset of dimensions, e.g. P(1) | \psi(1,2) >

Detailed Description

template<typename T, std::size_t NDIM>
class madness::Projector< T, NDIM >

simple projector class

use this class to project a function or a set of functions on another space of function. The projector can handle different sets of functions for the bra and the ket space, e.g. in case of regularized orbitals: |f> <-> <f|R^2

Member Typedef Documentation

◆ funcT

template<typename T, std::size_t NDIM>
typedef Function<T,NDIM> madness::Projector< T, NDIM >::funcT
private

◆ vecfuncT

template<typename T, std::size_t NDIM>
typedef std::vector<funcT> madness::Projector< T, NDIM >::vecfuncT
private

Constructor & Destructor Documentation

◆ Projector() [1/5]

template<typename T, std::size_t NDIM>
madness::Projector< T, NDIM >::Projector ( )
inline

References mo_bra_, and mo_ket_.

Referenced by operator()().

◆ Projector() [2/5]

template<typename T, std::size_t NDIM>
madness::Projector< T, NDIM >::Projector ( const Function< T, NDIM > & mo)
inline

simple constructor with only one orbital to project

bra and ket spaces are symmetric

References mo_bra_, and mo_ket_.

◆ Projector() [3/5]

template<typename T, std::size_t NDIM>
madness::Projector< T, NDIM >::Projector ( const funcT & bra,
const funcT & ket )
inline

simple constructor with only one orbital to project

bra and ket spaces are not symmetric (e.g. |ket>^+ = <bra|R2 )

References MADNESS_CHECK_THROW, mo_bra_, and mo_ket_.

◆ Projector() [4/5]

template<typename T, std::size_t NDIM>
madness::Projector< T, NDIM >::Projector ( const vecfuncT & p)
inline

constructor with a set of orbitals to project out

bra and ket spaces are symmetric

References MADNESS_CHECK_THROW, mo_bra_, mo_ket_, and p().

◆ Projector() [5/5]

template<typename T, std::size_t NDIM>
madness::Projector< T, NDIM >::Projector ( const vecfuncT & bra,
const vecfuncT & ket )
inline

constructor with a set of orbitals to project out

bra and ket spaces are not symmetric (e.g. |ket>^+ = <bra|R2 )

References MADNESS_CHECK_THROW, mo_bra_, and mo_ket_.

Member Function Documentation

◆ get_bra_vector()

template<typename T, std::size_t NDIM>
vecfuncT madness::Projector< T, NDIM >::get_bra_vector ( ) const
inline

References mo_bra_.

◆ get_ket_vector()

template<typename T, std::size_t NDIM>
vecfuncT madness::Projector< T, NDIM >::get_ket_vector ( ) const
inline

References mo_ket_.

◆ get_vectors_for_outer_product()

template<typename T, std::size_t NDIM>
std::pair< std::vector< Function< T, NDIM > >, std::vector< Function< T, NDIM > > > madness::Projector< T, NDIM >::get_vectors_for_outer_product ( const Function< T, 2 *NDIM > & f) const
inline

apply the projection parts of the operator on a function f

The operator applied on f(1,2) is O(1)f(1,2) = \sum_i |i(1) > <i(1) | f(1,2)>_1 = \sum_i |i(1) f_i(2)> return the lo-dim vectors i and f_i only, perform no outer product

References madness::f, MADNESS_EXCEPTION, mo_bra_, mo_ket_, madness::ProjectorBase::particle, and madness::reconstruct().

Referenced by operator()().

◆ operator()() [1/4]

template<typename T, std::size_t NDIM>
template<typename argT>
auto madness::Projector< T, NDIM >::operator() ( const argT & argument) const->typenamestd::enable_if<!std::is_same< argT, Function< T, 2 *NDIM > >::value, decltype(madness::apply(std::declval< constProjector< T, NDIM > & >(), std::declval< constargT & >()))>::type
inline

apply this projector on argument, return type is whatever the implementation of apply returns. Most likely it will be argT or std::vector<argT>

References Projector(), madness::apply(), madness::Future< void >::value, and type().

◆ operator()() [2/4]

template<typename T, std::size_t NDIM>
funcT madness::Projector< T, NDIM >::operator() ( const funcT & f) const
inline

project f on p:

\‍[    | result > =  \sum_p | p > <p|f>
\‍]

Parameters
[in]fthe function to be projected
Returns
the projection of f on the space of p

References madness::f, and operator()().

Referenced by operator()().

◆ operator()() [3/4]

template<typename T, std::size_t NDIM>
template<std::size_t KDIM>
std::enable_if< KDIM==2 *NDIM, Function< T, KDIM > >::type madness::Projector< T, NDIM >::operator() ( const Function< T, KDIM > & f,
int particle1 = -1 ) const
inline

apply 3D Projector to one particle of a 6D function

\‍[|result> = \sum_p |p(particle)> <p(particle)|f(1,2)>_{particle}
\‍]

Parameters
[in]fthe 6D function to be projected
[in]theparticle that is projected (0 or 1)
Returns
the projected function

References madness::f, madness::ProjectorBase::get_particle(), get_vectors_for_outer_product(), madness::hartree_product(), and MADNESS_CHECK_THROW.

◆ operator()() [4/4]

template<typename T, std::size_t NDIM>
vecfuncT madness::Projector< T, NDIM >::operator() ( const vecfuncT & f) const
inline

project f on p:

\‍[    | result > =  \sum_p | p > <p|f>
\‍]

Parameters
[in]fthe vector of functions to be projected
Returns
the projection of f on the space of p

References madness::f, madness::matrix_inner(), mo_bra_, mo_ket_, madness::transform(), and madness::truncate().

◆ set_spaces() [1/2]

template<typename T, std::size_t NDIM>
void madness::Projector< T, NDIM >::set_spaces ( const vecfuncT & bra,
const vecfuncT & ket )
inline

References MADNESS_CHECK_THROW, mo_bra_, and mo_ket_.

◆ set_spaces() [2/2]

template<typename T, std::size_t NDIM>
void madness::Projector< T, NDIM >::set_spaces ( const vecfuncT & p)
inline

◆ type()

template<typename T, std::size_t NDIM>
virtual std::string madness::Projector< T, NDIM >::type ( ) const
inlineoverridevirtual

Implements madness::ProjectorBase.

Referenced by operator()().

Member Data Documentation

◆ mo_bra_

template<typename T, std::size_t NDIM>
std::vector<Function<T,NDIM> > madness::Projector< T, NDIM >::mo_bra_
private

the dual space onto which the test functions will be projected: <bra|

Referenced by Projector(), Projector(), Projector(), Projector(), Projector(), get_bra_vector(), get_vectors_for_outer_product(), operator()(), set_spaces(), and set_spaces().

◆ mo_ket_

template<typename T, std::size_t NDIM>
std::vector<Function<T,NDIM> > madness::Projector< T, NDIM >::mo_ket_
private

the space onto which the test functions will be projected: |ket>

Referenced by Projector(), Projector(), Projector(), Projector(), Projector(), get_ket_vector(), get_vectors_for_outer_product(), operator()(), set_spaces(), and set_spaces().


The documentation for this class was generated from the following file: