MADNESS
version 0.9
|
The main class of the periodic DFT solver
. More...
#include <solver.h>
Classes | |
struct | GuessDensity |
Public Member Functions | |
void | START_TIMER (World &world) |
void | END_TIMER (World &world, const char *msg) |
Solver (World &world, const std::string &filename) | |
void | init (const std::string &filename) |
std::vector< KPoint > | genkmesh (unsigned int ngridk0, unsigned ngridk1, unsigned int ngridk2, double koffset0, double koffset1, double koffset2, double R) |
void | save_orbitals () |
void | load_orbitals () |
void | make_nuclear_potential_impl () |
void | make_nuclear_charge_density_impl () |
void | make_nuclear_potential () |
template<typename Q > | |
void | test_periodicity (const Function< Q, 3 > &f) |
rfunctionT | make_lda_potential (World &world, const rfunctionT &arho, const rfunctionT &brho, const rfunctionT &adelrhosq, const rfunctionT &bdelrhosq) |
vecfuncT | project_ao_basis (World &world, KPoint kpt) |
Solver (World &world, rfunctionT vnucrhon, vecfuncT phisa, vecfuncT phisb, std::vector< T > eigsa, std::vector< T > eigsb, ElectronicStructureParams params, MolecularEntity mentity) | |
void | initial_guess () |
Initializes alpha and beta mos, occupation numbers, eigenvalues. More... | |
Solver (World &world, const rfunctionT &vnucrhon, const vecfuncT &phis, const std::vector< T > &eigs, const ElectronicStructureParams ¶ms, MolecularEntity mentity) | |
Solver (World &world, rfunctionT vnucrhon, vecfuncT phis, std::vector< T > eigs, std::vector< KPoint > kpoints, std::vector< double > occs, ElectronicStructureParams params, MolecularEntity mentity) | |
virtual | ~Solver () |
void | set_occs2 (const std::vector< KPoint > &kpoints, const std::vector< double > &eigsa, const std::vector< double > &eigsb, std::vector< double > &occsa, std::vector< double > &occsb) |
rfunctionT | compute_rho_slow (const vecfuncT &phis, std::vector< KPoint > kpoints, std::vector< double > occs) |
Compute the electronic density for either a molecular or periodic system. More... | |
rfunctionT | compute_rho (const vecfuncT &phis, std::vector< KPoint > kpoints, std::vector< double > occs) |
std::vector< poperatorT > | make_bsh_operators (const std::vector< T > &eigs) |
double | calculate_kinetic_energy () |
void | apply_potential (vecfuncT &pfuncsa, vecfuncT &pfuncsb, const vecfuncT &phisa, const vecfuncT &phisb, const rfunctionT &rhoa, const rfunctionT &rhob, const rfunctionT &rho) |
Applies the LDA effective potential to each orbital. Currently only lda and spin-polarized is not implemented. More... | |
void | apply_hf_exchange3 (vecfuncT &phisa, vecfuncT &phisb, vecfuncT &funcsa, vecfuncT &funcsb, double &xc) |
KPoint | find_kpt_from_orb (unsigned int idx) |
void | apply_hf_exchange4 (vecfuncT &phisa, vecfuncT &phisb, vecfuncT &funcsa, vecfuncT &funcsb, double &xc) |
void | apply_hf_exchange (vecfuncT &phisa, vecfuncT &phisb, vecfuncT &funcsa, vecfuncT &funcsb) |
void | reproject () |
void | solve () |
ctensorT | matrix_exponential (const ctensorT &A) |
template<typename Q > | |
void | print_tensor2d (ostream &os, Tensor< Q > t) |
void | print_potential_matrix_eigs (const vecfuncT &wf, const vecfuncT &vwf) |
void | print_fock_matrix_eigs (const vecfuncT &wf, const vecfuncT &vwf, KPoint kpoint) |
void | do_rhs (vecfuncT &wf, vecfuncT &vwf, std::vector< KPoint > kpoints, std::vector< T > &alpha, std::vector< double > &eigs) |
void | do_rhs_simple (vecfuncT &wf, vecfuncT &vwf, std::vector< KPoint > kpoints, std::vector< T > &alpha, std::vector< double > &eigs) |
tensor_complex | make_kinetic_matrix (World &world, const vector_complex_function_3d &v, const KPoint &k) |
tensorT | build_fock_matrix (vecfuncT &psi, vecfuncT &vpsi, KPoint kpoint) |
void | gram_schmidt (vecfuncT &f, KPoint kpoint) |
tensorT | Q3 (const tensorT &s) |
Given overlap matrix, return rotation with 3rd order error to orthonormalize the vectors. More... | |
ctensorT | csqrt (const ctensorT &s, double tol=1e-8) |
Computes matrix square root (not used any more?) More... | |
void | orthonormalize (vecfuncT &wf, KPoint kpoint) |
vecfuncT | compute_residual (const vecfuncT &awfs, const vecfuncT &bwfs) |
void | update_orbitals (vecfuncT &awfs, vecfuncT &bwfs, std::vector< KPoint > kpoints) |
void | step_restriction (vecfuncT &owfs, vecfuncT &nwfs, int aorb) |
void | fix_occupations (const std::vector< T > &eps, std::vector< double > &occs) |
Public Attributes | |
double | ttt |
double | sss |
The main class of the periodic DFT solver
.
|
inline |
References madness::BC_PERIODIC, madness::Solver< T, NDIM >::init(), madness::Solver< T, NDIM >::initial_guess(), madness::Solver< T, NDIM >::make_nuclear_potential(), madness::ElectronicStructureParams::periodic, madness::ElectronicStructureParams::restart, and madness::FunctionDefaults< NDIM >::set_bc().
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
References madness::apply(), madness::inner(), madness::real(), and madness::Function< T, NDIM >::truncate().
Referenced by madness::Solver< T, NDIM >::apply_potential().
|
inline |
References madness::apply(), madness::conj(), madness::Solver< T, NDIM >::find_kpt_from_orb(), madness::inner(), madness::ElectronicStructureParams::L, madness::ElectronicStructureParams::lo, madness::real(), madness::Function< T, NDIM >::truncate(), and madness::vec().
Referenced by madness::Solver< T, NDIM >::apply_potential().
|
inline |
References madness::conj_transpose(), madness::Solver< T, NDIM >::END_TIMER(), madness::WorldGopInterface::fence(), madness::World::gop, madness::Solver< T, NDIM >::make_kinetic_matrix(), madness::matrix_inner(), madness::ElectronicStructureParams::periodic, potential(), madness::print(), psi(), madness::World::rank(), and madness::Solver< T, NDIM >::START_TIMER().
Referenced by madness::Solver< T, NDIM >::do_rhs(), and madness::Solver< T, NDIM >::do_rhs_simple().
|
inline |
|
inline |
References madness::ElectronicStructureParams::spinpol, and madness::sub().
Referenced by madness::Solver< T, NDIM >::update_orbitals().
|
inline |
References madness::abssq(), madness::compress(), madness::Function< T, NDIM >::compress(), madness::WorldGopInterface::fence(), madness::Function< T, NDIM >::gaxpy(), madness::World::gop, madness::norm2s(), madness::World::rank(), madness::reconstruct(), madness::Function< T, NDIM >::truncate(), and madness::KPoint::weight().
Referenced by madness::Solver< T, NDIM >::solve().
|
inline |
Computes matrix square root (not used any more?)
References c, m, MADNESS_EXCEPTION, madness::print(), sqrt(), and madness::syev().
Referenced by madness::Solver< T, NDIM >::orthonormalize().
|
inline |
References madness::arg(), madness::Solver< T, NDIM >::build_fock_matrix(), c, madness::ElectronicStructureParams::canon, madness::conj_transpose(), madness::copy(), mpfr::exp(), mpfr::fabs(), madness::gaxpy(), madness::inner(), is_equal(), madness::Solver< T, NDIM >::matrix_exponential(), madness::matrix_inner(), max, mpfr::min(), madness::ElectronicStructureParams::periodic, madness::print(), madness::ElectronicStructureParams::print_matrices, madness::World::rank(), madness::real(), rot, madness::World::size(), madness::sygv(), std::tr1::T(), madness::ElectronicStructureParams::thresh, thresh, and madness::transform().
|
inline |
References madness::arg(), madness::Solver< T, NDIM >::build_fock_matrix(), madness::conj_transpose(), madness::copy(), mpfr::exp(), mpfr::fabs(), madness::inner(), is_equal(), madness::Solver< T, NDIM >::matrix_exponential(), madness::matrix_inner(), max, mpfr::min(), madness::ElectronicStructureParams::periodic, madness::print(), madness::ElectronicStructureParams::print_matrices, madness::World::rank(), madness::real(), rot, madness::World::size(), madness::ElectronicStructureParams::solver, madness::sygv(), std::tr1::T(), madness::ElectronicStructureParams::thresh, thresh, and madness::transform().
Referenced by madness::Solver< T, NDIM >::solve().
|
inline |
References madness::World::rank(), madness::Solver< T, NDIM >::sss, madness::Solver< T, NDIM >::ttt, and madness::wall_time().
Referenced by madness::Solver< T, NDIM >::apply_potential(), madness::Solver< T, NDIM >::build_fock_matrix(), madness::Solver< T, NDIM >::initial_guess(), madness::Solver< T, NDIM >::print_fock_matrix_eigs(), madness::Solver< T, NDIM >::print_potential_matrix_eigs(), and madness::Solver< T, NDIM >::solve().
|
inline |
References MADNESS_EXCEPTION.
Referenced by madness::Solver< T, NDIM >::apply_hf_exchange4().
|
inline |
|
inline |
References k, madness::constants::pi, and weight().
Referenced by madness::Solver< T, NDIM >::init().
|
inline |
References madness::inner(), and madness::norm2().
Referenced by madness::Solver< T, NDIM >::load_orbitals(), and madness::Solver< T, NDIM >::update_orbitals().
|
inline |
References madness::ElectronicStructureParams::basis, madness::WorldGopInterface::broadcast_serializable(), MolecularEntity::center(), madness::ElectronicStructureParams::centered, madness::ElectronicStructureParams::fractional, madness::Solver< T, NDIM >::genkmesh(), madness::World::gop, madness::ElectronicStructureParams::koffset0, madness::ElectronicStructureParams::koffset1, madness::ElectronicStructureParams::koffset2, madness::ElectronicStructureParams::L, madness::Solver< T, NDIM >::load_orbitals(), madness::ElectronicStructureParams::nbands, madness::ElectronicStructureParams::ncharge, madness::ElectronicStructureParams::nelec, madness::ElectronicStructureParams::nempty, madness::ElectronicStructureParams::ngridk0, madness::ElectronicStructureParams::ngridk1, madness::ElectronicStructureParams::ngridk2, madness::ElectronicStructureParams::periodic, madness::constants::pi, madness::World::rank(), MolecularEntity::read_file(), madness::ElectronicStructureParams::read_file(), madness::AtomicBasisSet::read_file(), madness::ElectronicStructureParams::restart, madness::FunctionDefaults< NDIM >::set_cubic_cell(), madness::FunctionDefaults< NDIM >::set_k(), madness::FunctionDefaults< NDIM >::set_thresh(), madness::ElectronicStructureParams::thresh, MolecularEntity::total_nuclear_charge(), madness::vec(), madness::ElectronicStructureParams::waveorder, and madness::KPoint::weight().
Referenced by madness::Solver< T, NDIM >::Solver().
|
inline |
Initializes alpha and beta mos, occupation numbers, eigenvalues.
References madness::apply(), c, madness::compress(), madness::conj_transpose(), madness::Solver< T, NDIM >::END_TIMER(), madness::FunctionDefaults< NDIM >::get_cell_width(), madness::ElectronicStructureParams::L, madness::ElectronicStructureParams::lo, MADNESS_EXCEPTION, madness::Solver< T, NDIM >::make_lda_potential(), madness::matrix_inner(), madness::ElectronicStructureParams::nbands, madness::AtomicBasisSet::nbf(), madness::ElectronicStructureParams::ncharge, madness::normalize(), op(), madness::ElectronicStructureParams::periodic, madness::plot_line(), madness::plotdx(), potential(), madness::print(), madness::Solver< T, NDIM >::project_ao_basis(), madness::World::rank(), madness::real(), madness::reconstruct(), madness::Function< T, NDIM >::reconstruct(), madness::ElectronicStructureParams::restart, madness::Function< T, NDIM >::scale(), madness::Solver< T, NDIM >::START_TIMER(), madness::syev(), madness::sygv(), madness::ElectronicStructureParams::thresh, madness::Function< T, NDIM >::trace(), madness::transform(), and madness::truncate().
Referenced by madness::Solver< T, NDIM >::Solver().
|
inline |
References madness::WorldGopInterface::fence(), madness::FunctionDefaults< NDIM >::get_k(), madness::FunctionDefaults< NDIM >::get_thresh(), madness::World::gop, madness::Solver< T, NDIM >::gram_schmidt(), k, madness::project(), madness::reconstruct(), madness::ElectronicStructureParams::spinpol, and thresh.
Referenced by madness::Solver< T, NDIM >::init().
|
inline |
|
inline |
References madness::apply(), std::tr1::f1, std::tr1::f2, std::tr1::f3, I(), and madness::matrix_inner().
Referenced by madness::Solver< T, NDIM >::build_fock_matrix().
|
inline |
References madness::copy(), and madness::Function< T, NDIM >::unaryop().
Referenced by madness::Solver< T, NDIM >::initial_guess().
|
inline |
References madness::apply(), MolecularEntity::get_atom(), madness::ElectronicStructureParams::L, MolecularEntity::natom(), madness::ElectronicStructureParams::periodic, madness::print(), madness::World::rank(), madness::ElectronicStructureParams::thresh, thresh, madness::Function< T, NDIM >::trace(), madness::wall_time(), madness::Atom::x, madness::Atom::y, and madness::Atom::z.
Referenced by madness::Solver< T, NDIM >::make_nuclear_potential().
|
inline |
References madness::FunctionDefaults< NDIM >::get_cell(), madness::ElectronicStructureParams::ispotential, madness::ElectronicStructureParams::lo, madness::Solver< T, NDIM >::make_nuclear_charge_density_impl(), madness::Solver< T, NDIM >::make_nuclear_potential_impl(), madness::print(), and madness::World::rank().
Referenced by madness::Solver< T, NDIM >::reproject(), and madness::Solver< T, NDIM >::Solver().
|
inline |
|
inline |
References B, madness::inner(), k, and madness::scale().
Referenced by madness::Solver< T, NDIM >::do_rhs(), and madness::Solver< T, NDIM >::do_rhs_simple().
|
inline |
|
inline |
References c, madness::conj_transpose(), madness::Solver< T, NDIM >::END_TIMER(), madness::WorldGopInterface::fence(), madness::World::gop, madness::matrix_inner(), madness::ElectronicStructureParams::periodic, potential(), madness::print(), madness::World::rank(), madness::Solver< T, NDIM >::START_TIMER(), madness::syev(), and madness::sygv().
Referenced by madness::Solver< T, NDIM >::solve().
|
inline |
|
inline |
|
inline |
|
inline |
Given overlap matrix, return rotation with 3rd order error to orthonormalize the vectors.
References madness::inner().
|
inline |
References madness::WorldGopInterface::fence(), madness::World::gop, madness::Solver< T, NDIM >::make_nuclear_potential(), madness::normalize(), madness::project(), madness::World::rank(), madness::reconstruct(), madness::FunctionDefaults< NDIM >::set_k(), madness::FunctionDefaults< NDIM >::set_thresh(), madness::ElectronicStructureParams::spinpol, madness::ElectronicStructureParams::thresh, madness::truncate(), and madness::ElectronicStructureParams::waveorder.
Referenced by madness::Solver< T, NDIM >::solve().
|
inline |
References madness::ElectronicStructureParams::nio, and madness::ElectronicStructureParams::spinpol.
Referenced by madness::Solver< T, NDIM >::solve().
|
inline |
References k, madness::ElectronicStructureParams::ncharge, and madness::World::rank().
Referenced by madness::Solver< T, NDIM >::solve().
|
inline |
References madness::apply(), madness::Solver< T, NDIM >::apply_potential(), madness::Solver< T, NDIM >::compute_rho(), madness::Solver< T, NDIM >::do_rhs_simple(), madness::Solver< T, NDIM >::END_TIMER(), madness::FunctionDefaults< NDIM >::get_cell(), madness::Solver< T, NDIM >::make_bsh_operators(), madness::matrix_inner(), madness::ElectronicStructureParams::maxits, madness::norm2s(), madness::plotdx(), madness::ElectronicStructureParams::plotorbs, madness::print(), madness::Solver< T, NDIM >::print_fock_matrix_eigs(), madness::World::rank(), madness::ElectronicStructureParams::rcriterion, madness::Solver< T, NDIM >::reproject(), madness::Solver< T, NDIM >::save_orbitals(), madness::scale(), madness::Solver< T, NDIM >::set_occs2(), madness::World::size(), madness::ElectronicStructureParams::spinpol, madness::Solver< T, NDIM >::START_TIMER(), madness::syev(), madness::ElectronicStructureParams::thresh, madness::Function< T, NDIM >::trace(), and madness::Solver< T, NDIM >::update_orbitals().
Referenced by main().
|
inline |
References madness::WorldGopInterface::fence(), madness::World::gop, and madness::wall_time().
Referenced by madness::Solver< T, NDIM >::apply_potential(), madness::Solver< T, NDIM >::build_fock_matrix(), madness::Solver< T, NDIM >::initial_guess(), madness::Solver< T, NDIM >::print_fock_matrix_eigs(), madness::Solver< T, NDIM >::print_potential_matrix_eigs(), and madness::Solver< T, NDIM >::solve().
|
inline |
References madness::gaxpy(), madness::print(), madness::World::rank(), and madness::ElectronicStructureParams::sd.
Referenced by madness::Solver< T, NDIM >::update_orbitals().
|
inline |
References delta, madness::f, and madness::ElectronicStructureParams::L.
|
inline |
References madness::Solver< T, NDIM >::compute_residual(), madness::Solver< T, NDIM >::gram_schmidt(), madness::ElectronicStructureParams::maxsub, madness::norm2(), madness::ElectronicStructureParams::solver, madness::ElectronicStructureParams::spinpol, madness::Solver< T, NDIM >::step_restriction(), and madness::Subspace< T, NDIM >::update_subspace().
Referenced by madness::Solver< T, NDIM >::solve().
double madness::Solver< T, NDIM >::sss |
Referenced by madness::Solver< T, NDIM >::END_TIMER().
double madness::Solver< T, NDIM >::ttt |
Referenced by madness::Solver< T, NDIM >::END_TIMER().