MADNESS 0.10.1
madness::projector_irrep Class Reference

#include <pointgroupsymmetry.h>

Collaboration diagram for madness::projector_irrep:

Public Member Functions

 projector_irrep ()=default
 default ctor
 projector_irrep (std::string pointgroup, std::string irrep="all")
 ctor takes the point group and the optionally the irrep
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > create_symmetry_adapted_basis (const Function< T, NDIM > &rhs, const Function< typename Tensor< T >::scalar_type, NDIM > &metric, std::vector< std::string > &sirreps)
 create a symmetry-adapted basis from a single function
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > create_symmetry_adapted_basis (const Function< T, NDIM > &rhs, std::vector< std::string > &sirreps)
 create a symmetry-adapted basis from a single function
std::vector< std::string > get_all_irreps () const
std::vector< int > get_canonical_to_irrep_map (std::vector< std::string > sirreps) const
 get a mapping canonical to irrep-sorting
bool get_orthonormalize_irreps () const
 get the verbosity level
std::string get_pointgroup () const
 get the point group name
charactertable get_table () const
 return the character table
int get_verbosity () const
 get the verbosity level
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > operator() (const Function< T, NDIM > &rhs) const
 projector on a given irrep
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > operator() (const std::vector< Function< T, NDIM > > &vrhs) const
 projector on a given irrep
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > operator() (const std::vector< Function< T, NDIM > > &vrhs, const Function< typename Tensor< T >::scalar_type, NDIM > &metric) const
 projector on a given irrep
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > operator() (const std::vector< Function< T, NDIM > > &vrhs, const Function< typename Tensor< T >::scalar_type, NDIM > &metric, std::vector< std::string > &sirreps) const
 projector on a given irrep
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > operator() (const std::vector< Function< T, NDIM > > &vrhs, std::vector< std::string > &sirreps) const
 projector on a given irrep
void print_character_table () const
 print the character table
void print_info (World &world) const
 print the parameters of this projector
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > project_on_irreps (const std::vector< Function< T, NDIM > > &vhrs, const std::vector< std::string > &irreps) const
 (re-)project the argument on the given irreps
std::vector< std::string > reduce (const std::string irrep1, const std::string irrep2) const
 reduce a product of two irreps
std::vector< std::string > reduce (const std::string irrep1, const std::string irrep2, const std::string irrep3) const
 reduce a product of three irreps
std::vector< std::string > reduce (const std::string irrep1, const std::string irrep2, const std::string irrep3, const std::string irrep4) const
 reduce a product of four irreps
std::vector< std::string > reduce (const std::vector< std::string > reps) const
 reduce a reducible representation
projector_irrep & set_irrep (std::string irrep)
 set the irrep on which this projector projects
projector_irrep & set_lindep (const double ld)
 set the linear dependency threshold
projector_irrep & set_ordering (const std::string o)
 set the ordering after symmetrization: irreps or keep as is
projector_irrep & set_orthonormalize_irreps (bool flag)
 get the verbosity level
projector_irrep & set_verbosity (int v)
 set the verbosity level

Static Public Member Functions

template<typename R>
static std::vector< R > resort (const std::vector< int > map, const std::vector< R > &vrhs)
 given a mapping resort
template<typename R>
static std::vector< R > reverse_resort (const std::vector< int > map, const std::vector< R > &vrhs)
 given a mapping resort

Private Member Functions

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > apply_symmetry_operators (const std::vector< Function< T, NDIM > > &vrhs, Function< typename Tensor< T >::scalar_type, NDIM > metric, std::vector< std::string > &sirreps) const
 symmetrize a vector of functions
const charactertable get_table (std::string pointgroup)
 return the character table according to the requested point group
charactertable make_c1_table () const
charactertable make_c2_table () const
charactertable make_c2h_table () const
charactertable make_c2v_table () const
charactertable make_ci_table () const
charactertable make_cs_table () const
charactertable make_d2_table () const
charactertable make_d2h_table () const
template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > sort_to_irreps (std::vector< Function< T, NDIM > > &vrhs, std::vector< std::string > &sirreps) const
 sort the functions according to their irreps

