MADNESS 0.10.1
madness::TDHF Class Reference

#include <TDHF.h>

Inheritance diagram for madness::TDHF:
Collaboration diagram for madness::TDHF:

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< const Nemo > nemo)
 ctor with command line parser, constructs SCF and Nemo objects on-the-fly, and delegates further
 TDHF (World &world, const TDHFParameters &parameters, std::shared_ptr< const Nemo > reference)
virtual ~TDHF ()
nlohmann::json 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< SCF > get_calc () const
CalculationParameters get_calcparam () const
std::vector< CC_vecfunction > get_converged_roots () const
std::shared_ptr< const Nemo > get_nemo () const
const TDHFParameters & get_parameters () const
std::shared_ptr< const NemoBase > get_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_vecfunction > solve_cis () const
 Solve the CIS equations.
std::vector< CC_vecfunction > sort_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_3d > apply_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_vecfunction > make_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_3d > make_potentials (const std::vector< CC_vecfunction > &x) const
std::vector< vector_real_function_3d > make_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_vecfunction > solve_cis (std::vector< CC_vecfunction > &start) const
void solve_tdhf (std::vector< CC_vecfunction > &guess) const
 Solve TDHF equations (not ready).
std::vector< CC_vecfunction > transform (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_3d > transform (const std::vector< vector_real_function_3d > &x, const madness::Tensor< double > U) const

Private Attributes

std::vector< CC_vecfunction > converged_roots
 converged roots
Tensor< double > F_occ
 Fock matrix for occupied orbitals.
std::shared_ptr< CCConvolutionOperator< double, 3 > > g12
std::vector< CC_vecfunction > guess_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< const NemoBase > reference_
 The Nemo structure (convenience).
projector_irrep symmetry_projector
 the symmetry projector
World & world
 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/3]

madness::TDHF::TDHF ( World & world,
const TDHFParameters & parameters,
std::shared_ptr< const Nemo > reference )

ctor with world and parameters, constructs Nemo object on-the-fly, and delegates further

References g12, get_calc(), initialize(), mo_bra_, mo_ket_, msg, parameters, Q, reference_, madness::TDHFParameters::set_derived_values(), and world.

Referenced by TDHF(), and test().

◆ TDHF() [2/3]

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

References TDHF(), and world.

◆ TDHF() [3/3]

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

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

Parameters
worldthe world
parserthe parser

References g12, get_calc(), initialize(), mo_bra_, mo_ket_, msg, parameters, Q, reference_, and world.

◆ ~TDHF()

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

Member Function Documentation

◆ analyze()

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

analyze the root: oscillator strength and contributions from occupied orbitals

analyze the root: oscillator strength and contributions from occ

References madness::dot(), get_active_mo_bra(), get_active_mo_ket(), get_calc(), get_reference(), madness::constants::hartree_electron_volt_relationship, msg, madness::norm2s(), oscillator_strength_length(), oscillator_strength_velocity(), p(), param, parameters, madness::print(), madness::save(), madness::Function< T, NDIM >::trace(), and world.

Referenced by main(), and test().

◆ 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::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(), get_calcparam(), get_orbital_energy(), get_reference(), get_tda_potential(), madness::CCTimer::info(), lo, MADNESS_ASSERT, msg, omega, p(), parameters, Q, residual(), madness::RESPONSE, madness::scale(), shift, madness::sub(), madness::UNDEFINED, V(), 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 F, 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()

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

◆ get_calc()

◆ get_calcparam()

◆ get_converged_roots()

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

References converged_roots.

◆ get_nemo()

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

◆ get_orbital_energy()

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

◆ get_parameters()

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

References parameters.

Referenced by main().

◆ get_reference()

◆ get_symmetry_projector()

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

References symmetry_projector.

Referenced by check_consistency().

◆ get_tda_potential()

◆ help()

void madness::TDHF::help ( )
inlinestatic

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

Referenced by main().

◆ initialize() [1/2]

◆ 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(), initialize(), iterate_cis_guess_vectors(), MADNESS_EXCEPTION, make_guess_from_initial_diagonalization(), msg, and parameters.

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

General function to iterate vectors

Parameters
[in,out]xthe CIS (or TDHF x) functions
[in,out]theTDHF y functions (empty for CIS)
[in]iterate_y,iftrue the y equation for TDHF is iterated
[in]dconvwavefunction convergence (for the vector norm of the vectorfunction)
[in]econvEnergy convergece
[in]itermaximum number of iterations
[in]kainuse kain if true (kainsubspace is controlled over CCParameters class)

References apply_G(), converged_roots, delta, std::distance(), filename_for_roots(), guess_roots, madness::inner(), MADNESS_ASSERT, make_bra(), make_potentials(), make_tdhf_potentials(), msg, madness::norm2(), madness::norm2s(), omega, orthonormalize(), parameters, plot(), madness::CCTimer::print(), madness::timer::print(), print_xfunctions(), Q, sort_xfunctions(), madness::sub(), symmetrize(), madness::truncate(), V(), and world.

Referenced by iterate_cis_final_vectors(), and iterate_cis_guess_vectors().

◆ make_bra() [1/3]

◆ 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

maybe move this into nuclear_correlation class ?

References madness::CCTimer::info(), madness::mul(), parameters, reference_, and world.

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

◆ 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::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 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 delta, get_calc(), madness::CCTimer::info(), make_overlap_matrix(), make_perturbed_fock_matrix(), msg, parameters, madness::BaseTensor::size(), 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, madness::FunctionFactory< T, NDIM >::functor(), get_active_mo_bra(), madness::CC_vecfunction::get_vecfunction(), madness::inner(), madness::CC_vecfunction::omega, 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, madness::free_space_derivative(), get_active_mo_ket(), get_reference(), madness::CC_vecfunction::get_vecfunction(), madness::inner(), madness::CC_vecfunction::omega, 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()

◆ print_frozen_orbitals()

void madness::TDHF::print_frozen_orbitals ( ) const

◆ print_parameters()

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_.

◆ solve_cis() [1/2]

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

Solve the CIS equations.

Parameters
[in/out]CC_vecfunction on input the guess functions (if empty or not enough the a guess will be generated) on output the solution

References converged_roots, madness::filename, filename_for_roots(), madness::CC_vecfunction::is_converged(), madness::CC_vecfunction::load_restartdata(), parameters, madness::print(), madness::print_header2(), print_xfunctions(), solve_cis(), sort_xfunctions(), and world.

Referenced by main(), solve_cis(), and test().

◆ solve_cis() [2/2]

◆ solve_tdhf()

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

Solve TDHF equations (not ready).

References MADNESS_EXCEPTION, and msg.

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

◆ 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 TDHF(), TDHF(), 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_

◆ mo_ket_

◆ msg

◆ parameters

◆ Q

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

◆ reference_

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

◆ symmetry_projector

projector_irrep madness::TDHF::symmetry_projector
private

◆ world


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