Wavefunction = opaque function of atoms, only has 2 states: computed and not computed. Every Wavefunction lives in a world
◆ Wavefunction()
mpqc::Wavefunction::Wavefunction |
( |
const KeyVal & |
kv | ) |
|
The KeyVal constructor.
- Parameters
-
[in] | kv | The 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 |
◆ 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 |
◆ print()
virtual void mpqc::Wavefunction::print |
( |
std::ostream & |
os = ExEnv::out0() | ) |
const |
|
inlinevirtual |
◆ rebuild_wfn_world()
template<typename WfnWorldType >
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
-
- Parameters
-
[in,out] | kv | the 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()
◆ 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
◆ computed_
bool mpqc::Wavefunction::computed_ = false |
|
protected |
The documentation for this class was generated from the following files: