MADNESS 0.10.1
madness::Nemo Class Reference

The Nemo class. More...

#include <nemo.h>

Inheritance diagram for madness::Nemo:
Collaboration diagram for madness::Nemo:

Classes

struct  NemoCalculationParameters
 class holding parameters for a nemo calculation beyond the standard dft parameters from moldft More...

Public Member Functions

 Nemo (World &world, const CalculationParameters &param, const NemoCalculationParameters &nemo_param, const Molecule &molecule, const PCMParameters &pcm_param=PCMParameters())
 Nemo (World &world, const commandlineparser &parser)
 ctor
virtual nlohmann::json analyze () const
 compute dipole moment and gradient at the current geometry
bool check_converged (const Tensor< double > &x) const
std::vector< vecfuncT > compute_all_cphf ()
 solve the CPHF equation for all displacements
vecfuncT compute_cphf_parallel_term (const size_t iatom, const int iaxis) const
tensorT compute_fock_matrix (const vecfuncT &nemo, const tensorT &occ) const
 compute the Fock matrix from scratch
Tensor< double > compute_IR_intensities (const Tensor< double > &normalmodes, const vecfuncT &dens_pt) const
 compute the IR intensities in the double harmonic approximation
bool do_ac () const
bool do_pcm () const
bool do_symmetry () const
AC< 3 > get_ac () const
std::shared_ptr< SCF > get_calc () const
const CalculationParameters & get_calc_param () const
const NemoCalculationParameters & get_nemo_param () const
PCM get_pcm () const
projector_irrep get_symmetry_projector () const
 return the symmetry_projector
Tensor< double > gradient (const Tensor< double > &x)
 compute the nuclear gradients
VibrationalResults hessian (const Tensor< double > &x)
 returns the molecular hessian matrix at structure x
bool is_dft () const
real_function_3d kinetic_energy_potential (const vecfuncT &nemo) const
 the Laplacian of the density
void load_mos (World &w)
real_function_3d make_ddensity (const real_function_3d &rhonemo, const int axis) const
 make the derivative of the density
real_function_3d make_density (const Tensor< double > &occ, const vecfuncT &nemo) const
 make the density (alpha or beta)
real_function_3d make_density (const tensorT &occ, const vecfuncT &bra, const vecfuncT &ket, const bool refine=false) const
 make the density using different bra and ket vectors
virtual std::shared_ptr< Fock< double, 3 > > make_fock_operator () const
 construct the fock operator based on the calculation parameters (K or XC?)
real_function_3d make_sigma (const real_function_3d &rho1, const real_function_3d &rho2) const
 compute the reduced densities sigma (gamma) for GGA functionals
Molecule & molecule ()
 return a reference to the molecule
Molecule & molecule () const
 return a reference to the molecule
std::string name () const
nlohmann::json population_analysis () const
 atomic charges of the orbitals R*nemo by the schemes of the population key
bool provides_gradient () const
 Override this to return true if the derivative is implemented.
Tensor< double > purify_hessian (const Tensor< double > &hessian) const
 purify and symmetrize the hessian
bool selftest ()
vecfuncT solve_cphf (const size_t iatom, const int iaxis, const Tensor< double > &fock, const vecfuncT &guess, const vecfuncT &rhsconst, const Tensor< double > &incomplete_hessian, const vecfuncT &parallel, const SCFProtocol &p, const std::string &xc_data) const
 solve the CPHF equations for the nuclear displacements
virtual double value ()
virtual double value (const Tensor< double > &x)
 Should return the value of the objective function.
Public Member Functions inherited from madness::NemoBase
 NemoBase (World &w)
virtual ~NemoBase ()
bool check_convergence (const std::vector< double > energies, const std::vector< double > oldenergies, const double bsh_norm, const double delta_density, const CalculationParameters &param, const double econv, const double dconv) const
template<typename T, std::size_t NDIM>
Function< typename Tensor< T >::scalar_type, NDIM > compute_density (const std::vector< Function< T, NDIM > > nemo) const
Tensor< double > compute_gradient (const real_function_3d &rhonemo, const Molecule &molecule) const
 compute the nuclear gradients
template<typename T, std::size_t NDIM>
double compute_kinetic_energy (const std::vector< Function< T, NDIM > > &nemo) const
 compute kinetic energy as square of the "analytical" expectation value
template<typename T, std::size_t NDIM>
double compute_kinetic_energy1 (const std::vector< Function< T, NDIM > > &nemo) const
 compute kinetic energy as square of the "analytical" derivative of the orbitals
template<typename T, std::size_t NDIM>
double compute_kinetic_energy1a (const std::vector< Function< T, NDIM > > &nemo) const
 compute kinetic energy as square of the "analytical" derivative of the orbitals
template<typename T, std::size_t NDIM>
double compute_kinetic_energy2 (const std::vector< Function< T, NDIM > > &nemo) const
 compute kinetic energy as direct derivative of the orbitals (probably imprecise)
void construct_nuclear_correlation_factor (const Molecule &molecule, const std::shared_ptr< PotentialManager > &pm, const std::pair< std::string, double > &ncf_parameter)
std::shared_ptr< NuclearCorrelationFactor > get_ncf_ptr () const
 create an instance of the derived object based on the input parameters
virtual void invalidate_factors_and_potentials ()
virtual bool need_recompute_factors_and_potentials (const double thresh) const
template<typename T, std::size_t NDIM>
void orthonormalize (std::vector< Function< T, NDIM > > &nemo, const Function< double, NDIM > metric=Function< double, NDIM >(), const double trantol=FunctionDefaults< NDIM >::get_thresh() *0.01) const
 orthonormalize the vectors
template<typename T, std::size_t NDIM>
void reproject_mos (std::vector< Function< T, NDIM > > &nemo, const Function< double, NDIM > &metric) const
 reproject a set of nemos onto the current k and thresh
Public Member Functions inherited from madness::OptimizationTargetInterface
virtual ~OptimizationTargetInterface ()
double test_gradient (Tensor< double > &x, double value_precision, bool doprint=true)
 Numerical test of the derivative ... optionally prints to stdout, returns max abs error.
virtual void value_and_gradient (const Tensor< double > &x, double &value, Tensor< double > &gradient)
 Reimplement if more efficient to evaluate both value and gradient in one call.

Static Public Member Functions

static void help ()
static void print_parameters ()
static void smoothen (real_function_3d &f)
 smooth a function by projecting it onto k-1 and then average with k
Static Public Member Functions inherited from madness::NemoBase
template<typename T, std::size_t NDIM>
static void normalize (std::vector< Function< T, NDIM > > &nemo, const Function< double, NDIM > metric=Function< double, NDIM >())
 normalize the nemos
template<typename T>
static Tensor< T > Q2 (const Tensor< T > &s)

Public Attributes

const NemoCalculationParameters nemo_param
std::filesystem::path work_dir
Public Attributes inherited from madness::NemoBase
std::shared_ptr< NuclearCorrelationFactor > ncf
 the nuclear correlation factor
real_function_3d R
 the nuclear correlation factor
real_function_3d R_square
 the square of the nuclear correlation factor
real_function_3d U1dotU1
 U1.U1 = |grad R|^2 / R^2, by which the physical kinetic energy exceeds the regularized one.
World & world

Protected Member Functions

std::vector< double > compute_energy_regularized (const vecfuncT &nemo, const vecfuncT &R2nemo, const vecfuncT &Jnemo, const vecfuncT &Knemo, const vecfuncT &Unemo, const Tensor< double > &kinetic) const
 given nemos, compute the HF energy using the regularized expressions for T and V
void compute_nemo_potentials (const vecfuncT &nemo, const vecfuncT &R2nemo, vecfuncT &Jnemo, vecfuncT &Knemo, vecfuncT &xcnemo, vecfuncT &pcmnemo, vecfuncT &Unemo) const
 compute all potentials applied on nemo, without the weak-form split
