MADNESS 0.10.1
|
#include <localizer.h>
Public Member Functions | |
Localizer ()=default | |
Localizer (World &world, const AtomicBasisSet &aobasis, const Molecule &molecule, const std::vector< Function< double, 3 > > &ao) | |
template<typename T , std::size_t NDIM> | |
Tensor< T > | compute_core_valence_separation_transformation_matrix (World &world, const MolecularOrbitals< T, NDIM > &mo_in, const Tensor< T > &Fock) const |
localize orbitals while enforcing core-valence separation | |
template<typename T , std::size_t NDIM> | |
Tensor< T > | compute_localization_matrix (World &world, const MolecularOrbitals< T, NDIM > &mo_in, bool randomize) const |
AtomicBasisSet | get_aobasis () const |
std::string | get_method () |
template<typename T , std::size_t NDIM> | |
MolecularOrbitals< T, NDIM > | localize (const MolecularOrbitals< T, NDIM > &mo_in, bool randomize) const |
localize the orbitals | |
template<typename T , std::size_t NDIM> | |
MolecularOrbitals< T, NDIM > | localize (const MolecularOrbitals< T, NDIM > &mo_in, const Tensor< T > &Fock, bool randomize) const |
localize the orbitals, possibly enforce core-valence separation | |
void | print_info () const |
template<typename T , std::size_t NDIM> | |
MolecularOrbitals< T, NDIM > | separate_core_valence (const MolecularOrbitals< T, NDIM > &mo_in, const Tensor< T > &Fock) const |
Localizer & | set_enforce_core_valence_separation (const bool value) |
Localizer & | set_method (const std::string method1) |
Localizer & | set_metric (const Function< double, 3 > &R) |
Static Public Member Functions | |
template<typename T > | |
static bool | check_core_valence_separation (const Tensor< T > &Fock, const std::vector< int > &localized_set, const bool silent=false) |
static bool | check_frozen_consistency (const long nfrozen, const std::vector< int > &localize_sets) |
template<typename T > | |
static std::size_t | determine_frozen_orbitals (const Tensor< T > fmat) |
static std::vector< Slice > | find_degenerate_blocks (const Tensor< double > &eval, const double thresh_degenerate) |
find sets of degenerate states/orbitals | |
template<typename T > | |
static void | undo_degenerate_rotations (Tensor< T > &U, const Tensor< double > &eval, const double thresh_degenerate) |
given a unitary transformation matrix undo rotations between degenerate columns | |
template<typename T > | |
static void | undo_reordering (Tensor< T > &U, const Tensor< double > &occ) |
given a unitary transformation matrix undo mere reordering | |
template<typename T > | |
static void | undo_reordering (Tensor< T > &U, const Tensor< double > &occ, Tensor< double > &eval) |
given a unitary transformation matrix undo mere reordering | |
template<typename T > | |
static Tensor< T > | undo_rotation (const Tensor< T > &U_in, const std::vector< Slice > &blocks) |
given a unitary transformation matrix undo the rotations within the blocks | |
template<typename T > | |
static void | undo_rotations_within_sets (Tensor< T > &U, const std::vector< int > &localized_set) |
given a unitary transformation matrix undo rotations within blocks of localized orbitals | |
Private Member Functions | |
template<typename T > | |
double | DIP (const Tensor< T > &dip, int i, int j, int k, int l) const |
template<typename T , std::size_t NDIM> | |
DistributedMatrix< T > | localize_boys (World &world, const std::vector< Function< T, NDIM > > &mo, const std::vector< int > &set, const double thresh=1e-9, const bool randomize=true, const bool doprint=false) const |
template<typename T , std::size_t NDIM> | |
DistributedMatrix< T > | localize_new (World &world, const std::vector< Function< T, NDIM > > &mo, const std::vector< int > &set, const double thresh=1e-9, const bool randomize=true, const bool doprint=false) const |
template<typename T , std::size_t NDIM> | |
DistributedMatrix< T > | localize_PM (World &world, const std::vector< Function< T, NDIM > > &mo, const std::vector< int > &set, const double thresh=1e-9, const bool randomize=true, const bool doprint=false) const |
template<typename T > | |
Tensor< T > | matrix_exponential (const Tensor< T > &A) const |
Private Attributes | |
std::vector< Function< double, 3 > > | ao |
AtomicBasisSet | aobasis |
map atoms to basis functions in the "new" algorithm | |
std::vector< int > | at_nbf |
std::vector< int > | at_to_bf |
bool | enforce_core_valence_separation =false |
when are orbitals degenerate | |
std::string | method ="new" |
no rotations between core and valence orbitals (distinguished by 'set') | |
Function< double, 3 > | metric |
Molecule | molecule |
double | thetamax =0.1 |
=R for computing matrix elements of operators | |
double | thresh_degenerate |
const double | tolloc = 1e-6 |
maximum rotation(?) | |
|
default |
madness::Localizer::Localizer | ( | World & | world, |
const AtomicBasisSet & | aobasis, | ||
const Molecule & | molecule, | ||
const std::vector< Function< double, 3 > > & | ao | ||
) |
|
static |
References madness::MolecularOrbitals< T, NDIM >::convert_set_to_slice(), madness::copy(), madness::error(), and madness::print().
Referenced by madness::MP2::check_core_valence_separation(), madness::CC2::check_core_valence_separation(), compute_core_valence_separation_transformation_matrix(), madness::MP2::enforce_core_valence_separation(), madness::CC2::enforce_core_valence_separation(), madness::TDHF::enforce_core_valence_separation(), and test_ethylene().
|
static |
References madness::MolecularOrbitals< T, NDIM >::convert_set_to_slice().
Referenced by determine_frozen_orbitals().
Tensor< T > madness::Localizer::compute_core_valence_separation_transformation_matrix | ( | World & | world, |
const MolecularOrbitals< T, NDIM > & | mo_in, | ||
const Tensor< T > & | Fock | ||
) | const |
localize orbitals while enforcing core-valence separation
[in] | World | the world |
[in] | mo_in | the input orbitals |
[in] | Fock | the Fock matrix for canonicalizing the orbitals first |
[in] | method | the localization method |
[in] | tolloc | localization tolerance |
[in] | randomize | initially randomize the localization procedure |
References madness::WorldGopInterface::broadcast(), check_core_valence_separation(), madness::copy(), madness::f, madness::MolecularOrbitals< T, NDIM >::get_localize_sets(), madness::World::gop, madness::inner(), madness::jacobi(), MADNESS_CHECK, madness::print(), madness::Tensor< T >::ptr(), madness::BaseTensor::size(), and madness::transpose().
Referenced by localize(), and separate_core_valence().
Tensor< T > madness::Localizer::compute_localization_matrix | ( | World & | world, |
const MolecularOrbitals< T, NDIM > & | mo_in, | ||
bool | randomize | ||
) | const |
References madness::DistributedMatrix< T >::copy_to_replicated(), madness::MolecularOrbitals< T, NDIM >::get_localize_sets(), madness::MolecularOrbitals< T, NDIM >::get_mos(), madness::Function< T, NDIM >::is_initialized(), localize_boys(), localize_new(), localize_PM(), MADNESS_EXCEPTION, method, metric, madness::print(), psi(), and tolloc.
Referenced by localize(), madness::Nemo::localize(), and madness::SCF::solve().
|
static |
References check_frozen_consistency(), madness::MolecularOrbitals< T, NDIM >::convert_set_to_slice(), madness::MolecularOrbitals< T, NDIM >::get_localize_sets(), madness::MolecularOrbitals< T, NDIM >::get_mos(), MADNESS_CHECK, MADNESS_EXCEPTION, madness::BaseTensor::ndim(), madness::MolecularOrbitals< T, NDIM >::pretty_print(), madness::print(), madness::real(), madness::MolecularOrbitals< T, NDIM >::recompute_localize_sets(), madness::BaseTensor::size(), madness::syev(), and madness::vec().
Referenced by madness::TDHF::prepare_calculation(), and madness::CC2::solve().
|
inlineprivate |
References k.
Referenced by localize_boys().
|
static |
find sets of degenerate states/orbitals
References madness::BaseTensor::size(), and thresh_degenerate.
Referenced by undo_degenerate_rotations().
|
inline |
References aobasis.
|
inline |
References method.
MolecularOrbitals< T, NDIM > madness::Localizer::localize | ( | const MolecularOrbitals< T, NDIM > & | mo_in, |
bool | randomize | ||
) | const |
localize the orbitals
References localize().
Referenced by madness::MP2::enforce_core_valence_separation(), madness::CC2::enforce_core_valence_separation(), localize(), test_ethylene(), and test_ne_boys().
MolecularOrbitals< T, NDIM > madness::Localizer::localize | ( | const MolecularOrbitals< T, NDIM > & | mo_in, |
const Tensor< T > & | Fock, | ||
bool | randomize | ||
) | const |
localize the orbitals, possibly enforce core-valence separation
References compute_core_valence_separation_transformation_matrix(), compute_localization_matrix(), madness::MolecularOrbitals< T, NDIM >::convert_set_to_slice(), madness::BaseTensor::dim(), enforce_core_valence_separation, madness::MolecularOrbitals< T, NDIM >::get_localize_sets(), madness::MolecularOrbitals< T, NDIM >::get_mos(), madness::MolecularOrbitals< T, NDIM >::get_subset(), madness::Tensor< T >::has_data(), madness::inner(), MADNESS_CHECK, madness::MolecularOrbitals< T, NDIM >::set_all_orbitals_occupied(), madness::transform(), madness::transpose(), madness::truncate(), and madness::MolecularOrbitals< T, NDIM >::update_mos().
|
private |
References madness::_(), axis, madness::WorldGopInterface::broadcast(), madness::copy(), madness::DistributedMatrix< T >::copy_from_replicated(), madness::default_random_generator, DIP(), e(), f1, madness::g, madness::Tensor< T >::gaxpy(), madness::World::gop, madness::inner(), matrix_exponential(), madness::matrix_inner(), mu, madness::mul_sparse(), N, madness::print(), madness::Tensor< T >::ptr(), madness::RandomValue< double >(), madness::World::rank(), madness::Tensor< T >::scale(), madness::Random::setstate(), madness::BaseTensor::size(), thresh, madness::Tensor< T >::trace(), and madness::transpose().
Referenced by compute_localization_matrix().
|
private |
References madness::_(), a, ao, aobasis, at_nbf, at_to_bf, madness::WorldGopInterface::broadcast(), madness::copy(), madness::DistributedMatrix< T >::copy_from_replicated(), madness::default_random_generator, madness::BaseTensor::dim(), f1, madness::g, madness::Tensor< T >::gaxpy(), madness::Molecule::get_atomic_number(), madness::AtomicBasisSet::get_avec(), madness::World::gop, madness::inner(), lo, MADNESS_ASSERT, matrix_exponential(), madness::matrix_inner(), molecule, mu, N, madness::Molecule::natom(), madness::print(), madness::Tensor< T >::ptr(), Q(), madness::RandomValue< double >(), madness::World::rank(), madness::Tensor< T >::scale(), madness::Random::setstate(), madness::AtomicBasisSet::shells_to_bfn(), madness::BaseTensor::size(), thresh, madness::Tensor< T >::trace(), and madness::transpose().
Referenced by compute_localization_matrix().
|
private |
References ao, at_nbf, at_to_bf, madness::distributed_localize_PM(), thetamax, and thresh.
Referenced by compute_localization_matrix().
|
private |
References std::abs(), madness::Tensor< T >::fillrandom(), I, madness::inner(), MADNESS_CHECK, madness::Tensor< T >::normf(), madness::Tensor< T >::scale(), madness::scale(), and madness::Tensor< T >::trace().
Referenced by localize_boys(), and localize_new().
|
inline |
References aobasis, enforce_core_valence_separation, madness::AtomicBasisSet::get_name(), madness::Function< T, NDIM >::is_initialized(), method, metric, madness::print(), and thresh_degenerate.
Referenced by test_ethylene(), and test_ne_boys().
template MolecularOrbitals< double, 3 > madness::Localizer::separate_core_valence | ( | const MolecularOrbitals< T, NDIM > & | mo_in, |
const Tensor< T > & | Fock | ||
) | const |
References compute_core_valence_separation_transformation_matrix(), madness::MolecularOrbitals< T, NDIM >::get_localize_sets(), madness::MolecularOrbitals< T, NDIM >::get_mos(), madness::inner(), madness::MolecularOrbitals< T, NDIM >::set_all_orbitals_occupied(), madness::BaseTensor::size(), and madness::transform().
Referenced by madness::TDHF::enforce_core_valence_separation().
|
inline |
|
inline |
|
static |
given a unitary transformation matrix undo rotations between degenerate columns
References madness::BaseTensor::dim(), find_degenerate_blocks(), MADNESS_CHECK, madness::BaseTensor::size(), thresh_degenerate, and undo_rotation().
Referenced by get_fock_transformation(), madness::SCF::get_fock_transformation(), and madness::TDHF::make_guess_from_initial_diagonalization().
|
inlinestatic |
given a unitary transformation matrix undo mere reordering
References madness::BaseTensor::dim(), and undo_reordering().
Referenced by get_fock_transformation(), madness::SCF::get_fock_transformation(), and undo_reordering().
|
static |
given a unitary transformation matrix undo mere reordering
References madness::_(), std::abs(), madness::conditional_conj(), madness::copy(), madness::BaseTensor::dim(), and madness::Tensor< T >::scale().
|
static |
given a unitary transformation matrix undo the rotations within the blocks
References madness::_(), madness::copy(), madness::inner(), q(), sigma, madness::svd(), and madness::transpose().
Referenced by undo_degenerate_rotations(), and undo_rotations_within_sets().
|
static |
given a unitary transformation matrix undo rotations within blocks of localized orbitals
References madness::MolecularOrbitals< T, NDIM >::convert_set_to_slice(), and undo_rotation().
|
private |
Referenced by localize_new(), and localize_PM().
|
private |
map atoms to basis functions in the "new" algorithm
Referenced by Localizer(), get_aobasis(), localize_new(), and print_info().
|
private |
Referenced by Localizer(), localize_new(), and localize_PM().
|
private |
Referenced by Localizer(), localize_new(), and localize_PM().
|
private |
when are orbitals degenerate
Referenced by localize(), print_info(), and set_enforce_core_valence_separation().
|
private |
no rotations between core and valence orbitals (distinguished by 'set')
Referenced by compute_localization_matrix(), get_method(), print_info(), and set_method().
|
private |
Referenced by compute_localization_matrix(), print_info(), and set_metric().
|
private |
Referenced by Localizer(), and localize_new().
|
private |
=R for computing matrix elements of operators
Referenced by localize_PM().
|
private |
Referenced by Localizer(), find_degenerate_blocks(), print_info(), and undo_degenerate_rotations().
|
private |
maximum rotation(?)
Referenced by compute_localization_matrix().