Collaboration diagram for mpqc::Wavefunction:

Documentation

Wavefunction = opaque function of atoms, only has 2 states: computed and not computed. Every Wavefunction lives in a world

Public Member Functions

 Wavefunction (const KeyVal &kv)
 The KeyVal constructor. More...
 
virtual ~Wavefunction ()
 
const std::shared_ptr< WavefunctionWorld > & wfn_world () const
 
virtual void obsolete ()
 
bool computed () const
 
const std::shared_ptr< const Molecule > & atoms () const
 
virtual void print (std::ostream &os=ExEnv::out0()) const
 
- Public Member Functions inherited from mpqc::DescribedClass
 DescribedClass ()=default
 
virtual ~DescribedClass ()
 
std::string class_key () const
 
- Public Member Functions inherited from mpqc::enable_shared_from_this< DescribedClass >
virtual ~enable_shared_from_this ()=default
 
std::shared_ptr< DescribedClassshared_from_this ()
 returns the pointer to this object More...
 
std::shared_ptr< std::add_const_t< DescribedClass > > shared_from_this () const
 returns the pointer to this object More...
 
- Public Member Functions inherited from mpqc::detail::virt_base_of_enable_shared_from_this
virtual ~virt_base_of_enable_shared_from_this ()=default
 
bool shared_from_this_possible () const
 
template<typename Target , typename = std::enable_if_t<!std::is_const_v<Target>>>
std::shared_ptr< Target > cast_shared_from_this_to ()
 returns the pointer to this cast to a particular type More...
 
template<typename Target >
std::shared_ptr< std::add_const_t< Target > > cast_shared_from_this_to () const
 returns the pointer to this cast to a particular type More...
 
- Public Member Functions inherited from mpqc::utility::Observer
 Observer ()=default
 
template<typename Observee >
 Observer (Observee *observee, std::function< void()> message)
 
 Observer (const Observer &other)=delete
 
Observeroperator= (const Observer &other)=delete
 
 Observer (Observer &&other)=default
 
Observeroperator= (Observer &&other)=default
 
virtual ~Observer ()
 

Protected Member Functions

template<typename WfnWorldType >
std::enable_if_t< std::is_base_of< WavefunctionWorld, WfnWorldType >::value, void > rebuild_wfn_world (const KeyVal &kv)
 
const std::string wfn_world_path () const
 
- Protected Member Functions inherited from mpqc::utility::Observer
template<typename Observee >
void register_message (Observee *observee, std::function< void()> message)
 
void clear_messages ()
 

Protected Attributes

bool computed_ = false
 

Additional Inherited Members

- Public Types inherited from mpqc::DescribedClass
typedef std::shared_ptr< DescribedClass >(* keyval_ctor_wrapper_type) (const KeyVal &)
 
- Static Public Member Functions inherited from mpqc::DescribedClass
static keyval_ctor_wrapper_type type_to_keyval_ctor (const std::string &type_name)
 
template<typename T >
static void register_keyval_ctor ()
 
template<typename T >
static bool is_registered ()
 
template<typename T >
static std::string class_key ()
 
static const keyval_ctor_registry_type & keyval_ctor_registry ()
 returns const ref to the keyval ctor registry More...
 

Constructor & Destructor Documentation

◆ Wavefunction()

mpqc::Wavefunction::Wavefunction ( const KeyVal kv)

The KeyVal constructor.

Parameters
[in]kvThe KeyVal object; it will be queried for the following keywords: | Keyword | Type | Default| Description | |------—|---—|-----—|----------—| | "wfn_world" | WavefunctionWorld or a class derived from it | If not given, will recursively look for "wfn_world" at every keyword level above the current, i.e. "..:wfn_world", then "..:..:wfn_world", etc.; if still not found the contents of this KeyVal object will be used to construct a WavefunctionWorld object directly and assigned to "wfn_world" path of the given KeyVal (see the note below). | This specifies the WavefunctionWorld object in which this object will live initially. |
Note
If WavefunctionWorld was directly constructed from kv then it will be registered with keyword "wfn_world" . The pointer will be removed from the KeyVal registry when this object is destructed so that kv is returned to its original state. The following code illustrates this:
auto atoms = std::make_shared<Molecule>(Molecule({{9, {0.0, 0.0,
0.0}}, {1, {0.0, 0.0, 1.8}}})); auto basis =
std::make_shared<AtomicBasis>(KeyVal{}.assign("atoms", mol).assign("name",
"3-21G")); KeyVal kv; kv.assign("atoms", atoms).assign("basis", basis) auto
wfn = std::make_shared<Wavefunction>(kv);
assert(kv.exists_object("wfn_world"));
wfn.reset();
assert(!kv.exists_object("wfn_world"));

Usually the derived class will need to ensure that the WavefunctionWorld object used by this object has the appropriate type, typically derived from WavefunctionWorld (e.g. lcao::WavefunctionWorld). To avoid the need for the user to specify the "wfn_world:type" keyword that matches the type expected by the derived Wavefunction, the derived ctor can use Wavefunction::rebuild_wfn_world to reconstruct the WavefunctionWorld object with the appropriate type.

◆ ~Wavefunction()

mpqc::Wavefunction::~Wavefunction ( )
virtual

Reimplemented in mpqc::lcao::Wavefunction.

Member Function Documentation

◆ atoms()

const std::shared_ptr<const Molecule>& mpqc::Wavefunction::atoms ( ) const
inline

◆ computed()

bool mpqc::Wavefunction::computed ( ) const
inline

◆ obsolete()

virtual void mpqc::Wavefunction::obsolete ( )
inlinevirtual

obsoletes the object so that after calling this method this->computed() returns false

Reimplemented in mpqc::lcao::AOWavefunction< Tile, Policy >.

◆ print()

virtual void mpqc::Wavefunction::print ( std::ostream &  os = ExEnv::out0()) const
inlinevirtual

◆ rebuild_wfn_world()

template<typename WfnWorldType >
std::enable_if_t<std::is_base_of<WavefunctionWorld, WfnWorldType>::value, void> mpqc::Wavefunction::rebuild_wfn_world ( const KeyVal kv)
inlineprotected

rebuilds wfn_world using WfnWorldType, if needed, using the same section from the same location as before. Used by the derived class' ctor to make the world of the matching derived world type

Template Parameters
WfnWorldTypea class derived from WavefunctionWorld
Parameters
[in,out]kvthe KeyVal object, assumed to be the same kv as used to construct this object
Note
this asserts (using MPQC_ASSERT) that this is only done once

◆ wfn_world()

const std::shared_ptr<WavefunctionWorld>& mpqc::Wavefunction::wfn_world ( ) const
inline
Returns
shared_ptr to the WavefunctionWorld object that this Wavefunction belongs to

◆ wfn_world_path()

const std::string mpqc::Wavefunction::wfn_world_path ( ) const
inlineprotected
Returns
the path at which wfn_world object is located in kv

Member Data Documentation

◆ computed_

bool mpqc::Wavefunction::computed_ = false
protected

The documentation for this class was generated from the following files:
auto basis(const std::vector<::libint2::Shell > &shells)
Definition: basis.h:32
const std::shared_ptr< const Molecule > & atoms() const
Definition: wfn.h:117