void compute_nemo_potentials (const vecfuncT &nemo, const vecfuncT &R2nemo, vecfuncT &Jnemo, vecfuncT &Knemo, vecfuncT &xcnemo, vecfuncT &pcmnemo, vecfuncT &Unemo, std::vector< vecfuncT > &xcflux, tensorT &fock_xc) const
 compute the reconstructed orbitals, and all potentials applied on nemo
void compute_nemo_potentials_impl (const vecfuncT &nemo, const vecfuncT &R2nemo, vecfuncT &Jnemo, vecfuncT &Knemo, vecfuncT &xcnemo, vecfuncT &pcmnemo, vecfuncT &Unemo, std::vector< vecfuncT > &xcflux, tensorT &fock_xc, const bool allow_weak) const
 implementation of both compute_nemo_potentials forms
real_function_3d get_coulomb_potential (const vecfuncT &psi) const
 return the Coulomb potential
template<typename T, size_t NDIM>
void load_function (std::vector< Function< T, NDIM > > &f, const std::string name) const
 load a function
vecfuncT localize (const vecfuncT &nemo, const double dconv, const bool randomize) const
 localize the nemo orbitals
vecfuncT make_cphf_constant_term (const size_t iatom, const int iaxis, const vecfuncT &R2nemo, const real_function_3d &rhonemo) const
 compute the constant term for the CPHF equations
Tensor< double > make_incomplete_hessian () const
 compute the incomplete hessian
Tensor< double > make_incomplete_hessian_response_part (const std::vector< vecfuncT > &xi) const
 compute the complementary incomplete hessian
void make_plots (const real_function_3d &f, const std::string &name="function") const
template<typename T, size_t NDIM>
void save_function (const std::vector< Function< T, NDIM > > &f, const std::string name) const
 save a function
void set_protocol (const double thresh)
 adapt the thresholds consistently to a common value
double solve (const SCFProtocol &proto)
 solve the HF equations
double trantol () const
 return the threshold for vanishing elements in orbital rotations

Protected Attributes

AC< 3 > ac
 asymptotic correction for DFT
std::shared_ptr< SCF > calc
std::shared_ptr< real_convolution_3d > poisson
 a poisson solver
projector_irrep symmetry_projector

Private Types

typedef std::shared_ptr< real_convolution_3d > poperatorT

Private Attributes

double coords_sum
 sum of square of coords at last solved geometry
PCM pcm
 polarizable continuum model

Friends

class PNO
class TDHF

Detailed Description

The Nemo class.

Member Typedef Documentation

◆ poperatorT

typedef std::shared_ptr<real_convolution_3d> madness::Nemo::poperatorT
private

Constructor & Destructor Documentation

◆ Nemo() [1/2]

◆ Nemo() [2/2]

Member Function Documentation

◆ analyze()

◆ check_converged()

bool madness::Nemo::check_converged ( const Tensor< double > & x) const
inline

References coords_sum, and madness::Tensor< T >::sumsq().

Referenced by value().

◆ compute_all_cphf()

std::vector< vecfuncT > madness::Nemo::compute_all_cphf ( )

solve the CPHF equation for all displacements

this function computes the nemo response F^X

\‍[    F^X = F^\perp + F^\parallel
\‍]

To reconstruct the unregularized orbital response (not recommended):

\‍[  i^X   = R^X F + R F^X
\‍]

The orbital response i^X constructed in this way is automatically orthogonal to the occupied space because of the parallel term F^\parallel

Returns
a vector of the nemo response F^X for all displacements

References madness::apply(), calc, compute_cphf_parallel_term(), compute_fock_matrix(), madness::SCFProtocol::current_prec, madness::dot(), madness::SCFProtocol::drop_last_rung(), madness::SCFProtocol::finished(), get_calc(), get_calc_param(), get_nemo_param(), madness::SCFProtocol::initialize(), load_function(), madness::SCF::make_bsh_operators(), make_cphf_constant_term(), make_density(), make_incomplete_hessian(), make_incomplete_hessian_response_part(), molecule(), madness::mul(), madness::nemo, p(), param, madness::print(), madness::NemoBase::R_square, madness::save(), save_function(), set_protocol(), solve_cphf(), madness::stringify(), madness::timer::tag(), madness::truncate(), madness::wall_time(), madness::NemoBase::world, xc, and xi.