Private Attributes

std::string irrep_ ="all"
 choose one of the irreps or "all"
bool keep_ordering_ =true
 after projection: result functions being ordered according to irreps or ordering unchanged
double lindep_ =1.e-3
 linear dependency threshold for the orthogonalization
bool orthonormalize_irreps_ =true
 orthonormalize within the irreps or simply discard linear dependent vectors
charactertable table_
int verbosity_ =1
 verbosity level

Constructor & Destructor Documentation

◆ projector_irrep() [1/2]

madness::projector_irrep::projector_irrep ( )
default

◆ projector_irrep() [2/2]

madness::projector_irrep::projector_irrep ( std::string pointgroup,
std::string irrep = "all" )
inline

ctor takes the point group and the optionally the irrep

References get_table(), keep_ordering_, lindep_, set_irrep(), table_, and verbosity_.

Member Function Documentation

◆ apply_symmetry_operators()

template<typename T, std::size_t NDIM>
template std::vector< Function< double_complex, 3 > > madness::projector_irrep::apply_symmetry_operators ( const std::vector< Function< T, NDIM > > & vrhs,
Function< typename Tensor< T >::scalar_type, NDIM > metric,
std::vector< std::string > & sirreps ) const
private

symmetrize a vector of functions

project a number of functions on a given number of irreps linear dependencies are removed, the functions are orthonormalized vanishing input functions are mapped onto vanishing output functions with irrep "null" the number of input and output function is expected to be the same!

Parameters
[in]vrhsvector of functions to be projected on the irrep
[in]vbrabra of vrhs if applicable (if bra /= ket), may be empty
[out]sirrepvector with the irrep names corresponding to the result

References madness::_(), madness::Tensor< T >::absmax(), madness::change_tree_state(), madness::compressed, madness::copy(), madness::BaseTensor::dim(), madness::WorldGopInterface::fence(), madness::gaxpy(), madness::World::gop, madness::imag(), madness::inner(), madness::inverse(), irrep_, keep_ordering_, lindep_, MADNESS_ASSERT, MADNESS_CHECK, MADNESS_EXCEPTION, madness::matrix_inner(), NDIM, madness::Tensor< T >::normf(), orthonormalize_irreps_, madness::print(), madness::real(), madness::rr_cholesky(), madness::World::size(), sort_to_irreps(), madness::Tensor< T >::sum(), madness::syev(), table_, madness::transform(), madness::truncate(), v, verbosity_, madness::zero_functions(), and madness::zero_functions_compressed().

Referenced by create_symmetry_adapted_basis(), create_symmetry_adapted_basis(), operator()(), operator()(), operator()(), and operator()().

◆ create_symmetry_adapted_basis() [1/2]

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > madness::projector_irrep::create_symmetry_adapted_basis ( const Function< T, NDIM > & rhs,
const Function< typename Tensor< T >::scalar_type, NDIM > & metric,
std::vector< std::string > & sirreps )
inline

create a symmetry-adapted basis from a single function

Returns
a vector[irreps] of a vector of functions

References apply_symmetry_operators(), and NDIM.

Referenced by test_orthogonalization().

◆ create_symmetry_adapted_basis() [2/2]

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > madness::projector_irrep::create_symmetry_adapted_basis ( const Function< T, NDIM > & rhs,
std::vector< std::string > & sirreps )
inline

create a symmetry-adapted basis from a single function

Returns
a vector[irreps] of a vector of functions

References apply_symmetry_operators(), and NDIM.

◆ get_all_irreps()

std::vector< std::string > madness::projector_irrep::get_all_irreps ( ) const
inline

References table_.

Referenced by reduce(), and test_projector().

◆ get_canonical_to_irrep_map()

std::vector< int > madness::projector_irrep::get_canonical_to_irrep_map ( std::vector< std::string > sirreps) const
inline

get a mapping canonical to irrep-sorting

References madness::GaussianConvolution1DCache< double >::map, m, and table_.

Referenced by sort_to_irreps().

