MADNESS  0.10.1
Public Member Functions | Private Types | Private Attributes | List of all members
madness::Projector< T, NDIM > Class Template Reference

simple projector class More...

#include <projector.h>

Inheritance diagram for madness::Projector< T, NDIM >:
Inheritance graph
[legend]
Collaboration diagram for madness::Projector< T, NDIM >:
Collaboration graph
[legend]

Public Member Functions

 Projector ()
 
 Projector (const funcT &bra, const funcT &ket)
 simple constructor with only one orbital to project More...
 
 Projector (const Function< T, NDIM > &mo)
 simple constructor with only one orbital to project More...
 
 Projector (const vecfuncT &bra, const vecfuncT &ket)
 constructor with a set of orbitals to project out More...
 
 Projector (const vecfuncT &p)
 constructor with a set of orbitals to project out More...
 
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 More...
 
template<typename argT >
std::enable_if<!std::is_same< argT, Function< T, 2 *NDIM > >::value, argT >::type operator() (const argT &argument) const
 
funcT operator() (const funcT &f) const
 project f on p: More...
 
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: More...
 
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, NDIMfuncT
 
typedef std::vector< funcTvecfuncT
 

Private Attributes

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

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) > More...
 

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

◆ 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

◆ 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, madness::Projector< T, NDIM >::mo_bra_, and madness::Projector< T, NDIM >::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, madness::Projector< T, NDIM >::mo_bra_, and madness::Projector< T, NDIM >::mo_ket_.

◆ 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, madness::Projector< T, NDIM >::mo_bra_, and madness::Projector< T, NDIM >::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

◆ get_ket_vector()

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

◆ 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, madness::Projector< T, NDIM >::mo_bra_, madness::Projector< T, NDIM >::mo_ket_, and madness::reconstruct().

Referenced by madness::Projector< T, NDIM >::operator()().

◆ operator()() [1/4]

template<typename T , std::size_t NDIM>
template<typename argT >
std::enable_if<!std::is_same<argT,Function<T,2*NDIM> >::value, argT>::type madness::Projector< T, NDIM >::operator() ( const argT &  argument) const
inline

References madness::apply().

◆ 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

◆ 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(), madness::Projector< T, NDIM >::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(), madness::Projector< T, NDIM >::mo_bra_, madness::Projector< T, NDIM >::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

◆ 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

Member Data Documentation

◆ mo_bra_

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

◆ mo_ket_

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

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