Referenced by hessian().

◆ compute_cphf_parallel_term()

vecfuncT madness::Nemo::compute_cphf_parallel_term ( const size_t iatom,
const int iaxis ) const

this function computes that part of the orbital response that is parallel to the occupied space.

\‍[    F^X = F^\perp + F^\parallel
\‍]

If no NCF's are used F^\parallel vanishes. If NCF's are used this term does not vanish because the derivatives of the NCF does not vanish, and it is given by

\‍[ F_i^\parallel = -\frac{1}{2}\sum_k|F_k ><F_k | (R^2)^X | F_i>
\‍]

References calc, madness::FunctionFactory< T, NDIM >::functor(), madness::matrix_inner(), madness::mul(), madness::NemoBase::ncf, madness::nemo, madness::transform(), madness::truncate(), madness::FunctionFactory< T, NDIM >::truncate_on_project(), and madness::NemoBase::world.

Referenced by compute_all_cphf().

◆ compute_energy_regularized()

std::vector< double > madness::Nemo::compute_energy_regularized ( const vecfuncT & nemo,
const vecfuncT & R2nemo,
const vecfuncT & Jnemo,
const vecfuncT & Knemo,
const vecfuncT & Unemo,
const Tensor< double > & kinetic ) const
protected

given nemos, compute the HF energy using the regularized expressions for T and V

Parameters
[in]R2nemoR^2 * nemo, the bra of every expectation value
[in]kinetic<R^2 F_i | -1/2 nabla^2 | F_j>, the kinetic block of the Fock matrix; the regularized kinetic energy is twice its trace

given nemos, compute the HF energy using the regularized expressions for T and V

References calc, madness::XCOperator< T, NDIM >::compute_xc_energy(), madness::BaseTensor::dim(), do_pcm(), madness::dot(), madness::timer::end(), energy, get_calc_param(), madness::XCOperator< T, NDIM >::has_tau_term(), madness::inner(), is_dft(), MADNESS_CHECK_THROW, madness::BaseTensor::ndim(), madness::nemo, pcm, madness::NemoBase::R_square, madness::XCOperator< T, NDIM >::set_tau(), madness::Tensor< T >::sum(), madness::NemoBase::U1dotU1, and madness::NemoBase::world.

Referenced by solve().

◆ compute_fock_matrix()

tensorT madness::Nemo::compute_fock_matrix ( const vecfuncT & nemo,
const tensorT & occ ) const

◆ compute_IR_intensities()

Tensor< double > madness::Nemo::compute_IR_intensities ( const Tensor< double > & normalmodes,
const vecfuncT & dens_pt ) const

◆ compute_nemo_potentials() [1/2]

void madness::Nemo::compute_nemo_potentials ( const vecfuncT & nemo,
const vecfuncT & R2nemo,
vecfuncT & Jnemo,
vecfuncT & Knemo,
vecfuncT & xcnemo,
vecfuncT & pcmnemo,
vecfuncT & Unemo ) const
inlineprotected

compute all potentials applied on nemo, without the weak-form split

The pre-weak-form signature, kept for callers that have no use for the flux. It never opts in to the weak form, whatever xc_weak_gga says, so xcnemo always carries the complete multiplicative xc potential and the xc block of the Fock matrix can be read off it as before. Silently discarding xcflux instead would drop the semilocal term.

References compute_nemo_potentials_impl(), and madness::nemo.

◆ compute_nemo_potentials() [2/2]

void madness::Nemo::compute_nemo_potentials ( const vecfuncT & nemo,
const vecfuncT & R2nemo,
vecfuncT & Jnemo,
vecfuncT & Knemo,
vecfuncT & xcnemo,
vecfuncT & pcmnemo,
vecfuncT & Unemo,
std::vector< vecfuncT > & xcflux,
tensorT & fock_xc ) const
inlineprotected

