MADNESS 0.10.1
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
madness::TDHF Class Reference

#include <TDHF.h>

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

Classes

struct  TDHFParameters
 the TDHF parameter class More...
 

Public Member Functions

 TDHF (World &world, const commandlineparser &parser)
 ctor with command line parser, constructs SCF and Nemo objects on-the-fly, and delegates further
 
 TDHF (World &world, const commandlineparser &parser, std::shared_ptr< Nemo > nemo)
 ctor with command line parser, constructs SCF and Nemo objects on-the-fly, and delegates further
 
virtual ~TDHF ()
 
void analyze (const std::vector< CC_vecfunction > &x) const
 analyze the root: oscillator strength and contributions from occupied orbitals
 
void check_consistency () const
 check consistency of the input parameters
 
MolecularOrbitals< double, 3 > enforce_core_valence_separation (const Tensor< double > &fmat) const
 
std::shared_ptr< SCFget_calc () const
 
CalculationParametersget_calcparam () const
 
std::vector< CC_vecfunctionget_converged_roots () const
 
std::shared_ptr< Nemoget_nemo () const
 
TDHFParameters get_parameters () const
 
std::shared_ptr< NemoBaseget_reference () const
 
projector_irrep get_symmetry_projector () const
 
void initialize ()
 
void initialize (std::vector< CC_vecfunction > &start) const
 Initialize the CIS functions.
 
std::string name () const
 
void plot (const vector_real_function_3d &vf, const std::string &name) const
 plot planes and cubes
 
void prepare_calculation ()
 compute non-trivial prerequisites for the calculation
 
void print_frozen_orbitals () const
 
void print_xfunctions (const std::vector< CC_vecfunction > &f, const std::string message) const
 print information
 
virtual bool selftest ()
 
void set_reference (std::shared_ptr< NemoBase > reference)
 sets the reference wave function (nemo or oep)
 
std::vector< CC_vecfunctionsolve_cis () const
 Solve the CIS equations.
 
std::vector< CC_vecfunctionsort_xfunctions (std::vector< CC_vecfunction > x) const
 sort the xfunctions according to their excitation energy and name the excitation energies accordingly
 
void symmetrize (std::vector< CC_vecfunction > &v) const
 

Static Public Member Functions

static void help ()
 
static void print_parameters ()
 
static int test (World &world, commandlineparser &parser)
 

Private Member Functions

vector_real_function_3d apply_excitation_operators (const vector_real_function_3d &seed, const bool &use_trigo=true) const
 
std::vector< vector_real_function_3dapply_G (std::vector< CC_vecfunction > &x, std::vector< vector_real_function_3d > &V) const
 
vector_real_function_3d canonicalize (const vector_real_function_3d &v, Tensor< double > &veps) const
 canonicalize a set of orbitals (here the virtuals for the guess)
 
std::string filename_for_roots (const int ex) const
 
const vector_real_function_3d get_active_mo_bra () const
 
const vector_real_function_3d get_active_mo_ket () const
 
double get_orbital_energy (const size_t i) const
 
vector_real_function_3d get_tda_potential (const CC_vecfunction &x) const
 Make the TDA potential for a single excitation vector.
 
bool iterate_cis_final_vectors (std::vector< CC_vecfunction > &x) const
 
bool iterate_cis_guess_vectors (std::vector< CC_vecfunction > &x) const
 
bool iterate_vectors (std::vector< CC_vecfunction > &x, const std::vector< CC_vecfunction > &y, bool iterate_y, const double dconv, const double econv, const double iter, const bool kain) const
 
vector_real_function_3d make_bra (const CC_vecfunction &ket) const
 convenience
 
real_function_3d make_bra (const real_function_3d &ket) const
 
vector_real_function_3d make_bra (const vector_real_function_3d &ket) const
 maybe move this into nuclear_correlation class ?
 
Tensor< double > make_cis_matrix (const vector_real_function_3d &virtuals, const Tensor< double > &veps) const
 compute the CIS matrix for a given set of virtuals
 
