MADNESS 0.10.1
madness::Znemo Class Reference

#include <znemo.h>

Inheritance diagram for madness::Znemo:
Collaboration diagram for madness::Znemo:

Classes

struct  landau_wave_function
 following Doucot Pascier 2005 More...
struct  p_orbital
struct  potentials
struct  s_orbital
struct  timer

Public Member Functions

 Znemo (World &w, const commandlineparser &parser)
double analyze ()
 analyse the results only
void canonicalize (std::vector< complex_function_3d > &amo, std::vector< complex_function_3d > &vnemo, potentials &pot, XNonlinearSolver< std::vector< complex_function_3d >, double_complex, vector_function_allocator< double_complex, 3 > > &solver, Tensor< double_complex > fock, Tensor< double_complex > ovlp) const
std::vector< real_function_3d > compute_current_density (const std::vector< complex_function_3d > &alpha_mo, const std::vector< complex_function_3d > &beta_mo) const
 compute the current density
real_function_3d compute_density (const std::vector< complex_function_3d > &amo, const std::vector< complex_function_3d > &bmo) const
double compute_energy (const std::vector< complex_function_3d > &amo, const potentials &apot, const std::vector< complex_function_3d > &bmo, const potentials &bpot, const bool do_print, const bool no_confinement) const
Tensor< double > compute_kinetic_momentum () const
 compute the expectation value of the kinetic momentum p
Tensor< double > compute_linear_moment () const
 compute the expectation value of the linear moment r
Tensor< double > compute_magnetic_potential_expectation (const std::vector< real_function_3d > &A) const
 compute the expectation value of the magnetic vector potential A
real_function_3d compute_nemo_density (const std::vector< complex_function_3d > &amo, const std::vector< complex_function_3d > &bmo) const
real_function_3d compute_nemo_spin_density (const std::vector< complex_function_3d > &amo, const std::vector< complex_function_3d > &bmo) const
potentials compute_potentials (const std::vector< complex_function_3d > &mo, const real_function_3d &density, const std::vector< complex_function_3d > &rhs) const
 compute the potential operators applied on the orbitals
std::vector< complex_function_3d > compute_residuals (const std::vector< complex_function_3d > &Vpsi, const std::vector< complex_function_3d > &psi, Tensor< double > &eps, const double levelshift=0.0) const
real_function_3d compute_spin_density (const std::vector< complex_function_3d > &amo, const std::vector< complex_function_3d > &bmo) const
Tensor< double > compute_standard_gauge_shift (const Tensor< double > &p_exp) const
 compute the shift of the molecule such that the kinetic momentum vanishes
Tensor< double_complex > compute_vmat (const std::vector< complex_function_3d > &mo, const potentials &pot) const
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > custom_guess () const
void do_step_restriction (const std::vector< complex_function_3d > &mo, std::vector< complex_function_3d > &mo_new) const
const CalculationParameters & get_calc_param () const
void get_initial_orbitals ()
 get initial orbitals from guesses
Tensor< double > gradient ()
Tensor< double > gradient (const Tensor< double > &x) override
 Should return the derivative of the function.
bool have_beta () const
 are there explicit beta orbitals
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > hcore_guess () const
 hcore guess including the magnetic field
void invalidate_factors_and_potentials () override
void iterate ()
std::vector< complex_function_3d > make_bra (const std::vector< complex_function_3d > &mo) const
const Molecule & molecule () const
Molecule & molecule () override
 return the molecule of the target
std::string name () const override
bool need_recompute_factors_and_potentials (const double thresh) const override
std::vector< complex_function_3d > normalize (const std::vector< complex_function_3d > &mo) const
std::vector< complex_function_3d > orthonormalize (const std::vector< complex_function_3d > &mo) const
void output_calc_info_schema (const double &energy) const
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > read_complex_guess () const
 read the guess orbitals from a previous nemo or moldft calculation
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > read_explicit_guess_functions () const
 read a list of functions for the guess
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > read_real_guess () const
 read the guess orbitals from a previous nemo or moldft calculation
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > read_reference () const
 read orbitals from a znemo calculation
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > read_restartaodata () const
 read guess as projection of the orbitals onto an AO basis set (for geometry optimization)
void recompute_factors_and_potentials (const double thresh)
 adapt the thresholds consistently to a common value
template<typename solverT>
void rotate_subspace (const Tensor< double_complex > &U, solverT &solver) const
 rotate the KAIN subspace (cf. SCF.cc)
void save_orbitals () const
void save_orbitals (std::string suffix) const
bool selftest () override
bool test () const
void test_compute_current_density () const
void test_landau_wave_function ()
bool test_U_potentials () const
 test the identity <F| f (T + Vdia ) f |F> = <F|f^2 (T + Udia) |F>
double value ()
 compute the molecular energy
