MADNESS  0.10.1
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
madness::Znemo Class Reference

#include <znemo.h>

Inheritance diagram for madness::Znemo:
Inheritance graph
[legend]
Collaboration diagram for madness::Znemo:
Collaboration graph
[legend]

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 More...
 
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_3dcompute_current_density (const std::vector< complex_function_3d > &alpha_mo, const std::vector< complex_function_3d > &beta_mo) const
 compute the current density More...
 
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 More...
 
Tensor< double > compute_linear_moment () const
 compute the expectation value of the linear moment r More...
 
Tensor< double > compute_magnetic_potential_expectation (const std::vector< real_function_3d > &A) const
 compute the expectation value of the magnetic vector potential A More...
 
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 More...
 
std::vector< complex_function_3dcompute_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 More...
 
Tensor< double_complexcompute_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 CalculationParametersget_cparam () const
 
void get_initial_orbitals ()
 get initial orbitals from guesses More...
 
Tensor< double > gradient ()
 
Tensor< double > gradient (const Tensor< double > &x) override
 Should return the derivative of the function. More...
 
bool have_beta () const
 are there explicit beta orbitals More...
 
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > hcore_guess () const
 hcore guess including the magnetic field More...
 
void invalidate_factors_and_potentials () override
 
void iterate ()
 
std::vector< complex_function_3dmake_bra (const std::vector< complex_function_3d > &mo) const
 
const Moleculemolecule () const
 
Moleculemolecule () override
 return the molecule of the target More...
 
std::string name () const override
 
bool need_recompute_factors_and_potentials (const double thresh) const override
 
std::vector< complex_function_3dnormalize (const std::vector< complex_function_3d > &mo) const
 
std::vector< complex_function_3dorthonormalize (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 More...
 
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > read_explicit_guess_functions () const
 read a list of functions for the guess More...
 
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 More...
 
std::pair< MolecularOrbitals< double_complex, 3 >, MolecularOrbitals< double_complex, 3 > > read_reference () const
 read orbitals from a znemo calculation More...
 
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) More...
 
void recompute_factors_and_potentials (const double thresh)
 adapt the thresholds consistently to a common value More...
 
template<typename solverT >
void rotate_subspace (const Tensor< double_complex > &U, solverT &solver) const
 rotate the KAIN subspace (cf. SCF.cc) More...
 
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> More...
 
double value ()
 compute the molecular energy More...
 
double value (const Tensor< double > &x) override
 compute the molecular energy More...
 
- 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, NDIMcompute_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 More...
 
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 More...
 
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 More...
 
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 More...
 
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) More...
 
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< NuclearCorrelationFactorget_ncf_ptr () const
 create an instance of the derived object based on the input parameters More...
 
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 More...
 
- Public Member Functions inherited from madness::OptimizationTargetInterface
virtual ~OptimizationTargetInterface ()
 
virtual bool provides_gradient () const
 Override this to return true if the derivative is implemented. More...
 
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. More...
 
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. More...
 

Static Public Member Functions

static std::vector< real_function_3dcompute_magnetic_vector_potential (World &world, const coord_3d &Bvec)
 compute the magnetic vector potential A More...
 
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 More...
 
template<typename T >
static Tensor< TQ2 (const Tensor< T > &s)
 

Public Attributes

std::vector< complex_function_3damo
 the molecular orbitals – alpha More...
 
std::vector< complex_function_3dbmo
 
- Public Attributes inherited from madness::NemoBase
std::shared_ptr< NuclearCorrelationFactorncf
 the nuclear correlation factor More...
 
real_function_3d R
 the nuclear correlation factor More...
 
real_function_3d R_square
 the square of the nuclear correlation factor More...
 
Worldworld
 

Protected Attributes

Tensor< double > aeps
 the orbital energies More...
 
AtomicBasisSet aobasis
 
coord_3d B
 the magnetic field B=rot(A) More...
 
Tensor< double > beps
 
std::shared_ptr< real_convolution_3dcoulop
 
Nemo::NemoCalculationParameters cparam
 standard calculation parameters More...
 
std::shared_ptr< Diamagnetic_potential_factordiafac
 
Molecule mol
 