vector< CC_vecfunctionmake_guess_from_initial_diagonalization () const
 make the initial guess by explicitly diagonalizing a CIS matrix with virtuals from the make_virtuals routine
 
CC_vecfunction make_mo_bra (const std::vector< Function< double, 3 > > &amo) const
 Helper function to initialize the const mo_bra and ket elements.
 
CC_vecfunction make_mo_ket (const std::vector< Function< double, 3 > > &amo) const
 
Tensor< double > make_overlap_matrix (const std::vector< CC_vecfunction > &x) const
 
Tensor< double > make_perturbed_fock_matrix (const std::vector< CC_vecfunction > &x, const std::vector< vector_real_function_3d > &V) const
 
std::vector< vector_real_function_3dmake_potentials (const std::vector< CC_vecfunction > &x) const
 
std::vector< vector_real_function_3dmake_tdhf_potentials (std::vector< CC_vecfunction > &x, const std::vector< CC_vecfunction > &y) const
 Make the TDHF potential (not ready)
 
vector_real_function_3d make_virtuals () const
 Create a set of virtual orbitals for the initial guess.
 
void orthonormalize (std::vector< CC_vecfunction > &x, std::vector< vector_real_function_3d > &V) const
 
double oscillator_strength_length (const CC_vecfunction &x) const
 compute the oscillator strength in the length representation
 
double oscillator_strength_velocity (const CC_vecfunction &x) const
 compute the oscillator strength in the velocity representation
 
std::vector< CC_vecfunctionsolve_cis (std::vector< CC_vecfunction > &start) const
 
void solve_tdhf (std::vector< CC_vecfunction > &guess) const
 Solve TDHF equations (not ready)
 
std::vector< CC_vecfunctiontransform (const std::vector< CC_vecfunction > &x, const madness::Tensor< double > U) const
 Interface to the SCF.h fock_transform function.
 
std::vector< vector_real_function_3dtransform (const std::vector< vector_real_function_3d > &x, const madness::Tensor< double > U) const
 

Private Attributes

std::vector< CC_vecfunctionconverged_roots
 converged roots
 
Tensor< double > F_occ
 Fock matrix for occupied orbitals.
 
std::shared_ptr< CCConvolutionOperator< double, 3 > > g12
 
std::vector< CC_vecfunctionguess_roots
 stored guess roots roots to feed into the cycle, sorted backwards for easier pop_back calling
 
CC_vecfunction mo_bra_
 
CC_vecfunction mo_ket_
 MO bra and ket.
 
CCMessenger msg
 the messenger IO
 
TDHFParameters parameters
 The TDHFParameters for the Calculations.
 
QProjector< double, 3 > Q
 the Projector to the virtual space
 
std::shared_ptr< NemoBasereference_
 The Nemo structure (convenience)
 
projector_irrep symmetry_projector
 the symmetry projector
 
Worldworld
 The MPI Communicator.
 

Detailed Description

The TDHF class solves CIS/TDA equations and hopefully soon the full TDHF/TDDFT equations

Constructor & Destructor Documentation

◆ TDHF() [1/2]

madness::TDHF::TDHF ( World world,
const commandlineparser parser 
)

ctor with command line parser, constructs SCF and Nemo objects on-the-fly, and delegates further

Parameters
worldthe world
parserthe parser

◆ TDHF() [2/2]

madness::TDHF::TDHF ( World world,
const commandlineparser parser,
std::shared_ptr< Nemo nemo 
)

ctor with command line parser, constructs SCF and Nemo objects on-the-fly, and delegates further

Parameters
worldthe world
parserthe parser

References madness::TDHF::TDHFParameters::do_oep(), get_calc(), initialize(), parameters, madness::TDHF::TDHFParameters::set_derived_values(), set_reference(), and world.

◆ ~TDHF()

virtual madness::TDHF::~TDHF ( )
inlinevirtual

Member Function Documentation

◆ analyze()

void madness::TDHF::analyze ( const std::vector< CC_vecfunction > &  x) const

◆ apply_excitation_operators()