◆ get_orthonormalize_irreps()

bool madness::projector_irrep::get_orthonormalize_irreps ( ) const
inline

get the verbosity level

References orthonormalize_irreps_.

◆ get_pointgroup()

std::string madness::projector_irrep::get_pointgroup ( ) const
inline

get the point group name

References table_.

◆ get_table() [1/2]

charactertable madness::projector_irrep::get_table ( ) const
inline

return the character table

References table_.

Referenced by projector_irrep(), madness::TDHF::check_consistency(), test_orthogonalization(), and test_projector().

◆ get_table() [2/2]

const charactertable madness::projector_irrep::get_table ( std::string pointgroup)
inlineprivate

return the character table according to the requested point group

References MADNESS_EXCEPTION, make_c1_table(), make_c2_table(), make_c2h_table(), make_c2v_table(), make_ci_table(), make_cs_table(), make_d2_table(), and make_d2h_table().

◆ get_verbosity()

int madness::projector_irrep::get_verbosity ( ) const
inline

get the verbosity level

References verbosity_.

◆ make_c1_table()

◆ make_c2_table()

◆ make_c2h_table()

◆ make_c2v_table()

◆ make_ci_table()

◆ make_cs_table()

◆ make_d2_table()

◆ make_d2h_table()

◆ operator()() [1/5]

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > madness::projector_irrep::operator() ( const Function< T, NDIM > & rhs) const
inline

projector on a given irrep

Returns
a vector[irreps] of a vector of functions

References operator()().

Referenced by operator()().

◆ operator()() [2/5]

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > madness::projector_irrep::operator() ( const std::vector< Function< T, NDIM > > & vrhs) const
inline

projector on a given irrep

Returns
a vector[irreps] of a vector of functions

References apply_symmetry_operators(), and NDIM.

◆ operator()() [3/5]

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > madness::projector_irrep::operator() ( const std::vector< Function< T, NDIM > > & vrhs,
const Function< typename Tensor< T >::scalar_type, NDIM > & metric ) const
inline

projector on a given irrep

Returns
a vector[irreps] of a vector of functions

References apply_symmetry_operators(), and NDIM.

◆ operator()() [4/5]

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > madness::projector_irrep::operator() ( const std::vector< Function< T, NDIM > > & vrhs,
const Function< typename Tensor< T >::scalar_type, NDIM > & metric,
std::vector< std::string > & sirreps ) const
inline

projector on a given irrep

Returns
a vector[irreps] of a vector of functions

References apply_symmetry_operators(), and NDIM.

◆ operator()() [5/5]

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > madness::projector_irrep::operator() ( const std::vector< Function< T, NDIM > > & vrhs,
std::vector< std::string > & sirreps ) const
inline

projector on a given irrep

Returns
a vector[irreps] of a vector of functions

References apply_symmetry_operators(), and NDIM.

◆ print_character_table()

void madness::projector_irrep::print_character_table ( ) const
inline

print the character table

References op(), madness::print(), and table_.

Referenced by print_info(), and reduce().

◆ print_info()

void madness::projector_irrep::print_info ( World & world) const
inline

◆ project_on_irreps()

template<typename T, std::size_t NDIM>
template std::vector< Function< double, 3 > > madness::projector_irrep::project_on_irreps ( const std::vector< Function< T, NDIM > > & vhrs,
const std::vector< std::string > & irreps ) const

(re-)project the argument on the given irreps

Parameters
[in]vrhsthe vector of functions to be projected on the irreps given by irreps
[in]irrepsthe irreps in order of the functions
Returns
vrhs projected on the irreps

References madness::compress(), madness::copy(), madness::WorldGopInterface::fence(), madness::World::gop, madness::World::size(), table_, madness::truncate(), and madness::zero_functions_compressed().

◆ reduce() [1/4]

std::vector< std::string > madness::projector_irrep::reduce ( const std::string irrep1,
const std::string irrep2 ) const
inline

reduce a product of two irreps

References reduce(), and madness::vector_factory().

◆ reduce() [2/4]