Nemo_complex_Parameters param
 
std::shared_ptr< PotentialManagerpotentialmanager
 nuclear potential More...
 
printleveler print_info =printleveler(2)
 
std::vector< real_function_3drvec
 the linear moments r={x,y,z} More...
 
real_function_3d sbox
 the spherical damping box More...
 

Friends

class Zcis
 

Constructor & Destructor Documentation

◆ Znemo()

madness::Znemo::Znemo ( World w,
const commandlineparser parser 
)

Member Function Documentation

◆ analyze()

double madness::Znemo::analyze ( )

◆ canonicalize()

void madness::Znemo::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

◆ 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 the current density

following Lazzeretti, J. Mol. Struct, 313 (1994)

see also the first three terms of Eq. (47) of Hodge, Am. J. Phys., 82 (2014)

References madness::abs_square(), compute_magnetic_vector_potential(), madness::conj(), madness::QCPropertyInterface::density(), madness::div(), madness::dot(), madness::grad(), madness::imag(), madness::print(), madness::NemoBase::R_square, madness::rot(), madness::save(), madness::truncate(), and madness::NemoBase::world.

Referenced by analyze(), and test_compute_current_density().

◆ 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()

double madness::Znemo::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

◆ 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(), 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::inner(), 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::real(), and madness::NemoBase::world.

Referenced by analyze().

◆ compute_magnetic_vector_potential()

static 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(), 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()

Znemo::potentials madness::Znemo::compute_potentials ( const std::vector< complex_function_3d > &  mo,
const real_function_3d density,
const std::vector< complex_function_3d > &  rhs 
) const

◆ 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, bmo, param, and madness::Nemo_complex_Parameters::physical_B().

Referenced by analyze().

◆ compute_vmat()

Tensor< double_complex > madness::Znemo::compute_vmat ( const std::vector< complex_function_3d > &  mo,
const potentials pot 
) const

◆ custom_guess()

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

◆ 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_cparam()

const CalculationParameters& madness::Znemo::get_cparam ( ) const
inline

References cparam.

◆ get_initial_orbitals()

void madness::Znemo::get_initial_orbitals ( )

◆ gradient() [1/2]

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

◆ gradient() [2/2]

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

◆ have_beta()

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

◆ hcore_guess()

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

◆ help()

static 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()

void madness::Znemo::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

◆ print_parameters()

static 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_explicit_guess_functions()

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

◆ read_real_guess()

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

◆ 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 cparam, madness::CalculationParameters::have_beta(), mol, madness::print(), madness::MolecularOrbitals< T, NDIM >::read_restartaodata(), and madness::NemoBase::world.

Referenced by get_initial_orbitals().

◆ recompute_factors_and_potentials()

void madness::Znemo::recompute_factors_and_potentials ( const double  thresh)

◆ rotate_subspace()

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

◆ save_orbitals() [1/2]

void madness::Znemo::save_orbitals ( ) const
inline

◆ 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()

void madness::Znemo::test_compute_current_density ( ) const

◆ test_landau_wave_function()

void madness::Znemo::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 madness::Molecule::get_all_coords(), mol, and value().

Referenced by value().

◆ value() [2/2]

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

Friends And Related Function Documentation

◆ Zcis

friend class Zcis
friend

Member Data Documentation

◆ aeps

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

◆ amo

std::vector<complex_function_3d> madness::Znemo::amo

◆ aobasis

AtomicBasisSet madness::Znemo::aobasis
protected

◆ B

coord_3d madness::Znemo::B
protected

the magnetic field B=rot(A)

Referenced by output_calc_info_schema().

◆ beps

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

◆ bmo

std::vector<complex_function_3d> madness::Znemo::bmo

◆ coulop

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

◆ cparam

Nemo::NemoCalculationParameters madness::Znemo::cparam
protected

◆ diafac

std::shared_ptr<Diamagnetic_potential_factor> madness::Znemo::diafac
protected

◆ mol

Molecule madness::Znemo::mol
protected

◆ param

Nemo_complex_Parameters madness::Znemo::param
protected

◆ potentialmanager

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

◆ print_info

printleveler madness::Znemo::print_info =printleveler(2)
protected

◆ 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: