|
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) |
| Localizer & | set_pivot_state (std::vector< long > *state) |
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_cholesky (World &world, const std::vector< Function< T, NDIM > > &mo, const std::vector< int > &set) const |
| Cholesky localization: deterministic and non-iterative. | |
| 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_new_systolic (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 |
| the "new" objective optimized with distributed systolic Jacobi sweeps (localize=new_sys) | |
| 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 |
| template<typename T , std::size_t NDIM> | |
| void | prepare_new_basis (World &world, const std::vector< Function< T, NDIM > > &mo, Tensor< T > &C, std::vector< int > &at_to_bf, std::vector< int > &at_nbf) const |
| build the "new" method's orthonormal atomic-eigenfunction basis and localization blocks | |
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 |
| std::vector< long > * | pivot_state = nullptr |
| localization method | |
| 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(), madness::WorldGopInterface::fence(), madness::World::get_default(), madness::World::gop, madness::nonlinear_vector_solver(), madness::print(), madness::World::rank(), and madness::World::size().
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(), and madness::nonlinear_vector_solver().
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::WorldGopInterface::fence(), madness::World::gop, madness::inner(), madness::jacobi(), MADNESS_CHECK, madness::nonlinear_vector_solver(), madness::print(), madness::Tensor< T >::ptr(), madness::World::rank(), madness::BaseTensor::size(), madness::World::size(), and madness::transpose().
Referenced by localize(), and separate_core_valence().
|
static |
References check_frozen_consistency(), madness::MolecularOrbitals< T, NDIM >::convert_set_to_slice(), MADNESS_CHECK, MADNESS_EXCEPTION, madness::nonlinear_vector_solver(), madness::print(), madness::real(), madness::BaseTensor::size(), madness::syev(), and madness::vec().
Referenced by madness::TDHF::prepare_calculation(), and madness::CC2::solve().
|
inlineprivate |
References k, and madness::nonlinear_vector_solver().
Referenced by localize_boys().
|
static |
find sets of degenerate states/orbitals
References madness::nonlinear_vector_solver(), 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(), and madness::nonlinear_vector_solver().
Referenced by localize().
| 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(), enforce_core_valence_separation, madness::MolecularOrbitals< T, NDIM >::get_subset(), madness::inner(), MADNESS_CHECK, madness::nonlinear_vector_solver(), madness::MolecularOrbitals< T, NDIM >::set_all_orbitals_occupied(), madness::World::size(), madness::transform(), madness::transpose(), and madness::truncate().
|
private |
References madness::_(), axis, madness::WorldGopInterface::broadcast(), madness::copy(), madness::default_random_generator, DIP(), e(), f1, madness::g, madness::Tensor< T >::gaxpy(), madness::World::gop, madness::inner(), matrix_exponential(), madness::matrix_inner(), madness::mo, mu, madness::mul_sparse(), N, madness::nonlinear_vector_solver(), madness::print(), madness::Tensor< T >::ptr(), madness::RandomVector< double >(), madness::World::rank(), madness::Tensor< T >::scale(), madness::Random::setstate(), madness::BaseTensor::size(), thresh, and madness::transpose().
Referenced by compute_localization_matrix().
|
private |
Cholesky localization: deterministic and non-iterative.
A pivoted Cholesky factorization of the density in the orthonormal atomic-eigenfunction basis: repeatedly pick the basis function carrying the largest remaining diagonal density, take its coefficient column as the next orbital, and orthonormalize (Aquilante, Pedersen, Koch, J. Chem. Phys. 125, 174101 (2006)). No objective is optimized, so successive SCF iterations cannot hop between the near-degenerate maxima an iterative localizer wanders over. The pivot diagonal is divided over ranks; slices evolve by identical per-function arithmetic on replicated data, so the pivot sequence – and U – are independent of the rank count. Each pivot step costs two scalar allreduces.
References madness::_(), at_nbf, at_to_bf, madness::copy(), d, e(), madness::World::gop, k, MADNESS_CHECK_THROW, madness::WorldGopInterface::max(), me, madness::WorldGopInterface::min(), madness::mo, mu, madness::nonlinear_vector_solver(), pivot_state, prepare_new_basis(), madness::World::rank(), madness::Tensor< T >::scale(), madness::scale(), madness::BaseTensor::size(), madness::World::size(), madness::transpose(), u(), and w().
Referenced by compute_localization_matrix().
|
private |
References madness::_(), a, ao, at_nbf, at_to_bf, madness::WorldGopInterface::broadcast(), madness::copy(), madness::default_random_generator, f1, madness::WorldTaskQueue::for_each(), madness::g, madness::Tensor< T >::gaxpy(), madness::World::gop, madness::inner(), lo, MADNESS_CHECK, matrix_exponential(), madness::mo, mu, N, madness::nonlinear_vector_solver(), prepare_new_basis(), madness::print(), madness::Tensor< T >::ptr(), Q(), madness::RandomVector< double >(), madness::World::rank(), madness::Tensor< T >::scale(), madness::Random::setstate(), madness::BaseTensor::size(), madness::World::taskq, thresh, and madness::transpose().
Referenced by compute_localization_matrix().
|
private |
the "new" objective optimized with distributed systolic Jacobi sweeps (localize=new_sys)
The "new" objective optimized with distributed systolic Jacobi sweeps.
In the orthonormal atomic-eigenfunction basis the "new" objective is Pipek-Mezey (q_ij(a) with identity overlap), so it can reuse localize_PM's systolic machinery: every rank works every call, where localize_new's rank-0 optimizer leaves all other ranks idle – beyond ~1500 orbitals a single call then exceeds the runtime idle watchdog (MAD_WAIT_TIMEOUT). A different optimizer on the same objective: it reaches a different, equally valid local maximum.
References at_nbf, at_to_bf, madness::distributed_localize_new(), madness::mo, prepare_new_basis(), thetamax, and thresh.
Referenced by compute_localization_matrix().
|
private |
References ao, at_nbf, at_to_bf, madness::distributed_localize_PM(), madness::mo, madness::nonlinear_vector_solver(), thetamax, and thresh.
Referenced by compute_localization_matrix().
|
private |
References std::abs(), madness::Tensor< T >::fillrandom(), I, madness::inner(), MADNESS_CHECK, madness::nonlinear_vector_solver(), madness::Tensor< T >::normf(), madness::Tensor< T >::scale(), and madness::scale().
Referenced by localize_boys(), and localize_new().
|
private |
build the "new" method's orthonormal atomic-eigenfunction basis and localization blocks
Build the "new" method's working basis: transform the AO-projection matrix C into the orthonormal atomic-eigenfunction basis and construct the per-atom localization blocks (1s / 2s2p / rest). Shared by localize_new (rank-0 CG) and localize_new_systolic.
References madness::_(), ao, aobasis, at_nbf, at_to_bf, madness::BaseTensor::dim(), madness::Molecule::get_atomic_number(), madness::AtomicBasisSet::get_avec(), madness::inner(), MADNESS_ASSERT, madness::matrix_inner(), madness::mo, molecule, madness::Molecule::natom(), madness::nonlinear_vector_solver(), madness::AtomicBasisSet::shells_to_bfn(), and madness::BaseTensor::size().
Referenced by localize_cholesky(), localize_new(), and localize_new_systolic().
|
inline |
| template MolecularOrbitals< double, 3 > madness::Localizer::separate_core_valence | ( | const MolecularOrbitals< T, NDIM > & | mo_in, |
| const Tensor< T > & | Fock | ||
| ) | const |
References enforce_core_valence_separation.
|
inline |
References method, and madness::nonlinear_vector_solver().
References madness::copy(), metric, and R.
hand the cholesky method last iteration's pivot order; it reads the order and overwrites it with the one it used (see localize_cholesky)
References pivot_state.
|
static |
given a unitary transformation matrix undo rotations between degenerate columns
References madness::BaseTensor::dim(), find_degenerate_blocks(), MADNESS_CHECK, madness::nonlinear_vector_solver(), 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(), madness::nonlinear_vector_solver(), and madness::Tensor< T >::scale().
|
static |
given a unitary transformation matrix undo the rotations within the blocks
References madness::_(), madness::copy(), madness::inner(), madness::nonlinear_vector_solver(), 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(), madness::nonlinear_vector_solver(), and undo_rotation().
Referenced by localize_new(), localize_PM(), and prepare_new_basis().
|
private |
map atoms to basis functions in the "new" algorithm
Referenced by Localizer(), get_aobasis(), prepare_new_basis(), and print_info().
|
private |
Referenced by Localizer(), localize_cholesky(), localize_new(), localize_new_systolic(), localize_PM(), and prepare_new_basis().
|
private |
Referenced by Localizer(), localize_cholesky(), localize_new(), localize_new_systolic(), localize_PM(), and prepare_new_basis().
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().
Referenced by compute_localization_matrix(), print_info(), and set_metric().
|
private |
Referenced by Localizer(), and prepare_new_basis().
localization method
Referenced by localize_cholesky(), and set_pivot_state().
|
private |
=R for computing matrix elements of operators
Referenced by localize_new_systolic(), and localize_PM().
|
private |
Referenced by Localizer(), find_degenerate_blocks(), print_info(), and undo_degenerate_rotations().
maximum rotation(?)
Referenced by compute_localization_matrix().