compute the reconstructed orbitals, and all potentials applied on nemo

to use these potentials in the fock matrix computation they must be multiplied by the nuclear correlation factor

Parameters
[in]nemothe nemo orbitals
[in]R2nemoR^2 * nemo, the bra of the exchange operator
[out]JnemoCoulomb operator applied on the nemos
[out]Knemoexchange operator applied on the nemos
[out]pcmnemoPCM (solvent) potential applied on the nemos
[out]Unemoregularized nuclear potential applied on the nemos
[out]xcfluxthe vector field Y_i that the orbital update pushes through the Green's function, see XCOperator::weak_xc_terms. Assigned in the weak form only and left EMPTY otherwise, which is how the caller tells the two forms apart.
[out]fock_xcthe xc block of the Fock matrix. In the weak form it cannot be recovered from xcnemo any more, because what is missing from xcnemo is exactly the term that has no multiplicative representation. Assigned in the weak form only and left untouched otherwise.

References compute_nemo_potentials_impl(), and madness::nemo.

Referenced by compute_fock_matrix(), and solve().

◆ compute_nemo_potentials_impl()

void madness::Nemo::compute_nemo_potentials_impl ( const vecfuncT & nemo,
const vecfuncT & R2nemo,
vecfuncT & Jnemo,
vecfuncT & Knemo,
vecfuncT & xcnemo,
vecfuncT & pcmnemo,
vecfuncT & Unemo,
std::vector< vecfuncT > & xcflux,
tensorT & fock_xc,
const bool allow_weak ) const
protected

implementation of both compute_nemo_potentials forms

compute the reconstructed orbitals, and all potentials applied on nemo

Parameters
[in]allow_weakopt in to the weak form; it is then used iff the xc_weak_gga parameter asks for it

to use these potentials in the fock matrix computation they must be multiplied by the nuclear correlation factor

Parameters
[in]nemothe nemo orbitals
[out]psithe reconstructed, full orbitals
[out]JnemoCoulomb operator applied on the nemos
[out]Knemoexchange operator applied on the nemos
[out]Vnemonuclear potential applied on the nemos
[out]Unemoregularized nuclear potential applied on the nemos

References ac, madness::XCOperator< T, NDIM >::allow_weak_form(), madness::XCOperator< T, NDIM >::apply_tau_term(), calc, madness::CalculationParameters::charge(), do_ac(), do_pcm(), get_calc_param(), madness::get_size(), madness::XCOperator< T, NDIM >::has_tau_term(), madness::XCOperator< T, NDIM >::is_weak_form(), madness::XCOperator< T, NDIM >::make_xc_potential(), molecule(), madness::mul(), madness::NemoBase::ncf, madness::nemo, pcm, madness::Coulomb< T, NDIM >::potential(), madness::MacroTaskInfo::preset(), madness::print(), madness::NemoBase::R_square, madness::scale(), madness::Exchange< T, NDIM >::set_printlevel(), madness::Exchange< T, NDIM >::set_symmetric(), madness::Coulomb< T, NDIM >::set_taskq(), madness::Exchange< T, NDIM >::set_taskq(), madness::XCOperator< T, NDIM >::set_tau(), madness::Exchange< T, NDIM >::string2algorithm(), madness::stringify(), madness::timer::tag(), madness::truncate(), madness::XCOperator< T, NDIM >::weak_xc_terms(), madness::NemoBase::world, and madness::zero_functions_compressed().

Referenced by compute_nemo_potentials(), and compute_nemo_potentials().

◆ do_ac()

bool madness::Nemo::do_ac ( ) const
inline

the asymptotic correction is defunct: its ac_data parameter was removed, and the code paths guarded by do_ac() are kept but never taken. It was never reconciled with the weak xc form, whose Fock block is built from the uncorrected potential.

Referenced by compute_nemo_potentials_impl(), and make_fock_operator().

◆ do_pcm()

◆ do_symmetry()

bool madness::Nemo::do_symmetry ( ) const
inline

References symmetry_projector.

Referenced by madness::OEP::iterate(), and solve().