double value (const Tensor< double > &x) override
 compute the molecular energy
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 std::shared_ptr< Fock< double, 3 > > make_fock_operator () 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 ()
virtual bool provides_gradient () const
 Override this to return true if the derivative is implemented.
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 std::vector< real_function_3d > compute_magnetic_vector_potential (World &world, const coord_3d &Bvec)
 compute the magnetic vector potential A
static void help ()
static void print_parameters ()
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

std::vector< complex_function_3d > amo
 the molecular orbitals – alpha
std::vector< complex_function_3d > bmo
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 Attributes

Tensor< double > aeps
 the orbital energies
AtomicBasisSet aobasis
coord_3d B
 the magnetic field B=rot(A)
Tensor< double > beps
CalculationParameters calc_param
std::shared_ptr< real_convolution_3d > coulop
std::shared_ptr< Diamagnetic_potential_factor > diafac
Molecule mol
Nemo::NemoCalculationParameters nemo_param
 standard calculation parameters
Nemo_complex_Parameters param
std::shared_ptr< PotentialManager > potentialmanager
 nuclear potential
printleveler print_info =printleveler(2)
std::vector< real_function_3d > rvec
 the linear moments r={x,y,z}
real_function_3d sbox
 the spherical damping box

Friends

class Zcis

Constructor & Destructor Documentation

◆ Znemo()

Member Function Documentation

◆ analyze()

◆ canonicalize()

◆ compute_current_density()

std::vector< real_function_3d > madness::Znemo::compute_current_density ( const std::vector< complex_function_3d > & alpha_mo,
const std::vector< complex_function_3d > & beta_mo ) const

◆ compute_density()

real_function_3d madness::Znemo::compute_density ( const std::vector< complex_function_3d > & amo,
const std::vector< complex_function_3d > & bmo ) const

◆ compute_energy()

◆ compute_kinetic_momentum()

Tensor< double > madness::Znemo::compute_kinetic_momentum ( ) const
inline

compute the expectation value of the kinetic momentum p

References amo, bmo, madness::grad(), madness::imag(), madness::inner(), madness::mo, and madness::NemoBase::world.

Referenced by analyze().

◆ compute_linear_moment()

Tensor< double > madness::Znemo::compute_linear_moment ( ) const
inline

compute the expectation value of the linear moment r

References amo, bmo, madness::FunctionFactory< T, NDIM >::functor(), madness::inner(), madness::mo, madness::real(), and madness::NemoBase::world.

◆ compute_magnetic_potential_expectation()

Tensor< double > madness::Znemo::compute_magnetic_potential_expectation ( const std::vector< real_function_3d > & A) const
inline

compute the expectation value of the magnetic vector potential A

References amo, bmo, madness::inner(), madness::mo, madness::real(), and madness::NemoBase::world.

Referenced by analyze().

◆ compute_magnetic_vector_potential()

std::vector< real_function_3d > madness::Znemo::compute_magnetic_vector_potential ( World & world,
const coord_3d & Bvec )
inlinestatic

compute the magnetic vector potential A

References A(), madness::FunctionFactory< T, NDIM >::functor(), and madness::NemoBase::world.

Referenced by analyze(), and compute_current_density().

◆ compute_nemo_density()

real_function_3d madness::Znemo::compute_nemo_density ( const std::vector< complex_function_3d > & amo,
const std::vector< complex_function_3d > & bmo ) const
inline

◆ compute_nemo_spin_density()

real_function_3d madness::Znemo::compute_nemo_spin_density ( const std::vector< complex_function_3d > & amo,
const std::vector< complex_function_3d > & bmo ) const
inline

◆ compute_potentials()

◆ compute_residuals()

std::vector< complex_function_3d > madness::Znemo::compute_residuals ( const std::vector< complex_function_3d > & Vpsi,
const std::vector< complex_function_3d > & psi,
Tensor< double > & eps,
const double levelshift = 0.0 ) const

◆ compute_spin_density()

real_function_3d madness::Znemo::compute_spin_density ( const std::vector< complex_function_3d > & amo,
const std::vector< complex_function_3d > & bmo ) const

◆ compute_standard_gauge_shift()

Tensor< double > madness::Znemo::compute_standard_gauge_shift ( const Tensor< double > & p_exp) const
inline

compute the shift of the molecule such that the kinetic momentum vanishes

References amo, B, bmo, and param.

Referenced by analyze().

◆ compute_vmat()

◆ custom_guess()

◆ do_step_restriction()

void madness::Znemo::do_step_restriction ( const std::vector< complex_function_3d > & mo,
std::vector< complex_function_3d > & mo_new ) const

◆ get_calc_param()

◆ get_initial_orbitals()

◆ gradient() [1/2]

Tensor< double > madness::Znemo::gradient ( )
inline

References gradient(), and mol.

Referenced by gradient().

◆ gradient() [2/2]

Tensor< double > madness::Znemo::gradient ( const Tensor< double > & x)
overridevirtual