std::vector< std::string > madness::projector_irrep::reduce ( const std::string irrep1,
const std::string irrep2,
const std::string irrep3 ) const
inline

reduce a product of three irreps

References reduce(), and madness::vector_factory().

◆ reduce() [3/4]

std::vector< std::string > madness::projector_irrep::reduce ( const std::string irrep1,
const std::string irrep2,
const std::string irrep3,
const std::string irrep4 ) const
inline

reduce a product of four irreps

References reduce(), and madness::vector_factory().

◆ reduce() [4/4]

std::vector< std::string > madness::projector_irrep::reduce ( const std::vector< std::string > reps) const

reduce a reducible representation

Parameters
[in]repsvector or irrep or reduc. reps whose product will be reduced
Returns
vector of irreps constituting the input product

References get_all_irreps(), MADNESS_ASSERT, MADNESS_EXCEPTION, madness::print(), print_character_table(), and table_.

Referenced by madness::TDHF::make_guess_from_initial_diagonalization(), reduce(), reduce(), and reduce().

◆ resort()

template<typename R>
std::vector< R > madness::projector_irrep::resort ( const std::vector< int > map,
const std::vector< R > & vrhs )
inlinestatic

given a mapping resort

References madness::GaussianConvolution1DCache< double >::map, and MADNESS_ASSERT.

Referenced by sort_to_irreps().

◆ reverse_resort()

template<typename R>
std::vector< R > madness::projector_irrep::reverse_resort ( const std::vector< int > map,
const std::vector< R > & vrhs )
inlinestatic

given a mapping resort

References madness::GaussianConvolution1DCache< double >::map, and MADNESS_ASSERT.

◆ set_irrep()

projector_irrep & madness::projector_irrep::set_irrep ( std::string irrep)
inline

set the irrep on which this projector projects

References projector_irrep(), irrep_, MADNESS_EXCEPTION, madness::print(), and table_.

Referenced by projector_irrep(), and test_projector().

◆ set_lindep()

projector_irrep & madness::projector_irrep::set_lindep ( const double ld)
inline

set the linear dependency threshold

References projector_irrep(), and lindep_.

Referenced by madness::TDHF::make_guess_from_initial_diagonalization().

◆ set_ordering()

projector_irrep & madness::projector_irrep::set_ordering ( const std::string o)
inline

◆ set_orthonormalize_irreps()

projector_irrep & madness::projector_irrep::set_orthonormalize_irreps ( bool flag)
inline

◆ set_verbosity()

◆ sort_to_irreps()

template<typename T, std::size_t NDIM>
std::vector< Function< T, NDIM > > madness::projector_irrep::sort_to_irreps ( std::vector< Function< T, NDIM > > & vrhs,
std::vector< std::string > & sirreps ) const
inlineprivate

sort the functions according to their irreps

References madness::GaussianConvolution1DCache< double >::map, get_canonical_to_irrep_map(), and resort().

Referenced by apply_symmetry_operators().

Member Data Documentation

◆ irrep_

std::string madness::projector_irrep::irrep_ ="all"
private

choose one of the irreps or "all"

Referenced by apply_symmetry_operators(), print_info(), and set_irrep().

◆ keep_ordering_

bool madness::projector_irrep::keep_ordering_ =true
private

after projection: result functions being ordered according to irreps or ordering unchanged

Referenced by projector_irrep(), apply_symmetry_operators(), print_info(), and set_ordering().

◆ lindep_

double madness::projector_irrep::lindep_ =1.e-3
private

linear dependency threshold for the orthogonalization

Referenced by projector_irrep(), apply_symmetry_operators(), print_info(), and set_lindep().

◆ orthonormalize_irreps_

bool madness::projector_irrep::orthonormalize_irreps_ =true
private

orthonormalize within the irreps or simply discard linear dependent vectors

Referenced by apply_symmetry_operators(), get_orthonormalize_irreps(), print_info(), and set_orthonormalize_irreps().

◆ table_

◆ verbosity_

int madness::projector_irrep::verbosity_ =1
private

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