◆ get_ac()

AC< 3 > madness::Nemo::get_ac ( ) const
inline

References ac.

◆ get_calc()

◆ get_calc_param()

◆ get_coulomb_potential()

real_function_3d madness::Nemo::get_coulomb_potential ( const vecfuncT & psi) const
protected

◆ get_nemo_param()

const NemoCalculationParameters & madness::Nemo::get_nemo_param ( ) const
inline

◆ get_pcm()

PCM madness::Nemo::get_pcm ( ) const
inline

References pcm.

◆ get_symmetry_projector()

projector_irrep madness::Nemo::get_symmetry_projector ( ) const
inline

return the symmetry_projector

References symmetry_projector.

◆ gradient()

◆ help()

void madness::Nemo::help ( )
inlinestatic

References madness::print(), and madness::print_header2().

Referenced by main().

◆ hessian()

◆ is_dft()

bool madness::Nemo::is_dft ( ) const
inline

◆ kinetic_energy_potential()

real_function_3d madness::Nemo::kinetic_energy_potential ( const vecfuncT & nemo) const

the Laplacian of the density

compute the kinetic energy potential using Eq. (16) of R. A. King and N. C. Handy, “Kinetic energy functionals from the Kohn–Sham potential,” Phys. Chem. Chem. Phys., vol. 2, no. 22, pp. 5049–5056, 2000.

References madness::apply(), madness::binary_op(), calc, diff(), madness::dot(), madness::gaxpy(), get_calc(), madness::mul(), madness::NemoBase::ncf, madness::nemo, madness::norm2(), madness::constants::pi, poisson, madness::print(), madness::NemoBase::R, madness::NemoBase::R_square, madness::save(), madness::scale(), madness::SmoothingOperator3D(), madness::sub(), sum, and madness::NemoBase::world.

◆ load_function()

template<typename T, size_t NDIM>
void madness::Nemo::load_function ( std::vector< Function< T, NDIM > > & f,
const std::string name ) const
protected

load a function

References madness::f, name(), madness::print(), and madness::NemoBase::world.

Referenced by compute_all_cphf().

◆ load_mos()

void madness::Nemo::load_mos ( World & w)
inline

References calc, and w().

Referenced by madness::OEP::value().

◆ localize()

vecfuncT madness::Nemo::localize ( const vecfuncT & nemo,
const double dconv,
const bool randomize ) const
protected

◆ make_cphf_constant_term()

vecfuncT madness::Nemo::make_cphf_constant_term ( const size_t iatom,
const int iaxis,
const vecfuncT & R2nemo,
const real_function_3d & rhonemo ) const
protected

◆ make_ddensity()

real_function_3d madness::Nemo::make_ddensity ( const real_function_3d & rhonemo,
const int axis ) const

make the derivative of the density

$ \nabla\rho = 2R^X R \rho_R + R^2\nabla \rho_R $

Parameters
[in]rhonemothe regularized density
[in]axisthe component of the nabla operator
Returns
the gradient of the reconstructed density

References axis, madness::copy(), D, madness::free_space_derivative(), madness::FunctionFactory< T, NDIM >::functor(), madness::NemoBase::ncf, madness::NemoBase::R_square, madness::FunctionFactory< T, NDIM >::truncate_on_project(), and madness::NemoBase::world.

Referenced by hessian().

◆ make_density() [1/2]

real_function_3d madness::Nemo::make_density ( const Tensor< double > & occ,
const vecfuncT & nemo ) const

◆ make_density() [2/2]

real_function_3d madness::Nemo::make_density ( const tensorT & occ,
const vecfuncT & bra,
const vecfuncT & ket,
const bool refine = false ) const

make the density using different bra and ket vectors

e.g. for computing the perturbed density \sum_i \phi_i \phi_i^X or when using nemos: \sum_i R2nemo_i nemo_i

References calc, madness::compress(), madness::FunctionFactory< T, NDIM >::compressed(), madness::FunctionDefaults< NDIM >::refine, madness::Function< T, NDIM >::gaxpy(), madness::mul(), and madness::NemoBase::world.

◆ make_fock_operator()

◆ make_incomplete_hessian()

Tensor< double > madness::Nemo::make_incomplete_hessian ( ) const
protected

compute the incomplete hessian

incomplete hessian is the nuclear-nuclear contribution, and the contribution from the second derivative of the nuclear potential, and also the derivative of the nuclear correlation factor. i.e. all contributions that do not contain the regularized perturbed density, but it will contain parts of the perturbed density

References madness::FunctionDefaults< NDIM >::refine, madness::FunctionFactory< T, NDIM >::functor(), get_calc(), madness::inner(), make_density(), molecule(), madness::Molecule::natom(), madness::NemoBase::ncf, madness::nemo, madness::Molecule::nuclear_repulsion_hessian(), madness::NemoBase::R_square, and madness::NemoBase::world.

Referenced by compute_all_cphf().

◆ make_incomplete_hessian_response_part()

Tensor< double > madness::Nemo::make_incomplete_hessian_response_part ( const std::vector< vecfuncT > & xi) const
protected

compute the complementary incomplete hessian

Parameters
[in]xithe response functions including the parallel part

References madness::_(), calc, madness::dot(), h(), madness::inner(), molecule(), madness::Molecule::natom(), madness::nemo, madness::NemoBase::R_square, madness::NemoBase::world, and xi.

Referenced by compute_all_cphf().

◆ make_plots()

void madness::Nemo::make_plots ( const real_function_3d & f,
const std::string & name = "function" ) const
inlineprotected

◆ make_sigma()

◆ molecule() [1/2]

◆ molecule() [2/2]

Molecule & madness::Nemo::molecule ( ) const
inline

return a reference to the molecule

References calc.

◆ name()

std::string madness::Nemo::name ( ) const
inlinevirtual

Implements madness::QCPropertyInterface.

Reimplemented in madness::OEP.

Referenced by load_function(), make_plots(), and save_function().

◆ population_analysis()

nlohmann::json madness::Nemo::population_analysis ( ) const

atomic charges of the orbitals R*nemo by the schemes of the population key

Prints a table per scheme on rank 0 (population::PopulationAnalysis); nemo is closed shell.

Returns
the results on every rank; empty when population is none

References madness::population::PopulationAnalysis::analyze(), calc, madness::mul(), madness::NemoBase::R, madness::population::PopulationAnalysis::requested(), and madness::NemoBase::world.

Referenced by analyze().

◆ print_parameters()

void madness::Nemo::print_parameters ( )
inlinestatic

◆ provides_gradient()

bool madness::Nemo::provides_gradient ( ) const
inlinevirtual

Override this to return true if the derivative is implemented.

Reimplemented from madness::OptimizationTargetInterface.

◆ purify_hessian()

Tensor< double > madness::Nemo::purify_hessian ( const Tensor< double > & hessian) const

purify and symmetrize the hessian

The hessian should be symmetric, but it is not, because

\‍[ \langle i^{Y_B}|H^{X_A}|i\rangle \neq \langle i|H^{X_A}|i^{Y_B}\rangle
\‍]

does holds analytically, but not numerically. If the two numbers differ, pick the more trustworthy, which is the one with a heavy atom causing the perturbed density and the light atom being the nuclear singularity.

Parameters
[in]hessianthe raw hessian
Returns
a symmetrized hessian

References calc, madness::copy(), diff(), hessian(), madness::print(), and madness::NemoBase::world.

Referenced by hessian().

◆ save_function()

template<typename T, size_t NDIM>
void madness::Nemo::save_function ( const std::vector< Function< T, NDIM > > & f,
const std::string name ) const
protected

save a function

References madness::f, name(), madness::print(), and madness::NemoBase::world.

Referenced by compute_all_cphf(), and hessian().

◆ selftest()

bool madness::Nemo::selftest ( )
inlinevirtual

Implements madness::QCPropertyInterface.

Reimplemented in madness::OEP.

◆ set_protocol()

◆ smoothen()