◆ have_beta()

bool madness::Znemo::have_beta ( ) const
inline

◆ hcore_guess()

◆ help()

void madness::Znemo::help ( )
inlinestatic

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

Referenced by main().

◆ invalidate_factors_and_potentials()

void madness::Znemo::invalidate_factors_and_potentials ( )
overridevirtual

◆ iterate()

◆ make_bra()

std::vector< complex_function_3d > madness::Znemo::make_bra ( const std::vector< complex_function_3d > & mo) const

◆ molecule() [1/2]

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

References mol.

◆ molecule() [2/2]

Molecule & madness::Znemo::molecule ( )
inlineoverridevirtual

return the molecule of the target

Reimplemented from madness::MolecularOptimizationTargetInterface.

References mol.

Referenced by analyze(), custom_guess(), read_complex_guess(), read_real_guess(), and recompute_factors_and_potentials().

◆ name()

std::string madness::Znemo::name ( ) const
inlineoverridevirtual

◆ need_recompute_factors_and_potentials()

bool madness::Znemo::need_recompute_factors_and_potentials ( const double thresh) const
overridevirtual

◆ normalize()

std::vector< complex_function_3d > madness::Znemo::normalize ( const std::vector< complex_function_3d > & mo) const

◆ orthonormalize()

std::vector< complex_function_3d > madness::Znemo::orthonormalize ( const std::vector< complex_function_3d > & mo) const

◆ output_calc_info_schema()

void madness::Znemo::output_calc_info_schema ( const double & energy) const

References aeps, B, beps, energy, and get_calc_param().

Referenced by value().

◆ print_parameters()

void madness::Znemo::print_parameters ( )
inlinestatic

◆ read_complex_guess()

std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > madness::Znemo::read_complex_guess ( ) const

read the guess orbitals from a previous nemo or moldft calculation

References get_calc_param(), molecule(), madness::print(), madness::MolecularOrbitals< T, NDIM >::read_restartdata(), and madness::NemoBase::world.

◆ read_explicit_guess_functions()

◆ read_real_guess()

◆ read_reference()

std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > madness::Znemo::read_reference ( ) const

read orbitals from a znemo calculation

read a list of functions for the guess

References a, aeps, beps, name(), madness::print(), and madness::NemoBase::world.

Referenced by get_initial_orbitals().

◆ read_restartaodata()

std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > madness::Znemo::read_restartaodata ( ) const

read guess as projection of the orbitals onto an AO basis set (for geometry optimization)

read a list of functions for the guess

References get_calc_param(), have_beta(), mol, madness::print(), madness::MolecularOrbitals< T, NDIM >::read_restartaodata(), and madness::NemoBase::world.

Referenced by get_initial_orbitals().

◆ recompute_factors_and_potentials()

◆ rotate_subspace()

template<typename solverT>
void madness::Znemo::rotate_subspace ( const Tensor< double_complex > & U,
solverT & solver ) const
inline

◆ save_orbitals() [1/2]

◆ save_orbitals() [2/2]

void madness::Znemo::save_orbitals ( std::string suffix) const

◆ selftest()

bool madness::Znemo::selftest ( )
inlineoverridevirtual

◆ test()

bool madness::Znemo::test ( ) const

◆ test_compute_current_density()

◆ test_landau_wave_function()

◆ test_U_potentials()

bool madness::Znemo::test_U_potentials ( ) const

◆ value() [1/2]

double madness::Znemo::value ( )
inline

compute the molecular energy

References mol, and value().

Referenced by value().

◆ value() [2/2]

◆ Zcis

friend class Zcis
friend

References Zcis.

Referenced by Zcis.

Member Data Documentation

◆ aeps

Tensor<double> madness::Znemo::aeps
protected

◆ amo

◆ aobasis

AtomicBasisSet madness::Znemo::aobasis
protected

◆ B

◆ beps

Tensor<double> madness::Znemo::beps
protected

◆ bmo

◆ calc_param

CalculationParameters madness::Znemo::calc_param
protected

Referenced by Znemo(), and get_calc_param().

◆ coulop

std::shared_ptr<real_convolution_3d> madness::Znemo::coulop
protected

◆ diafac

◆ mol

◆ nemo_param

Nemo::NemoCalculationParameters madness::Znemo::nemo_param
protected

standard calculation parameters

Referenced by recompute_factors_and_potentials().

◆ param

◆ potentialmanager

std::shared_ptr<PotentialManager> madness::Znemo::potentialmanager
protected

◆ print_info

◆ rvec

std::vector<real_function_3d> madness::Znemo::rvec
protected

the linear moments r={x,y,z}

Referenced by Znemo(), and compute_potentials().

◆ sbox

real_function_3d madness::Znemo::sbox
protected

the spherical damping box

Referenced by iterate(), and recompute_factors_and_potentials().


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