vector_real_function_3d madness::TDHF::apply_excitation_operators ( const vector_real_function_3d seed,
const bool &  use_trigo = true 
) const
private

multiply excitation operators defined in the parameters with the seed functions

Parameters
[in]theseeds, define the function which are multiplied by the excitation operators
[in]use_trigo,iffalse polynomials are used for excitation operators, else trigonometric functions (i.e. x^2y vs sin^2(x)*sin(y)) Trigonometric functions are prefered since they are bounded (no weird behaviour at the boundaries for large exponents)

References madness::append(), madness::guessfactory::apply_polynomial_exop(), madness::guessfactory::apply_trigonometric_exop(), madness::guessfactory::compute_centroids(), madness::copy(), madness::TDHF::TDHFParameters::exops(), madness::WorldGopInterface::fence(), madness::World::gop, madness::TDHF::TDHFParameters::guess_excitation_operators(), madness::guessfactory::make_predefined_exop_strings(), msg, parameters, madness::CCTimer::print(), and world.

Referenced by make_virtuals().

◆ apply_G()

std::vector< vector_real_function_3d > madness::TDHF::apply_G ( std::vector< CC_vecfunction > &  x,
std::vector< vector_real_function_3d > &  V 
) const
private

Apply the Greens function to a vector of vectorfunction with a given potential