void madness::Nemo::smoothen ( real_function_3d & f)
inlinestatic

smooth a function by projecting it onto k-1 and then average with k

kept it here for further testing

References madness::f, madness::FunctionDefaults< NDIM >::k, and madness::project().

◆ solve()

◆ solve_cphf()

vecfuncT madness::Nemo::solve_cphf ( const size_t iatom,
const int iaxis,
const Tensor< double > & fock,
const vecfuncT & guess,
const vecfuncT & rhsconst,
const Tensor< double > & incomplete_hessian,
const vecfuncT & parallel,
const SCFProtocol & proto,
const std::string & xc_data ) const

solve the CPHF equations for the nuclear displacements

solve the CPHF equation for the nuclear displacements

this function computes that part of the orbital response that is orthogonal to the occupied space. If no NCF's are used this corresponds to the normal response. If NCF's are used the part parallel to the occupied space must be added!

\‍[    F^X = F^\perp + F^\parallel
\‍]

cf parallel_CPHF()

Parameters
[in]iatomthe atom A to be moved
[in]iaxisthe coordinate X of iatom to be moved
Returns
\ket{i^X} or \ket{F^\perp}
Parameters
[in]iatomthe atom A to be moved
[in]iaxisthe coordinate X of iatom to be moved
Returns
\frac{\partial}{\partial X_A} \varphi

References madness::_(), madness::Tensor< T >::absmax(), madness::apply(), b, calc, madness::Coulomb< T, NDIM >::compute_potential(), madness::copy(), madness::SCFProtocol::dconv, madness::dot(), madness::FunctionFactory< T, NDIM >::functor(), madness::gaxpy(), get_calc(), get_calc_param(), guess(), h(), madness::inner(), is_dft(), lo, madness::SCF::make_bsh_operators(), make_density(), molecule(), madness::mul(), madness::Molecule::natom(), madness::NemoBase::ncf, madness::nemo, norm(), madness::norm2(), madness::norm2s(), param, madness::Coulomb< T, NDIM >::potential(), madness::print(), Q(), madness::NemoBase::R_square, residual(), madness::scale(), madness::Exchange< T, NDIM >::set_bra_and_ket(), madness::Exchange< T, NDIM >::set_symmetric(), madness::stringify(), madness::transform(), trantol(), madness::truncate(), madness::FunctionFactory< T, NDIM >::truncate_on_project(), V(), madness::NemoBase::world, xc, and xi.

Referenced by compute_all_cphf().

◆ trantol()

double madness::Nemo::trantol ( ) const
inlineprotected

return the threshold for vanishing elements in orbital rotations

References calc, and get_calc().

Referenced by solve(), and solve_cphf().

◆ value() [1/2]

virtual double madness::Nemo::value ( )
inlinevirtual

Reimplemented in madness::OEP.

References calc, and value().

Referenced by main(), and value().

◆ value() [2/2]

◆ PNO

friend class PNO
friend

References PNO.

Referenced by PNO.

◆ TDHF

friend class TDHF
friend

References TDHF.

Referenced by TDHF.

Member Data Documentation

◆ ac

AC<3> madness::Nemo::ac
protected

asymptotic correction for DFT

Referenced by Nemo(), Nemo(), compute_nemo_potentials_impl(), get_ac(), and make_fock_operator().

◆ calc

◆ coords_sum

double madness::Nemo::coords_sum
mutableprivate

sum of square of coords at last solved geometry

Referenced by Nemo(), Nemo(), check_converged(), and value().

◆ nemo_param

const NemoCalculationParameters madness::Nemo::nemo_param

Referenced by Nemo(), Nemo(), and get_nemo_param().

◆ pcm

PCM madness::Nemo::pcm
private

◆ poisson

std::shared_ptr<real_convolution_3d> madness::Nemo::poisson
protected

a poisson solver

Referenced by kinetic_energy_potential(), and set_protocol().

◆ symmetry_projector

projector_irrep madness::Nemo::symmetry_projector
protected

◆ work_dir

std::filesystem::path madness::Nemo::work_dir

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