Parameters
[in]xthe vector of vectorfunctions where G will be applied to
[in]Vthe vector of potentials to the vectorfunctions, will be cleared afterwards (potentials are all potentials excpet the nuclear: 2J - K + Q(2pJ - pK)
[out]thevectorfunctions after G has been applied the energy is assumed to be stored in the CC_vecfunctions member omega the wavefunction error is stored in the CC_vecfunctions member current_error

References madness::apply(), madness::BSHOperatorPtr3D(), madness::TDHF::TDHFParameters::debug(), madness::WorldGopInterface::fence(), madness::TDHF::TDHFParameters::freeze(), get_calcparam(), get_orbital_energy(), get_reference(), get_tda_potential(), madness::World::gop, madness::CCTimer::info(), lo, MADNESS_ASSERT, msg, omega, madness::CCMessenger::output(), p(), parameters, Q, residual(), madness::RESPONSE, madness::scale(), shift, madness::sub(), madness::TDHF::TDHFParameters::thresh(), madness::type(), madness::UNDEFINED, V(), madness::CCMessenger::warning(), and world.

Referenced by iterate_vectors().

◆ canonicalize()

vector_real_function_3d madness::TDHF::canonicalize ( const vector_real_function_3d v,
Tensor< double > &  veps 
) const
private

canonicalize a set of orbitals (here the virtuals for the guess)

Parameters
[out]vepsorbital energies of the virtuals

References madness::TDHF::TDHFParameters::debug(), get_calc(), get_reference(), make_bra(), madness::matrix_inner(), msg, parameters, madness::CCTimer::print(), madness::transform(), v, and world.

Referenced by make_guess_from_initial_diagonalization().

◆ check_consistency()

void madness::TDHF::check_consistency ( ) const

◆ enforce_core_valence_separation()

MolecularOrbitals< double, 3 > madness::TDHF::enforce_core_valence_separation ( const Tensor< double > &  fmat) const

◆ filename_for_roots()

std::string madness::TDHF::filename_for_roots ( const int  ex) const
inlineprivate

◆ get_active_mo_bra()

const vector_real_function_3d madness::TDHF::get_active_mo_bra ( ) const
inlineprivate

◆ get_active_mo_ket()

const vector_real_function_3d madness::TDHF::get_active_mo_ket ( ) const
inlineprivate

◆ get_calc()

std::shared_ptr< SCF > madness::TDHF::get_calc ( ) const
inline

◆ get_calcparam()

CalculationParameters & madness::TDHF::get_calcparam ( ) const
inline

◆ get_converged_roots()

std::vector< CC_vecfunction > madness::TDHF::get_converged_roots ( ) const
inline

References converged_roots.

◆ get_nemo()

std::shared_ptr< Nemo > madness::TDHF::get_nemo ( ) const
inline

◆ get_orbital_energy()

double madness::TDHF::get_orbital_energy ( const size_t  i) const
inlineprivate

◆ get_parameters()

TDHFParameters madness::TDHF::get_parameters ( ) const
inline

References parameters.

Referenced by main().

◆ get_reference()

std::shared_ptr< NemoBase > madness::TDHF::get_reference ( ) const
inline

◆ get_symmetry_projector()

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

References symmetry_projector.

Referenced by check_consistency().

◆ get_tda_potential()

vector_real_function_3d madness::TDHF::get_tda_potential ( const CC_vecfunction x) const
private

◆ help()

static void madness::TDHF::help ( )
inlinestatic

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

Referenced by main().

◆ initialize() [1/2]

void madness::TDHF::initialize ( )

◆ initialize() [2/2]

void madness::TDHF::initialize ( std::vector< CC_vecfunction > &  start) const

Initialize the CIS functions.

Parameters
[in

out] on input the already obtained guess functions (or empty vector), on output new guess functions are added

References guess(), madness::TDHF::TDHFParameters::guess_excitations(), madness::TDHF::TDHFParameters::guess_maxiter(), initialize(), iterate_cis_guess_vectors(), MADNESS_EXCEPTION, make_guess_from_initial_diagonalization(), msg, madness::CCMessenger::output(), parameters, and madness::CCMessenger::subsection().

◆ iterate_cis_final_vectors()

bool madness::TDHF::iterate_cis_final_vectors ( std::vector< CC_vecfunction > &  x) const
private

iterate the final CIS vectors

Parameters
[in,out]xon input the guess, on output the iterated guess see CC_Structures.h CCParameters class for convergence criteria

References madness::TDHF::TDHFParameters::dconv(), madness::TDHF::TDHFParameters::econv(), iterate_vectors(), madness::TDHF::TDHFParameters::kain_subspace(), madness::TDHF::TDHFParameters::maxiter(), and parameters.

Referenced by solve_cis().

◆ iterate_cis_guess_vectors()

bool madness::TDHF::iterate_cis_guess_vectors ( std::vector< CC_vecfunction > &  x) const
private

iterate the CIS guess vectors

Parameters
[in,out]xon input the guess, on output the iterated guess see CC_Structures.h CCParameters class for convergence criteria

References madness::TDHF::TDHFParameters::guess_dconv(), madness::TDHF::TDHFParameters::guess_econv(), madness::TDHF::TDHFParameters::guess_maxiter(), iterate_vectors(), and parameters.

Referenced by initialize(), and solve_cis().

◆ iterate_vectors()

bool madness::TDHF::iterate_vectors ( std::vector< CC_vecfunction > &  x,
const std::vector< CC_vecfunction > &  y,
bool  iterate_y,
const double  dconv,
const double  econv,
const double  iter,
const bool  kain 
) const
private

◆ make_bra() [1/3]

vector_real_function_3d madness::TDHF::make_bra ( const CC_vecfunction ket) const
inlineprivate

◆ make_bra() [2/3]

real_function_3d madness::TDHF::make_bra ( const real_function_3d ket) const
inlineprivate

References make_bra(), and v.

◆ make_bra() [3/3]

vector_real_function_3d madness::TDHF::make_bra ( const vector_real_function_3d ket) const
inlineprivate

◆ make_cis_matrix()

Tensor< double > madness::TDHF::make_cis_matrix ( const vector_real_function_3d virtuals,
const Tensor< double > &  veps 
) const
private

◆ make_guess_from_initial_diagonalization()

vector< CC_vecfunction > madness::TDHF::make_guess_from_initial_diagonalization ( ) const
private

◆ make_mo_bra()

CC_vecfunction madness::TDHF::make_mo_bra ( const std::vector< Function< double, 3 > > &  amo) const
inlineprivate

Helper function to initialize the const mo_bra and ket elements.

References get_reference(), madness::HOLE, parameters, madness::reconstruct(), madness::set_thresh(), madness::TDHF::TDHFParameters::thresh(), madness::truncate(), and world.

Referenced by prepare_calculation().

◆ make_mo_ket()

CC_vecfunction madness::TDHF::make_mo_ket ( const std::vector< Function< double, 3 > > &  amo) const
inlineprivate

◆ make_overlap_matrix()

Tensor< double > madness::TDHF::make_overlap_matrix ( const std::vector< CC_vecfunction > &  x) const
private

◆ make_perturbed_fock_matrix()

Tensor< double > madness::TDHF::make_perturbed_fock_matrix ( const std::vector< CC_vecfunction > &  x,
const std::vector< vector_real_function_3d > &  V 
) const
private

◆ make_potentials()

std::vector< vector_real_function_3d > madness::TDHF::make_potentials ( const std::vector< CC_vecfunction > &  x) const
private

Make the potentials to a given vector of vecfunctions (excitations)

Parameters
[in]Thevector of excitations
[out]Thepotentials

References madness::TDHF::TDHFParameters::debug(), get_tda_potential(), madness::CCTimer::info(), MADNESS_ASSERT, msg, parameters, V(), world, and xi.

Referenced by iterate_vectors().

◆ make_tdhf_potentials()

std::vector< vector_real_function_3d > madness::TDHF::make_tdhf_potentials ( std::vector< CC_vecfunction > &  x,
const std::vector< CC_vecfunction > &  y 
) const
private

Make the TDHF potential (not ready)

References MADNESS_EXCEPTION.

Referenced by iterate_vectors().

◆ make_virtuals()

vector_real_function_3d madness::TDHF::make_virtuals ( ) const
private

◆ name()

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

Implements madness::QCPropertyInterface.

Referenced by plot().

◆ orthonormalize()

void madness::TDHF::orthonormalize ( std::vector< CC_vecfunction > &  x,
std::vector< vector_real_function_3d > &  V 
) const
private

orthonormalize a vector of excitations

Parameters
[in,out]inputthe excitations, output: the orthonormalized excitations
[in]inputthe potentials, if empty the potentials will be recalculated but NOT stored output: the transformed potentials

References madness::TDHF::TDHFParameters::debug(), delta, get_calc(), madness::CCTimer::info(), make_overlap_matrix(), make_perturbed_fock_matrix(), msg, parameters, madness::BaseTensor::size(), madness::TDHF::TDHFParameters::thresh(), transform(), V(), and world.

Referenced by iterate_vectors().

◆ oscillator_strength_length()

double madness::TDHF::oscillator_strength_length ( const CC_vecfunction x) const
private

compute the oscillator strength in the length representation

the oscillator strength is given by

\[
f = 2/3 * \omega |<x | \vec \mu | i >| ^2 * 2
\]

where $ x $ is the excited state, and $ i $ is the ground state

Parameters
[in]roota converged root

the oscillator strength is given by

\[
f = 2/3 * \omega |<x | \vec \mu | i >| ^2 * 2
\]

where $ x $ is the excited state, and $ i $ is the ground state

Parameters
[in]roota converged root

References a, madness::f, get_active_mo_bra(), madness::CC_vecfunction::get_vecfunction(), madness::inner(), madness::CC_vecfunction::omega, madness::Tensor< T >::sum(), madness::Tensor< T >::sumsq(), and world.

Referenced by analyze().

◆ oscillator_strength_velocity()

double madness::TDHF::oscillator_strength_velocity ( const CC_vecfunction x) const
private

compute the oscillator strength in the velocity representation

the oscillator strength is given by

\[
f = 2/(3 * \omega) |<x | \vec p | i >| ^2 * 2
\]

where $ x $ is the excited state, and $ i $ is the ground state

Parameters
[in]roota converged root

the oscillator strength is given by

\[
f = 2/(3 * \omega) |<x | \vec p | i >| ^2 * 2
\]

where $ x $ is the excited state, and $ i $ is the ground state

Parameters
[in]roota converged root

References a, madness::apply(), madness::f, get_active_mo_ket(), get_reference(), madness::CC_vecfunction::get_vecfunction(), madness::inner(), madness::CC_vecfunction::omega, madness::Tensor< T >::sum(), madness::Tensor< T >::sumsq(), and world.

Referenced by analyze().

◆ plot()

void madness::TDHF::plot ( const vector_real_function_3d vf,
const std::string &  name 
) const

◆ prepare_calculation()

void madness::TDHF::prepare_calculation ( )

◆ print_frozen_orbitals()

void madness::TDHF::print_frozen_orbitals ( ) const

◆ print_parameters()

static void madness::TDHF::print_parameters ( )
inlinestatic

◆ print_xfunctions()

void madness::TDHF::print_xfunctions ( const std::vector< CC_vecfunction > &  f,
const std::string  message 
) const

◆ selftest()

virtual bool madness::TDHF::selftest ( )
inlinevirtual

◆ set_reference()

void madness::TDHF::set_reference ( std::shared_ptr< NemoBase reference)
inline

sets the reference wave function (nemo or oep)

References reference_.

Referenced by TDHF().

◆ solve_cis() [1/2]

std::vector< CC_vecfunction > madness::TDHF::solve_cis ( ) const

◆ solve_cis() [2/2]

std::vector< CC_vecfunction > madness::TDHF::solve_cis ( std::vector< CC_vecfunction > &  start) const
private

◆ solve_tdhf()

void madness::TDHF::solve_tdhf ( std::vector< CC_vecfunction > &  guess) const
private

Solve TDHF equations (not ready)

References MADNESS_EXCEPTION, msg, and madness::CCMessenger::section().

◆ sort_xfunctions()

std::vector< CC_vecfunction > madness::TDHF::sort_xfunctions ( std::vector< CC_vecfunction x) const

sort the xfunctions according to their excitation energy and name the excitation energies accordingly

Referenced by iterate_vectors(), solve_cis(), and solve_cis().

◆ symmetrize()

void madness::TDHF::symmetrize ( std::vector< CC_vecfunction > &  v) const

◆ test()

int madness::TDHF::test ( World world,
commandlineparser parser 
)
static

◆ transform() [1/2]

std::vector< CC_vecfunction > madness::TDHF::transform ( const std::vector< CC_vecfunction > &  x,
const madness::Tensor< double >  U 
) const
private

◆ transform() [2/2]

std::vector< vector_real_function_3d > madness::TDHF::transform ( const std::vector< vector_real_function_3d > &  x,
const madness::Tensor< double >  U 
) const
inlineprivate

References transform(), and xi.

Referenced by orthonormalize(), and transform().

Member Data Documentation

◆ converged_roots

std::vector<CC_vecfunction> madness::TDHF::converged_roots
mutableprivate

converged roots

Referenced by get_converged_roots(), iterate_vectors(), solve_cis(), and solve_cis().

◆ F_occ

Tensor<double> madness::TDHF::F_occ
private

Fock matrix for occupied orbitals.

Referenced by get_tda_potential(), and prepare_calculation().

◆ g12

std::shared_ptr<CCConvolutionOperator<double,3> > madness::TDHF::g12
private

Operator Structure which can handle intermediates (use for exchange with GS orbitals) Can be replaced by another potential manager

Referenced by initialize(), and prepare_calculation().

◆ guess_roots

std::vector<CC_vecfunction> madness::TDHF::guess_roots
mutableprivate

stored guess roots roots to feed into the cycle, sorted backwards for easier pop_back calling

Referenced by iterate_vectors(), and solve_cis().

◆ mo_bra_

CC_vecfunction madness::TDHF::mo_bra_
private

◆ mo_ket_

CC_vecfunction madness::TDHF::mo_ket_
private

◆ msg

CCMessenger madness::TDHF::msg
private

◆ parameters

TDHFParameters madness::TDHF::parameters
private

◆ Q

QProjector<double, 3> madness::TDHF::Q
private

◆ reference_

std::shared_ptr<NemoBase> madness::TDHF::reference_
private

◆ symmetry_projector

projector_irrep madness::TDHF::symmetry_projector
private

◆ world

World& madness::TDHF::world
private

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